graalvm-ce: make it a scope

This commit is contained in:
Thiago Kenji Okada 2024-03-26 14:56:08 +00:00
parent 2fea245936
commit e1a7ec5583
2 changed files with 21 additions and 22 deletions

View file

@ -51,13 +51,7 @@ let
"meta"
];
stdenv' =
if stdenv.isDarwin then
darwin.apple_sdk_11_0.stdenv
else
stdenv;
cLibs = lib.optionals stdenv'.isLinux (
cLibs = lib.optionals stdenv.isLinux (
[ glibc zlib.static ]
++ lib.optionals (!useMusl) [ glibc.static ]
++ lib.optionals useMusl [ musl ]
@ -67,14 +61,14 @@ let
# GraalVM 21.3.0+ expects musl-gcc as <system>-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
ln -s ${lib.getDev musl}/bin/musl-gcc $out/bin/${stdenv.hostPlatform.system}-musl-gcc
'');
binPath = lib.makeBinPath (lib.optionals useMusl [ musl-gcc ] ++ [ stdenv'.cc ]);
binPath = lib.makeBinPath (lib.optionals useMusl [ musl-gcc ] ++ [ stdenv.cc ]);
runtimeLibraryPath = lib.makeLibraryPath
([ cups ] ++ lib.optionals gtkSupport [ cairo glib gtk3 ]);
graalvm-ce = stdenv'.mkDerivation ({
graalvm-ce = stdenv.mkDerivation ({
pname = "graalvm-ce";
unpackPhase = ''

View file

@ -1,23 +1,28 @@
{ lib
, stdenv
, callPackage
, fetchurl
, pkgs
}:
lib.makeScope pkgs.newScope (self:
{
buildGraalvm = callPackage ./buildGraalvm.nix;
stdenv =
if pkgs.stdenv.isDarwin then
pkgs.darwin.apple_sdk_11_0.stdenv
else
pkgs.stdenv;
buildGraalvmProduct = callPackage ./buildGraalvmProduct.nix;
buildGraalvm = self.callPackage ./buildGraalvm.nix;
graalvm-ce = callPackage ./graalvm-ce { };
buildGraalvmProduct = self.callPackage ./buildGraalvmProduct.nix;
graalvm-ce-musl = callPackage ./graalvm-ce { useMusl = true; };
graalvm-ce = self.callPackage ./graalvm-ce { };
graaljs = callPackage ./graaljs { };
graalvm-ce-musl = self.callPackage ./graalvm-ce { useMusl = true; };
graalnodejs = callPackage ./graalnodejs { };
graaljs = self.callPackage ./graaljs { };
graalpy = callPackage ./graalpy { };
graalnodejs = self.callPackage ./graalnodejs { };
truffleruby = callPackage ./truffleruby { };
}
graalpy = self.callPackage ./graalpy { };
truffleruby = self.callPackage ./truffleruby { };
})