From a17fc0337522b002166730d94e32f3b1517e0817 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sat, 14 Aug 2021 12:00:00 +0000 Subject: [PATCH] pkgsStatic.ocaml-ng: migrate static adapter to derivations themselves --- pkgs/build-support/ocaml/dune.nix | 2 ++ .../ocaml-modules/bolt/default.nix | 2 ++ .../ocaml-modules/hacl-star/raw.nix | 2 ++ .../janestreet/buildOcamlJane.nix | 2 ++ .../janestreet/js-build-tools.nix | 2 ++ .../ocaml-modules/javalib/default.nix | 2 ++ .../ocaml-modules/labltk/default.nix | 2 ++ .../ocaml-modules/ocamlnet/default.nix | 2 ++ .../ocaml-modules/ocsigen-server/default.nix | 2 ++ .../ocaml-modules/sawja/default.nix | 2 ++ .../ocaml-modules/zarith/default.nix | 2 ++ pkgs/development/tools/ocaml/dune/1.nix | 2 ++ pkgs/development/tools/ocaml/dune/2.nix | 2 ++ .../tools/ocaml/findlib/default.nix | 2 ++ pkgs/top-level/static.nix | 20 ------------------- 15 files changed, 28 insertions(+), 20 deletions(-) diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index 6c136930d3f..6bdec501630 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -12,6 +12,8 @@ else stdenv.mkDerivation ({ inherit enableParallelBuilding; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; buildPhase = '' runHook preBuild diff --git a/pkgs/development/ocaml-modules/bolt/default.nix b/pkgs/development/ocaml-modules/bolt/default.nix index 54bc28697ec..ea32d659f64 100644 --- a/pkgs/development/ocaml-modules/bolt/default.nix +++ b/pkgs/development/ocaml-modules/bolt/default.nix @@ -42,6 +42,8 @@ EOF # The custom `configure` script does not expect the --prefix # option. Installation is handled by ocamlfind. dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; createFindlibDestdir = true; diff --git a/pkgs/development/ocaml-modules/hacl-star/raw.nix b/pkgs/development/ocaml-modules/hacl-star/raw.nix index cd1217b9710..aa787c9a91a 100644 --- a/pkgs/development/ocaml-modules/hacl-star/raw.nix +++ b/pkgs/development/ocaml-modules/hacl-star/raw.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { installTargets = "install-hacl-star-raw"; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; buildInputs = [ which diff --git a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix index fdb0d8034e6..62876e5eaf9 100644 --- a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix +++ b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix @@ -17,6 +17,8 @@ buildOcaml (args // { buildInputs = [ ocaml_oasis js_build_tools opaline ] ++ buildInputs; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; configurePhase = "./configure --prefix $out"; diff --git a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix index ff03c209190..2f68ee8230e 100644 --- a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix +++ b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix @@ -16,6 +16,8 @@ buildOcaml rec { buildInputs = [ ocaml_oasis opaline ]; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; configurePhase = "./configure --prefix $prefix"; installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install"; diff --git a/pkgs/development/ocaml-modules/javalib/default.nix b/pkgs/development/ocaml-modules/javalib/default.nix index d158e4216ab..15678f89da3 100644 --- a/pkgs/development/ocaml-modules/javalib/default.nix +++ b/pkgs/development/ocaml-modules/javalib/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { configureScript = "./configure.sh"; dontAddPrefix = "true"; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; propagatedBuildInputs = [ camlzip extlib ]; diff --git a/pkgs/development/ocaml-modules/labltk/default.nix b/pkgs/development/ocaml-modules/labltk/default.nix index 5a6daa54de3..3161b56239d 100644 --- a/pkgs/development/ocaml-modules/labltk/default.nix +++ b/pkgs/development/ocaml-modules/labltk/default.nix @@ -51,6 +51,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--use-findlib" "--installbindir" "$(out)/bin" ]; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; buildFlags = [ "all" "opt" ]; diff --git a/pkgs/development/ocaml-modules/ocamlnet/default.nix b/pkgs/development/ocaml-modules/ocamlnet/default.nix index bdbbf1d8c67..5c3ca95bb0d 100644 --- a/pkgs/development/ocaml-modules/ocamlnet/default.nix +++ b/pkgs/development/ocaml-modules/ocamlnet/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { createFindlibDestdir = true; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; preConfigure = '' configureFlagsArray=( diff --git a/pkgs/development/ocaml-modules/ocsigen-server/default.nix b/pkgs/development/ocaml-modules/ocsigen-server/default.nix index 25d45d9aed9..96a66874c75 100644 --- a/pkgs/development/ocaml-modules/ocsigen-server/default.nix +++ b/pkgs/development/ocaml-modules/ocsigen-server/default.nix @@ -40,6 +40,8 @@ buildDunePackage rec { configureFlags = [ "--root $(out)" "--prefix /" ]; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; postConfigure = '' make -C src confs diff --git a/pkgs/development/ocaml-modules/sawja/default.nix b/pkgs/development/ocaml-modules/sawja/default.nix index 68a8731201d..30ac2cfb22d 100644 --- a/pkgs/development/ocaml-modules/sawja/default.nix +++ b/pkgs/development/ocaml-modules/sawja/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation { configureScript = "./configure.sh"; dontAddPrefix = "true"; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; propagatedBuildInputs = [ javalib ]; diff --git a/pkgs/development/ocaml-modules/zarith/default.nix b/pkgs/development/ocaml-modules/zarith/default.nix index 12523b7bc7d..95351caee30 100644 --- a/pkgs/development/ocaml-modules/zarith/default.nix +++ b/pkgs/development/ocaml-modules/zarith/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { strictDeps = true; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ]; preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs"; diff --git a/pkgs/development/tools/ocaml/dune/1.nix b/pkgs/development/tools/ocaml/dune/1.nix index 79707a3c009..74deb9d2fa5 100644 --- a/pkgs/development/tools/ocaml/dune/1.nix +++ b/pkgs/development/tools/ocaml/dune/1.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { ]; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; meta = with lib; { homepage = "https://dune.build/"; diff --git a/pkgs/development/tools/ocaml/dune/2.nix b/pkgs/development/tools/ocaml/dune/2.nix index 4dadba4e62e..16f33268cf1 100644 --- a/pkgs/development/tools/ocaml/dune/2.nix +++ b/pkgs/development/tools/ocaml/dune/2.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { buildFlags = "release"; dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ]; diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index 4b02231b471..497a8ce91c1 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { patches = [ ./ldconf.patch ./install_topfind.patch ]; dontAddPrefix=true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; configureFlags = [ "-bindir" "${placeholder "out"}/bin" diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 2ca24175cfa..38f6a8fad42 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -47,21 +47,6 @@ self: super: let # ++ optional (super.stdenv.hostPlatform.libc == "glibc") ((flip overrideInStdenv) [ self.stdenv.glibc.static ]) ; - ocamlFixPackage = b: - b.overrideAttrs (o: { - configurePlatforms = [ ]; - dontAddStaticConfigureFlags = true; - }); - - ocamlStaticAdapter = _: super: - self.lib.mapAttrs - (_: p: if p ? overrideAttrs then ocamlFixPackage p else p) - super - // { - lablgtk = null; # Currently xlibs cause infinite recursion - ocaml = super.ocaml; - }; - in { stdenv = foldl (flip id) super.stdenv staticAdapters; @@ -78,11 +63,6 @@ in { gssSupport = false; }; - ocaml-ng = self.lib.mapAttrs (_: set: - if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set - ) super.ocaml-ng; - - zlib = super.zlib.override { # Don’t use new stdenv zlib because # it doesn’t like the --disable-shared flag