mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
ocaml: partially fix pkgsStatic.ocaml-ng
This commit adds a static adapter for ocaml packages and applies it to pkgsStatic.ocaml-ng. The adapter fixes build of ocaml itself with version <= 4.7 and also attempts to fix builds of some packages.
This commit is contained in:
parent
9c9a0e9cab
commit
7263951cc8
1 changed files with 37 additions and 0 deletions
|
@ -51,7 +51,40 @@ self: super: let
|
|||
enableStaticLibraries = true;
|
||||
});
|
||||
};
|
||||
|
||||
removeUnknownConfigureFlags = f: with self.lib;
|
||||
remove "--disable-shared"
|
||||
(remove "--enable-static" f);
|
||||
|
||||
ocamlFixPackage = b:
|
||||
b.overrideAttrs (o: {
|
||||
configurePlatforms = [ ];
|
||||
configureFlags = removeUnknownConfigureFlags (o.configureFlags or [ ]);
|
||||
buildInputs = o.buildInputs ++ o.nativeBuildInputs or [ ];
|
||||
propagatedNativeBuildInputs = o.propagatedBuildInputs or [ ];
|
||||
});
|
||||
|
||||
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.override { useX11 = false; }).overrideAttrs (o: {
|
||||
configurePlatforms = [ ];
|
||||
dontUpdateAutotoolsGnuConfigScripts = true;
|
||||
})).overrideDerivation (o: {
|
||||
preConfigure = ''
|
||||
configureFlagsArray+=("-cc" "$CC" "-as" "$AS" "-partialld" "$LD -r")
|
||||
'';
|
||||
configureFlags = (removeUnknownConfigureFlags o.configureFlags) ++ [
|
||||
"--no-shared-libs"
|
||||
"-host ${o.stdenv.hostPlatform.config}"
|
||||
"-target ${o.stdenv.targetPlatform.config}"
|
||||
];
|
||||
});
|
||||
};
|
||||
|
||||
in {
|
||||
stdenv = foldl (flip id) super.stdenv staticAdapters;
|
||||
gcc49Stdenv = foldl (flip id) super.gcc49Stdenv staticAdapters;
|
||||
|
@ -199,6 +232,10 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
ocaml-ng = self.lib.mapAttrs (_: set:
|
||||
if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set
|
||||
) super.ocaml-ng;
|
||||
|
||||
python27 = super.python27.override { static = true; };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue