feat(ocaml/belenios): init

This commit is contained in:
catvayor 2025-02-18 00:19:55 +01:00
parent fe7db521d4
commit 2df4e90159
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
3 changed files with 1988 additions and 0 deletions

View file

@ -0,0 +1,98 @@
{
lib,
fetchFromGitLab,
stdenv,
js_of_ocaml,
ocamlnet,
eliom,
calendar,
ocsipersist-sqlite-config,
cmdliner,
markup,
ocaml_gettext,
gettext-camomile,
hex,
ocsipersist,
csv,
atdgen,
libsodium,
ocaml,
findlib,
dune_3,
menhir,
nodejs,
importNpmLock,
}:
stdenv.mkDerivation rec {
pname = "belenios";
version = "3.0";
src = fetchFromGitLab {
domain = "gitlab.inria.fr";
owner = "belenios";
repo = "belenios";
rev = version;
hash = "sha256-paTkzWB2QiBfFnGfiMkTIHdKeg37PTGbMu25JLJc38U=";
};
buildInputs = [
js_of_ocaml
ocamlnet
eliom
calendar
ocsipersist-sqlite-config
cmdliner
markup
ocaml_gettext
gettext-camomile
hex
ocsipersist
csv
atdgen
libsodium
ocaml
findlib
dune_3
menhir
nodejs
importNpmLock.hooks.linkNodeModulesHook
];
nativeBuildInputs = [
];
npmDeps = importNpmLock.buildNodeModules {
npmRoot = "${src}/frontend";
packageLock = lib.importJSON ./package-lock.json;
inherit nodejs;
};
patchPhase = ''
substituteInPlace frontend/Makefile \
--replace-fail 'nodejs' '${lib.getExe' nodejs "node"}' \
--replace-fail 'npm install' 'cp ${./package-lock.json} . && ln -s ../node_modules node_modules'
'';
buildPhase = ''
dune build --release
dune exec -- \
src/scripts/checki18next/checki18next.exe --dir frontend/translations \
< src/scripts/checki18next/reference.json
'';
installPhase = ''
dune install --destdir=$out --prefix=/
contrib/make-tarball.sh $out/share/belenios-server/belenios.tar.gz
make DESTDIR=$out/share/belenios-server/ -C frontend
'';
meta = {
description = "Verifiable online voting system\r\nhttp://www.belenios.org";
homepage = "https://gitlab.inria.fr/belenios/belenios";
changelog = "https://gitlab.inria.fr/belenios/belenios/-/blob/${src.rev}/CHANGES.md";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ ];
mainProgram = "belenios";
platforms = lib.platforms.all;
};
}

1889
ocaml-pkgs/belenios/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -24,4 +24,5 @@ mkGeneralOverlay ./pkgs final prev
# tools from language specific pkgs sets
inherit (final.ocamlPackages) catala;
inherit (final.ocaml-ng.ocamlPackages_4_14) belenios;
}