mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
buildGraalvm: fix build on x86_64-darwin (#370386)
This commit is contained in:
commit
f079a96bc6
3 changed files with 53 additions and 27 deletions
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
apple-sdk_11,
|
||||
darwinMinVersionHook,
|
||||
glibcLocales,
|
||||
# The GraalVM derivation to use
|
||||
graalvmDrv,
|
||||
|
@ -33,6 +35,8 @@ let
|
|||
extraArgs = builtins.removeAttrs args [
|
||||
"lib"
|
||||
"stdenv"
|
||||
"apple-sdk_11"
|
||||
"darwinMinVersionHook"
|
||||
"glibcLocales"
|
||||
"jar"
|
||||
"dontUnpack"
|
||||
|
@ -56,6 +60,11 @@ stdenv.mkDerivation (
|
|||
removeReferencesTo
|
||||
];
|
||||
|
||||
buildInputs = lib.optionals (stdenv.hostPlatform.isDarwin) [
|
||||
apple-sdk_11
|
||||
(darwinMinVersionHook "11.0")
|
||||
];
|
||||
|
||||
nativeImageBuildArgs = nativeImageBuildArgs ++ extraNativeImageBuildArgs ++ [ graalvmXmx ];
|
||||
|
||||
buildPhase =
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
lib,
|
||||
stdenv,
|
||||
alsa-lib,
|
||||
apple-sdk_11,
|
||||
autoPatchelfHook,
|
||||
cairo,
|
||||
cups,
|
||||
darwin,
|
||||
darwinMinVersionHook,
|
||||
fontconfig,
|
||||
glib,
|
||||
glibc,
|
||||
|
@ -30,10 +31,12 @@ let
|
|||
"lib"
|
||||
"stdenv"
|
||||
"alsa-lib"
|
||||
"apple-sdk_11"
|
||||
"autoPatchelfHook"
|
||||
"cairo"
|
||||
"cups"
|
||||
"darwin"
|
||||
"darwinMinVersionHook"
|
||||
"fontconfig"
|
||||
"glib"
|
||||
"glibc"
|
||||
|
@ -122,34 +125,51 @@ let
|
|||
propagatedBuildInputs = [
|
||||
setJavaClassPath
|
||||
zlib
|
||||
] ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk_11_0.frameworks.Foundation;
|
||||
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
||||
alsa-lib # libasound.so wanted by lib/libjsound.so
|
||||
fontconfig
|
||||
(lib.getLib stdenv.cc.cc) # libstdc++.so.6
|
||||
xorg.libX11
|
||||
xorg.libXext
|
||||
xorg.libXi
|
||||
xorg.libXrender
|
||||
xorg.libXtst
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
lib.optionals stdenv.hostPlatform.isLinux [
|
||||
alsa-lib # libasound.so wanted by lib/libjsound.so
|
||||
fontconfig
|
||||
(lib.getLib stdenv.cc.cc) # libstdc++.so.6
|
||||
xorg.libX11
|
||||
xorg.libXext
|
||||
xorg.libXi
|
||||
xorg.libXrender
|
||||
xorg.libXtst
|
||||
]
|
||||
++ (lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
apple-sdk_11
|
||||
(darwinMinVersionHook "11.0")
|
||||
]);
|
||||
|
||||
postInstall =
|
||||
let
|
||||
cLibsAsFlags = (map (l: "--add-flags '-H:CLibraryPath=${l}/lib'") cLibs);
|
||||
preservedNixVariables = [
|
||||
"-ELOCALE_ARCHIVE"
|
||||
"-ENIX_BINTOOLS"
|
||||
"-ENIX_BINTOOLS_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}"
|
||||
"-ENIX_BUILD_CORES"
|
||||
"-ENIX_BUILD_TOP"
|
||||
"-ENIX_CC"
|
||||
"-ENIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}"
|
||||
"-ENIX_CFLAGS_COMPILE"
|
||||
"-ENIX_HARDENING_ENABLE"
|
||||
"-ENIX_LDFLAGS"
|
||||
];
|
||||
preservedNixVariables =
|
||||
[
|
||||
"-ENIX_BINTOOLS"
|
||||
"-ENIX_BINTOOLS_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}"
|
||||
"-ENIX_BUILD_CORES"
|
||||
"-ENIX_BUILD_TOP"
|
||||
"-ENIX_CC"
|
||||
"-ENIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}"
|
||||
"-ENIX_CFLAGS_COMPILE"
|
||||
"-ENIX_HARDENING_ENABLE"
|
||||
"-ENIX_LDFLAGS"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
"-ELOCALE_ARCHIVE"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
"-EDEVELOPER_DIR"
|
||||
"-EDEVELOPER_DIR_FOR_BUILD"
|
||||
"-EDEVELOPER_DIR_FOR_TARGET"
|
||||
"-EMACOSX_DEPLOYMENT_TARGET"
|
||||
"-EMACOSX_DEPLOYMENT_TARGET_FOR_BUILD"
|
||||
"-EMACOSX_DEPLOYMENT_TARGET_FOR_TARGET"
|
||||
"-ENIX_APPLE_SDK_VERSION"
|
||||
];
|
||||
preservedNixVariablesAsFlags = (map (f: "--add-flags '${f}'") preservedNixVariables);
|
||||
in
|
||||
''
|
||||
|
|
|
@ -4,9 +4,6 @@
|
|||
}:
|
||||
|
||||
lib.makeScope pkgs.newScope (self: {
|
||||
stdenv =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then pkgs.darwin.apple_sdk_11_0.stdenv else pkgs.stdenv;
|
||||
|
||||
buildGraalvm = self.callPackage ./buildGraalvm.nix;
|
||||
|
||||
buildGraalvmProduct = self.callPackage ./buildGraalvmProduct.nix;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue