diff options
author | Thiago Kenji Okada <thiagokokada@gmail.com> | 2023-02-18 13:05:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-18 13:05:06 +0000 |
commit | f47ea8fbf7e638167dc045d34e820b8516c1683e (patch) | |
tree | 2389a91c569c097c8e1256a7e0c38f4eb7475fa6 /pkgs | |
parent | f372255aaa3567e883215d51551bb6b6ccf4834c (diff) | |
parent | aea640a73bc8025b9e7b8e12fe3f29fd3b504cd1 (diff) |
Merge pull request #216855 from thiagokokada/build-graalvm-allow-override
buildGraalvmNativeImage: allow overriding attributes
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/build-graalvm-native-image/default.nix | 32 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 |
2 files changed, 24 insertions, 12 deletions
diff --git a/pkgs/build-support/build-graalvm-native-image/default.nix b/pkgs/build-support/build-graalvm-native-image/default.nix index 810ef52235e1c..3bf675b5d2083 100644 --- a/pkgs/build-support/build-graalvm-native-image/default.nix +++ b/pkgs/build-support/build-graalvm-native-image/default.nix @@ -1,7 +1,9 @@ -{ lib, stdenv, graalvm-ce, glibcLocales }: - -{ name ? "${args.pname}-${args.version}" - # Final executable name +{ lib +, stdenv +, glibcLocales + # The GraalVM derivation to use +, graalvmDrv +, name ? "${args.pname}-${args.version}" , executable ? args.pname # JAR used as input for GraalVM derivation, defaults to src , jar ? args.src @@ -9,7 +11,6 @@ # Default native-image arguments. You probably don't want to set this, # except in special cases. In most cases, use extraNativeBuildArgs instead , nativeImageBuildArgs ? [ - "-jar" jar (lib.optionalString stdenv.isDarwin "-H:-CheckToolchain") "-H:Name=${executable}" "--verbose" @@ -18,16 +19,25 @@ , extraNativeImageBuildArgs ? [ ] # XMX size of GraalVM during build , graalvmXmx ? "-J-Xmx6g" - # The GraalVM derivation to use -, graalvmDrv ? graalvm-ce # Locale to be used by GraalVM compiler , LC_ALL ? "en_US.UTF-8" , meta ? { } , ... } @ args: -stdenv.mkDerivation (args // { - inherit dontUnpack LC_ALL; +let + extraArgs = builtins.removeAttrs args [ + "lib" + "stdenv" + "glibcLocales" + "jar" + "dontUnpack" + "LC_ALL" + "meta" + ]; +in +stdenv.mkDerivation ({ + inherit dontUnpack LC_ALL jar; nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ graalvmDrv glibcLocales ]; @@ -36,7 +46,7 @@ stdenv.mkDerivation (args // { buildPhase = args.buildPhase or '' runHook preBuild - native-image ''${nativeImageBuildArgs[@]} + native-image -jar "$jar" ''${nativeImageBuildArgs[@]} runHook postBuild ''; @@ -61,4 +71,4 @@ stdenv.mkDerivation (args // { # need to have native-image-installable-svm available broken = !(builtins.any (p: (p.product or "") == "native-image-installable-svm") graalvmDrv.products); } // meta; -}) +} // extraArgs) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6cb79d651bdea..1f46e94edd407 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15058,7 +15058,9 @@ with pkgs; graalvm-ce = graalvm11-ce; graalvm11-ce = graalvmCEPackages.graalvm11-ce; graalvm17-ce = graalvmCEPackages.graalvm17-ce; - buildGraalvmNativeImage = callPackage ../build-support/build-graalvm-native-image { }; + buildGraalvmNativeImage = (callPackage ../build-support/build-graalvm-native-image { + graalvmDrv = graalvm-ce; + }).override; openshot-qt = libsForQt5.callPackage ../applications/video/openshot-qt { }; |