Skip to content

Commit

Permalink
Improve nix flake (ocaml#1632)
Browse files Browse the repository at this point in the history
* Fix nix tests
* Fix scopes 
* Fix merlin tests

---------

Co-authored-by: Antonio Nuno Monteiro <[email protected]>
  • Loading branch information
3Rafal and anmonteiro authored Jun 27, 2023
1 parent 95f2005 commit 4ba69de
Showing 1 changed file with 47 additions and 8 deletions.
55 changes: 47 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,60 @@
rec {
packages = rec {
default = merlin;
merlin = buildDunePackage {
pname = "merlin";
version = "n/a";
merlin-lib = buildDunePackage {
pname = "merlin-lib";
version = "dev";
src = ./.;
duneVersion = "3";
buildInputs = with pkgs.ocamlPackages; [ menhirSdk menhir ];
propagatedBuildInputs = with pkgs.ocamlPackages; [
findlib
csexp
yojson
menhirLib
];
checkInputs = with pkgs.ocamlPackages; [ ppxlib pkgs.jq ];
doCheck = true;
};
dot-merlin-reader = buildDunePackage {
pname = "dot-merlin-reader";
version = "dev";
src = ./.;
duneVersion = "3";
propagatedBuildInputs = [
pkgs.ocamlPackages.findlib
];
buildInputs = [
merlin-lib
];
doCheck = true;
};
merlin = buildDunePackage {
pname = "merlin";
version = "dev";
src = ./.;
duneVersion = "3";
buildInputs = [
merlin-lib
dot-merlin-reader
pkgs.ocamlPackages.menhirLib
pkgs.ocamlPackages.menhirSdk
pkgs.ocamlPackages.yojson
];
nativeBuildInputs = [
pkgs.ocamlPackages.menhir
pkgs.jq
];
nativeCheckInputs = [ dot-merlin-reader ];
checkInputs = with pkgs.ocamlPackages; [
ppxlib
];
doCheck = true;
checkPhase = ''
runHook preCheck
patchShebangs tests/merlin-wrapper
dune build @check @runtest
runHook postCheck
'';
meta = with pkgs; {
mainProgram = "ocamlmerlin";
};
};
};
devShells.default = pkgs.mkShell {
inputsFrom = pkgs.lib.attrValues packages;
Expand Down

0 comments on commit 4ba69de

Please sign in to comment.