pkgsStatic.ocaml-ng: migrate static adapter to derivations themselves

This commit is contained in:
Guillaume Girol 2021-08-14 12:00:00 +00:00
parent 41e07ee477
commit a17fc03375
15 changed files with 28 additions and 20 deletions

View File

@ -12,6 +12,8 @@ else
stdenv.mkDerivation ({
inherit enableParallelBuilding;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
buildPhase = ''
runHook preBuild

View File

@ -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;

View File

@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
installTargets = "install-hacl-star-raw";
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
buildInputs = [
which

View File

@ -17,6 +17,8 @@ buildOcaml (args // {
buildInputs = [ ocaml_oasis js_build_tools opaline ] ++ buildInputs;
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
configurePhase = "./configure --prefix $out";

View File

@ -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";

View File

@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
configureScript = "./configure.sh";
dontAddPrefix = "true";
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
propagatedBuildInputs = [ camlzip extlib ];

View File

@ -51,6 +51,8 @@ stdenv.mkDerivation rec {
configureFlags = [ "--use-findlib" "--installbindir" "$(out)/bin" ];
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
buildFlags = [ "all" "opt" ];

View File

@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
createFindlibDestdir = true;
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
preConfigure = ''
configureFlagsArray=(

View File

@ -40,6 +40,8 @@ buildDunePackage rec {
configureFlags = [ "--root $(out)" "--prefix /" ];
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
postConfigure = ''
make -C src confs

View File

@ -31,6 +31,8 @@ stdenv.mkDerivation {
configureScript = "./configure.sh";
dontAddPrefix = "true";
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
propagatedBuildInputs = [ javalib ];

View File

@ -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";

View File

@ -24,6 +24,8 @@ stdenv.mkDerivation rec {
];
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
meta = with lib; {
homepage = "https://dune.build/";

View File

@ -19,6 +19,8 @@ stdenv.mkDerivation rec {
buildFlags = "release";
dontAddPrefix = true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];

View File

@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
patches = [ ./ldconf.patch ./install_topfind.patch ];
dontAddPrefix=true;
dontAddStaticConfigureFlags = true;
configurePlatforms = [];
configureFlags = [
"-bindir" "${placeholder "out"}/bin"

View File

@ -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 {
# Dont use new stdenv zlib because
# it doesnt like the --disable-shared flag