Skip to content

Commit

Permalink
Merge pull request #162385 from ulrikstrid/ulrikstrid/ocamlpackages-s…
Browse files Browse the repository at this point in the history
…trict-deps-v2

ocamlPackages treewide: strictDeps all packages
  • Loading branch information
wegank authored Feb 3, 2023
2 parents f97172b + f12b9ea commit 1e17068
Show file tree
Hide file tree
Showing 313 changed files with 856 additions and 602 deletions.
17 changes: 16 additions & 1 deletion nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,22 @@
<literal>doInstallCheck</literal> is set. (Note that this
change will not cause breakage to derivations with
<literal>strictDeps</literal> unset, which are most packages
except python, rust and go packages).
except python, rust, ocaml and go packages).
</para>
</listitem>
<listitem>
<para>
<literal>buildDunePackage</literal> now defaults to
<literal>strictDeps = true</literal> which means that any
library should go into <literal>buildInputs</literal> or
<literal>checkInputs</literal>. Any executable that is run on
the building machine should go into
<literal>nativeBuildInputs</literal> or
<literal>nativeCheckInputs</literal> respectively. Example of
executables are <literal>ocaml</literal>,
<literal>findlib</literal> and <literal>menhir</literal>. PPXs
are libraries which are built by dune and should therefore not
go into <literal>nativeBuildInputs</literal>.
</para>
</listitem>
<listitem>
Expand Down
4 changes: 3 additions & 1 deletion nixos/doc/manual/release-notes/rl-2305.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ In addition to numerous new and upgraded packages, this release has the followin

