diff --git a/belenios.tar.gz b/belenios.tar.gz new file mode 100644 index 0000000..2e43b94 Binary files /dev/null and b/belenios.tar.gz differ diff --git a/pkgs/belenios/atdgen.patch b/pkgs/belenios/atdgen.patch new file mode 100644 index 0000000..9e31279 --- /dev/null +++ b/pkgs/belenios/atdgen.patch @@ -0,0 +1,52 @@ +diff --git a/src/lib/core/dune b/src/lib/core/dune +index b3fa93bc..978bcfd5 100644 +--- a/src/lib/core/dune ++++ b/src/lib/core/dune +@@ -1,7 +1,7 @@ + (library + (name belenios_core) + (public_name belenios-lib.core) +- (libraries base64 hex yojson atdgen re belenios-platform) ++ (libraries base64 hex yojson atdgen-runtime re belenios-platform) + (modules_without_implementation question_sigs trustees_sig versioned_sig)) + + (rule +diff --git a/src/lib/question/dune b/src/lib/question/dune +index aecbfad1..f78738ef 100644 +--- a/src/lib/question/dune ++++ b/src/lib/question/dune +@@ -2,7 +2,7 @@ + (name belenios_question) + (public_name belenios-lib.question) + (modules_without_implementation types) +- (libraries yojson atdgen belenios-platform belenios-lib.core)) ++ (libraries yojson atdgen-runtime belenios-platform belenios-lib.core)) + + (rule + (targets question_h_t.ml question_h_t.mli) +diff --git a/src/lib/shell/dune b/src/lib/shell/dune +index 63828081..de8f3870 100644 +--- a/src/lib/shell/dune ++++ b/src/lib/shell/dune +@@ -3,7 +3,7 @@ + (public_name belenios-lib) + (libraries + yojson +- atdgen ++ atdgen-runtime + belenios-platform + belenios-lib.core + belenios-lib.v1)) +diff --git a/src/lib/v1/dune b/src/lib/v1/dune +index 4c0eb68d..890262c0 100644 +--- a/src/lib/v1/dune ++++ b/src/lib/v1/dune +@@ -4,7 +4,7 @@ + (modules_without_implementation types) + (libraries + yojson +- atdgen ++ atdgen-runtime + belenios-platform + belenios-lib.core + belenios-lib.question)) diff --git a/pkgs/belenios/default.nix b/pkgs/belenios/default.nix index 5ac0995..3776e62 100644 --- a/pkgs/belenios/default.nix +++ b/pkgs/belenios/default.nix @@ -7,14 +7,14 @@ ocamlPackages.buildDunePackage rec { pname = "belenios"; - version = "3.0"; + version = "3.1"; src = fetchFromGitLab { domain = "gitlab.inria.fr"; owner = pname; repo = pname; rev = version; - hash = "sha256-paTkzWB2QiBfFnGfiMkTIHdKeg37PTGbMu25JLJc38U="; + hash = "sha256-Mrx6AQakeBg6IeqNyDUZ5j6KaUGOh1AUfrLIxvDI45M="; }; nativeBuildInputs = with ocamlPackages; [ diff --git a/pkgs/belenios/flake.lock b/pkgs/belenios/flake.lock new file mode 100644 index 0000000..2e80cc2 --- /dev/null +++ b/pkgs/belenios/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1774244481, + "narHash": "sha256-4XfMXU0DjN83o6HWZoKG9PegCvKvIhNUnRUI19vzTcQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4590696c8693fea477850fe379a01544293ca4e2", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-25.11", + "type": "indirect" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/belenios/lib.nix b/pkgs/belenios/lib.nix index ca3c50b..615b8a2 100644 --- a/pkgs/belenios/lib.nix +++ b/pkgs/belenios/lib.nix @@ -12,14 +12,19 @@ ocamlPackages.buildDunePackage { atdgen ]; + buildInputs = with ocamlPackages; [ + hex + digestif + biniou + ]; + propagatedBuildInputs = [ belenios-platform ] ++ (with ocamlPackages; [ - atdgen + atdgen-runtime base64 - hex ocaml_gettext re uri diff --git a/pkgs/belenios/netstring.patch b/pkgs/belenios/netstring.patch new file mode 100644 index 0000000..bd105d8 --- /dev/null +++ b/pkgs/belenios/netstring.patch @@ -0,0 +1,13 @@ +diff --git a/src/web/server/common/dune b/src/web/server/common/dune +index 3324b582..50cf6c46 100644 +--- a/src/web/server/common/dune ++++ b/src/web/server/common/dune +@@ -15,7 +15,7 @@ + gettext.base + gettext.extension + gettext-camomile +- netstring) ++ sendmail) + (modules_without_implementation + web_i18n_sig + web_services_sig diff --git a/pkgs/belenios/platform-js.nix b/pkgs/belenios/platform-js.nix index b9da72c..d980e57 100644 --- a/pkgs/belenios/platform-js.nix +++ b/pkgs/belenios/platform-js.nix @@ -12,12 +12,12 @@ ocamlPackages.buildDunePackage { odoc ]; - propagatedBuildInputs = - [ - belenios-platform - ] - ++ (with ocamlPackages; [ - js_of_ocaml - js_of_ocaml-ppx - ]); + buildInputs = with ocamlPackages; [ + belenios-platform + lwt + js_of_ocaml + js_of_ocaml-ppx + digestif + hex + ]; } diff --git a/pkgs/belenios/platform-native.nix b/pkgs/belenios/platform-native.nix index cf3e213..aecc7be 100644 --- a/pkgs/belenios/platform-native.nix +++ b/pkgs/belenios/platform-native.nix @@ -13,12 +13,15 @@ ocamlPackages.buildDunePackage { odoc ]; - propagatedBuildInputs = + buildInputs = [ belenios-platform libsodium ] ++ (with ocamlPackages; [ + lwt cryptokit + digestif + zarith ]); } diff --git a/pkgs/belenios/platform.nix b/pkgs/belenios/platform.nix index 260cfd0..bc7dbeb 100644 --- a/pkgs/belenios/platform.nix +++ b/pkgs/belenios/platform.nix @@ -7,7 +7,11 @@ ocamlPackages.buildDunePackage { pname = "belenios-platform"; inherit (belenios) version src; - nativeBuildInputs = with ocamlPackages; [ - odoc + # nativeBuildInputs = with ocamlPackages; [ + # odoc + # ]; + + propagatedBuildInputs = with ocamlPackages; [ + lwt ]; } diff --git a/pkgs/belenios/server.nix b/pkgs/belenios/server.nix index 8e9bbfc..e95b5bc 100644 --- a/pkgs/belenios/server.nix +++ b/pkgs/belenios/server.nix @@ -10,6 +10,8 @@ ocamlPackages.buildDunePackage { pname = "belenios-server"; inherit (belenios) version src; + # dontDetectOcamlConflicts = true; + nativeBuildInputs = with ocamlPackages; [ atdgen js_of_ocaml-compiler @@ -17,20 +19,41 @@ ocamlPackages.buildDunePackage { ocaml_gettext ]; + patches = [ ./netstring.patch ]; + + buildInputs = + [ + # belenios-lib + # belenios-platform-native + belenios-platform-js + ] + ++ (with ocamlPackages; [ + # calendar + # csv + eliom + gettext-camomile + # lwt + # ocamlnet + ocsipersist + ocsipersist-lib + ocsipersist-sqlite-config + ocsigen_server + ocaml_gettext + xml-light + tyxml + markup + sendmail + ]); + propagatedBuildInputs = [ belenios-lib belenios-platform-native - belenios-platform-js ] ++ (with ocamlPackages; [ calendar - csv - eliom - gettext-camomile lwt - ocamlnet - ocsipersist-sqlite-config + xml-light ]); } diff --git a/pkgs/belenios/tool.nix b/pkgs/belenios/tool.nix index eecd060..2549ae5 100644 --- a/pkgs/belenios/tool.nix +++ b/pkgs/belenios/tool.nix @@ -1,8 +1,9 @@ { belenios, belenios-lib, - belenios-platform, + # belenios-platform, belenios-platform-native, + libsodium, ocamlPackages }: @@ -10,14 +11,21 @@ ocamlPackages.buildDunePackage { pname = "belenios-tool"; inherit (belenios) version src; - propagatedBuildInputs = + buildInputs = [ belenios-lib - belenios-platform + # belenios-platform belenios-platform-native + libsodium ] ++ (with ocamlPackages; [ cmdliner - cohttp-lwt-unix + cryptokit + hex ]); + + propagatedBuildInputs = with ocamlPackages; [ + lwt + cohttp-lwt-unix + ]; } diff --git a/pkgs/flake.lock b/pkgs/flake.lock new file mode 100644 index 0000000..2e80cc2 --- /dev/null +++ b/pkgs/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1774244481, + "narHash": "sha256-4XfMXU0DjN83o6HWZoKG9PegCvKvIhNUnRUI19vzTcQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4590696c8693fea477850fe379a01544293ca4e2", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-25.11", + "type": "indirect" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/flake.nix b/pkgs/flake.nix new file mode 100644 index 0000000..38637cd --- /dev/null +++ b/pkgs/flake.nix @@ -0,0 +1,27 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-25.11"; + }; + + outputs = inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" ]; + perSystem = { pkgs, ... }: rec { + devShells.default = pkgs.mkShell { + packages = []; + }; + packages = let + ocamlPackages = pkgs.ocaml-ng.ocamlPackages_5_2; + in rec { + belenios = pkgs.callPackage ./belenios { inherit ocamlPackages belenios-server belenios-tool; }; + belenios-lib = pkgs.callPackage ./belenios/lib.nix { inherit belenios ocamlPackages belenios-platform; }; + belenios-tool = pkgs.callPackage ./belenios/tool.nix { inherit belenios ocamlPackages belenios-lib belenios-platform-native; }; + belenios-server = pkgs.callPackage ./belenios/server.nix { inherit belenios ocamlPackages belenios-lib belenios-platform-native belenios-platform-js; }; + belenios-platform = pkgs.callPackage ./belenios/platform.nix { inherit belenios ocamlPackages; }; + belenios-platform-native = pkgs.callPackage ./belenios/platform-native.nix { inherit belenios ocamlPackages belenios-platform; }; + belenios-platform-js = pkgs.callPackage ./belenios/platform-js.nix { inherit belenios ocamlPackages belenios-platform; }; + }; + }; + }; +} +