diff --git a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix index 858e49f2372a..7d62411f5740 100644 --- a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix +++ b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix @@ -14,7 +14,6 @@ , runCommandCC , setJavaClassPath , unzip -, writeShellScriptBin , xorg , zlib # extra params @@ -43,7 +42,6 @@ let "runCommandCC" "setJavaClassPath" "unzip" - "writeShellScriptBin" "xorg" "zlib" "extraCLibs" @@ -61,21 +59,25 @@ let ); # GraalVM 21.3.0+ expects musl-gcc as -musl-gcc - musl-gcc = (writeShellScriptBin "${stdenv.hostPlatform.system}-musl-gcc" ''${lib.getDev musl}/bin/musl-gcc "$@"''); + musl-gcc = (runCommandCC "musl-gcc" { } '' + mkdir -p $out/bin + ln -s ${lib.getDev musl}/bin/musl-gcc $out/bin/${stdenv.hostPlatform.system}-musl-gcc + ''); # GraalVM 23.0.0+ (i.e.: JDK 21.0.0+) clean-up the environment inside darwin # So we need to re-added some env vars to make everything work correctly again - darwin-cc = (runCommandCC "darwin-cc" { - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ darwin.apple_sdk.frameworks.Foundation zlib ]; - } '' + darwin-cc = (runCommandCC "darwin-cc" + { + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ darwin.apple_sdk.frameworks.Foundation zlib ]; + } '' makeWrapper ${stdenv.cc}/bin/cc $out/bin/cc \ --prefix NIX_CFLAGS_COMPILE_${stdenv.cc.suffixSalt} : "$NIX_CFLAGS_COMPILE" \ --prefix NIX_LDFLAGS_${stdenv.cc.suffixSalt} : "$NIX_LDFLAGS" ''); binPath = lib.makeBinPath ( lib.optionals stdenv.isDarwin [ darwin-cc ] - ++ [ stdenv.cc ] ++ lib.optionals useMusl [ musl-gcc ] + ++ [ stdenv.cc ] ); runtimeLibraryPath = lib.makeLibraryPath diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index 4c3c16415481..a29a81783c9c 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -11,6 +11,8 @@ graalvm-ce = callPackage ./graalvm-ce { }; + graalvm-ce-musl = callPackage ./graalvm-ce { useMusl = true; }; + graaljs = callPackage ./graaljs { }; graalnodejs = callPackage ./graalnodejs { }; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/default.nix b/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/default.nix index a514fe80624a..b7f7db61097f 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/default.nix @@ -1,9 +1,11 @@ { stdenv , fetchurl , graalvmCEPackages +, useMusl ? false }: graalvmCEPackages.buildGraalvm { + inherit useMusl; src = fetchurl (import ./hashes.nix).hashes.${stdenv.system}; version = (import ./hashes.nix).version; meta.platforms = builtins.attrNames (import ./hashes.nix).hashes;