- `carnix` and `cratesIO` has been removed due to being unmaintained, use alternatives such as [naersk](https://github.com/nix-community/naersk) and [crate2nix](https://github.com/kolloch/crate2nix) instead.

- `checkInputs` have been renamed to `nativeCheckInputs`, because they behave the same as `nativeBuildInputs` when `doCheck` is set. `checkInputs` now denote a new type of dependencies, added to `buildInputs` when `doCheck` is set. As a rule of thumb, `nativeCheckInputs` are tools on `$PATH` used during the tests, and `checkInputs` are libraries which are linked to executables built as part of the tests. Similarly, `installCheckInputs` are renamed to `nativeInstallCheckInputs`, corresponding to `nativeBuildInputs`, and `installCheckInputs` are a new type of dependencies added to `buildInputs` when `doInstallCheck` is set. (Note that this change will not cause breakage to derivations with `strictDeps` unset, which are most packages except python, rust and go packages).
- `checkInputs` have been renamed to `nativeCheckInputs`, because they behave the same as `nativeBuildInputs` when `doCheck` is set. `checkInputs` now denote a new type of dependencies, added to `buildInputs` when `doCheck` is set. As a rule of thumb, `nativeCheckInputs` are tools on `$PATH` used during the tests, and `checkInputs` are libraries which are linked to executables built as part of the tests. Similarly, `installCheckInputs` are renamed to `nativeInstallCheckInputs`, corresponding to `nativeBuildInputs`, and `installCheckInputs` are a new type of dependencies added to `buildInputs` when `doInstallCheck` is set. (Note that this change will not cause breakage to derivations with `strictDeps` unset, which are most packages except python, rust, ocaml and go packages).

- `buildDunePackage` now defaults to `strictDeps = true` which means that any library should go into `buildInputs` or `checkInputs`. Any executable that is run on the building machine should go into `nativeBuildInputs` or `nativeCheckInputs` respectively. Example of executables are `ocaml`, `findlib` and `menhir`. PPXs are libraries which are built by dune and should therefore not go into `nativeBuildInputs`.

- `borgbackup` module now has an option for inhibiting system sleep while backups are running, defaulting to off (not inhibiting sleep), available as [`services.borgbackup.jobs.<name>.inhibitsSleep`](#opt-services.borgbackup.jobs._name_.inhibitsSleep).

Expand Down
6 changes: 4 additions & 2 deletions pkgs/applications/misc/llpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ stdenv.mkDerivation rec {
src = ./fix-build-bash.patch;
});

nativeBuildInputs = [ makeWrapper ];
buildInputs = [ ocaml mupdf libX11 libGLU libGL freetype zlib gumbo jbig2dec openjpeg libjpeg lcms2 harfbuzz ];
strictDeps = true;

nativeBuildInputs = [ makeWrapper ocaml ];
buildInputs = [ mupdf libX11 libGLU libGL freetype zlib gumbo jbig2dec openjpeg libjpeg lcms2 harfbuzz ];

dontStrip = true;

Expand Down
3 changes: 2 additions & 1 deletion pkgs/applications/misc/orpie/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ ocamlPackages.buildDunePackage rec {
substituteInPlace src/orpie/install.ml.in --replace '@prefix@' $out
'';

buildInputs = with ocamlPackages; [ curses camlp5 num gsl ];
nativeBuildInputs = [ ocamlPackages.camlp5 ];
buildInputs = with ocamlPackages; [ curses num gsl ];

meta = {
inherit (src.meta) homepage;
Expand Down
3 changes: 2 additions & 1 deletion pkgs/applications/misc/stog/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ buildDunePackage rec {
sha256 = "sha256:0krj5w4y05bcfx7hk9blmap8avl31gp7yi01lpqzs6ync23mvm0x";
};

buildInputs = [ fmt lwt_ppx menhir ocf_ppx ppx_blob xtmpl_ppx ];
nativeBuildInputs = [ menhir ];
buildInputs = [ fmt lwt_ppx ocf_ppx ppx_blob xtmpl_ppx ];
propagatedBuildInputs = [
dune-build-info
dune-site
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildDunePackage rec {
};

doCheck = true;
nativeCheckInputs = [ ounit2 ];
checkInputs = [ ounit2 ];

buildInputs = [ extlib ocamlfuse gapi-ocaml ocaml_sqlite3 tiny_httpd ];

Expand Down
10 changes: 3 additions & 7 deletions pkgs/applications/networking/p2p/mldonkey/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ stdenv.mkDerivation rec {
'${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4'
'';

buildInputs = (with ocamlPackages; [
ocaml
camlp4
num
]) ++ [
zlib
];
strictDeps = true;
nativeBuildInputs = with ocamlPackages; [ ocaml camlp4];
buildInputs = (with ocamlPackages; [ num ]) ++ [ zlib ];

meta = {
broken = stdenv.isDarwin;
Expand Down
6 changes: 4 additions & 2 deletions pkgs/applications/networking/sync/unison/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-taA8eZ/wOe9uMccXVYfe34/XzWgqYKA3tLZnIOahOrQ=";
};

nativeBuildInputs = [ makeWrapper ]
strictDeps = true;

nativeBuildInputs = [ makeWrapper ocamlPackages.ocaml ]
++ lib.optional enableX11 copyDesktopItems;
buildInputs = [ ocamlPackages.ocaml ncurses ];
buildInputs = [ ncurses ];

preBuild = lib.optionalString enableX11 ''
sed -i "s|\(OCAMLOPT=.*\)$|\1 -I $(echo "${ocamlPackages.lablgtk}"/lib/ocaml/*/site-lib/lablgtk2)|" src/Makefile.OCaml
Expand Down
4 changes: 3 additions & 1 deletion pkgs/applications/science/logic/abella/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
sha256 = "sha256-/eOiebMFHgrurtrSHPlgZO3xmmxBOUmyAzswXZLd3Yc=";
};

buildInputs = [ rsync ] ++ (with ocamlPackages; [ ocaml ocamlbuild findlib ]);
strictDeps = true;

nativeBuildInputs = [ rsync ] ++ (with ocamlPackages; [ ocaml ocamlbuild findlib ]);

installPhase = ''
mkdir -p $out/bin
Expand Down
16 changes: 12 additions & 4 deletions pkgs/applications/science/logic/acgtk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ stdenv.mkDerivation {
sha256 = "sha256-W/BDhbng5iYuiB7desMKvRtDFdhoaxiJNvNvtbLlA6E=";
};

buildInputs = [ dune_2 ] ++ (with ocamlPackages; [
ocaml findlib ansiterminal cairo2 cmdliner fmt logs menhir menhirLib mtime sedlex yojson
]);
strictDeps = true;

buildPhase = "dune build --profile=release";
nativeBuildInputs = with ocamlPackages; [ menhir ocaml findlib dune_2 ];

buildInputs = with ocamlPackages; [
ansiterminal cairo2 cmdliner fmt logs menhirLib mtime sedlex yojson
];

buildPhase = ''
runHook preBuild
dune build --profile=release ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
runHook postBuild
'';

installPhase = ''
dune install --prefix $out --libdir $OCAMLFIND_DESTDIR
Expand Down
4 changes: 3 additions & 1 deletion pkgs/applications/science/logic/cryptoverif/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
sha256 = "sha256-F5eVN5ATYo9Ivpi2eYh96ktuTWUeoqgWMR4BqHu8EFs=";
};

buildInputs = [ ocaml ];
strictDeps = true;

nativeBuildInputs = [ ocaml ];

/* Fix up the frontend to load the 'default' cryptoverif library
** from under $out/libexec. By default, it expects to find the files
Expand Down
6 changes: 2 additions & 4 deletions pkgs/applications/science/logic/ekrhyper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "sha256-fEe0DIMGj7wO+79/BZf45kykgyTXpbZJsyFSt31XqpM=";
};

buildInputs = [
ocaml
perl
];
strictDeps = true;
nativeBuildInputs = [ ocaml perl ];
setSourceRoot = "export sourceRoot=$(echo */ekrh/src/)";
preInstall = "export INSTALLDIR=$out";
postInstall = ''for i in "$out/casc"/*; do ln -s "$i" "$out/bin/ekrh-casc-$(basename $i)"; done '';
Expand Down
4 changes: 3 additions & 1 deletion pkgs/applications/science/logic/hol_light/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ stdenv.mkDerivation {
})
];

buildInputs = [ ocaml camlp5 ];
strictDeps = true;

nativeBuildInputs = [ ocaml camlp5 ];
propagatedBuildInputs = [ num ];

installPhase = ''
Expand Down
5 changes: 4 additions & 1 deletion pkgs/applications/science/logic/iprover/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "0lik8p7ayhjwpkln1iwf0ri84ramhch74j5nj6z7ph6wfi92pgg8";
};

buildInputs = [ ocaml eprover zlib ];
strictDeps = true;

nativeBuildInputs = [ ocaml eprover ];
buildInputs = [ zlib ];

preConfigure = "patchShebangs .";

Expand Down
6 changes: 4 additions & 2 deletions pkgs/applications/science/logic/leo2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256:1b2q7vsz6s9ighypsigqjm1mzjiq3xgnz5id5ssb4rh9zm190r82";
};

nativeBuildInputs = [ makeWrapper ];
buildInputs = [ eprover ocaml camlp4 perl zlib ];
strictDeps = true;

nativeBuildInputs = [ makeWrapper eprover ocaml camlp4 perl ];
buildInputs = [ zlib ];

patches = [ (fetchpatch {
url = "https://github.com/niklasso/minisat/commit/7eb6015313561a2586032574788fcb133eeaa19f.patch";
Expand Down
7 changes: 5 additions & 2 deletions pkgs/applications/science/logic/ott/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ stdenv.mkDerivation rec {
hash = "sha256-GzeEiok5kigcmfqf/K/UxvlKkl55zy0vOyiRZ2HyMiE=";
};

nativeBuildInputs = [ pkg-config opaline ];
buildInputs = with ocamlPackages; [ ocaml findlib ocamlgraph ];

strictDeps = true;

nativeBuildInputs = [ pkg-config opaline ] ++ (with ocamlPackages; [ findlib ocaml ]);
buildInputs = with ocamlPackages; [ ocamlgraph ];

installTargets = "ott.install";

Expand Down
7 changes: 4 additions & 3 deletions pkgs/applications/science/logic/prooftree/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "0z1z4wqbqwgppkh2bm89fgy07a0y2m6g4lvcyzs09sm1ysklk2dh";
};

nativeBuildInputs = [ pkg-config ];
buildInputs = [ ncurses ] ++ (with ocamlPackages; [
ocaml findlib camlp5 lablgtk ]);
strictDeps = true;

nativeBuildInputs = [ pkg-config ] ++ (with ocamlPackages; [ ocaml findlib camlp5 ]);
buildInputs = [ ncurses ] ++ (with ocamlPackages; [ lablgtk ]);

dontAddPrefix = true;
configureFlags = [ "--prefix" "$(out)" ];
Expand Down
4 changes: 3 additions & 1 deletion pkgs/applications/science/logic/proverif/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
sha256 = "sha256:0xgwnp59779xc40sb7ck8rmfn620pilxyq79l3bymj9m7z0mwvm9";
};

buildInputs = with ocamlPackages; [ ocaml findlib ];
strictDeps = true;

nativeBuildInputs = with ocamlPackages; [ ocaml findlib ];

buildPhase = "./build -nointeract";
installPhase = ''
Expand Down
7 changes: 5 additions & 2 deletions pkgs/applications/science/logic/satallax/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ stdenv.mkDerivation rec {
pname = "satallax";
version = "2.7";

nativeBuildInputs = [ makeWrapper ];
buildInputs = [ ocaml zlib which eprover coq ];
strictDeps = true;

nativeBuildInputs = [ makeWrapper ocaml which eprover coq ];
buildInputs = [ zlib ];

src = fetchurl {
url = "https://www.ps.uni-saarland.de/~cebrown/satallax/downloads/${pname}-${version}.tar.gz";
sha256 = "1kvxn8mc35igk4vigi5cp7w3wpxk2z3bgwllfm4n3h2jfs0vkpib";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/applications/science/logic/statverif/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ stdenv.mkDerivation rec {
sha256 = "113jjhi1qkcggbsmbw8fa9ln8vs7vy2r288szks7rn0jjn0wxmbw";
};

buildInputs = [ ocaml ];
strictDeps = true;

nativeBuildInputs = [ ocaml ];

patchPhase = "patch -p1 < ${pf-patch}";
buildPhase = "./build";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/applications/science/logic/tlaplus/tlaps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ stdenv.mkDerivation rec {
sha256 = "c296998acd14d5b93a8d5be7ee178007ef179957465966576bda26944b1b7fca";
};

buildInputs = [ ocaml isabelle cvc3 perl wget which ];
strictDeps = true;

nativeBuildInputs = [ ocaml isabelle cvc3 perl wget which ];

installPhase = ''
mkdir -pv "$out"
Expand Down
10 changes: 9 additions & 1 deletion pkgs/applications/science/logic/why3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ stdenv.mkDerivation rec {
sha256 = "sha256-vNR7WeiSvg+763GcovoZBFDfncekJMeqNegP4fVw06I=";
};

strictDeps = true;

nativeBuildInputs = with ocamlPackages; [
ocaml findlib menhir
# Coq Support
coqPackages.coq
];

buildInputs = with ocamlPackages; [
ocaml findlib ocamlgraph zarith menhir
ocamlgraph zarith
# Emacs compilation of why3.el
emacs
# Documentation
Expand Down
11 changes: 7 additions & 4 deletions pkgs/applications/science/logic/z3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ let common = { version, sha256, patches ? [ ] }:
sha256 = sha256;
};

nativeBuildInputs = optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ python ]
strictDeps = true;

nativeBuildInputs = [ python ]
++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
++ optional javaBindings jdk
++ optionals ocamlBindings [ ocaml findlib zarith ]
++ optionals ocamlBindings [ ocaml findlib ]
;
propagatedBuildInputs = [ python.pkgs.setuptools ];
propagatedBuildInputs = [ python.pkgs.setuptools ]
++ optionals ocamlBindings [ zarith ];
enableParallelBuilding = true;

postPatch = optionalString ocamlBindings ''
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/version-management/monotone-viz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ stdenv.mkDerivation rec {
version = "1.0.2";
pname = "monotone-viz";

nativeBuildInputs = [ pkg-config makeWrapper ];
buildInputs = [ocaml lablgtk libgnomecanvas glib graphviz_2_0 camlp4];
nativeBuildInputs = [ pkg-config makeWrapper ocaml camlp4 ];
buildInputs = [ lablgtk libgnomecanvas glib graphviz_2_0 ];
src = fetchurl {
url = "http://oandrieu.nerim.net/monotone-viz/${pname}-${version}-nolablgtk.tar.gz";
sha256 = "1l5x4xqz5g1aaqbc1x80mg0yzkiah9ma9k9mivmn08alkjlakkdk";
Expand Down
8 changes: 5 additions & 3 deletions pkgs/applications/virtualization/virt-top/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ stdenv.mkDerivation rec {
hash = "sha256-IKIkqzx7YWki0L6D5WbwQiVWJfDFGdI2nsGgg212CcE=";
};

strictDeps = true;

nativeBuildInputs = [
autoreconfHook
pkg-config
getopt
ocamlPackages.ocaml
ocamlPackages.findlib
];

buildInputs = with ocamlPackages; [
ocamlPackages.ocaml
calendar
curses
findlib
gettext-stub
ocaml
ocaml_libvirt
] ++ [ libxml2 ];

Expand Down
4 changes: 3 additions & 1 deletion pkgs/build-support/ocaml/dune.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ stdenv.mkDerivation ({
runHook postInstall
'';

} // (builtins.removeAttrs args [ "minimalOCamlVersion" "duneVersion" ]) // {
strictDeps = true;

} // (builtins.removeAttrs args [ "minimalOCamlVersion" "duneVersion" ]) // {

name = "ocaml${ocaml.version}-${pname}-${version}";

Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/mezzo/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ stdenv.mkDerivation {
sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
};

buildInputs = [ ocaml findlib ocamlbuild yojson menhir menhirLib ulex pprint fix functory ];
strictDeps = true;

nativeBuildInputs = [ ocaml findlib ocamlbuild ];
buildInputs = [ yojson menhir menhirLib ulex pprint fix functory ];

# Sets warning 3 as non-fatal
prePatch = lib.optionalString (check-ocaml-version "4.02") ''
Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/obliv-c/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{ lib, stdenv, libgcrypt, fetchFromGitHub, ocamlPackages, perl }:
stdenv.mkDerivation rec {
pname = "obliv-c";

version = "0.0pre20210621";
buildInputs = [ perl ]

strictDeps = true;
nativeBuildInputs = [ perl ]
++ (with ocamlPackages; [ ocaml findlib ocamlbuild ]);
propagatedBuildInputs = [ libgcrypt ];
src = fetchFromGitHub {
Expand Down
Loading

0 comments on commit 1e17068

Please sign in to comment.