From e0f32f89449cbd52c8cf24050c10a5ff61f03510 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 31 Jul 2023 20:20:11 +0200 Subject: [PATCH] buildMavenPackage: inherit maven --- .../build-managers/apache-maven/build-package.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/build-managers/apache-maven/build-package.nix b/pkgs/development/tools/build-managers/apache-maven/build-package.nix index 5353572af13e..fd0457789ade 100644 --- a/pkgs/development/tools/build-managers/apache-maven/build-package.nix +++ b/pkgs/development/tools/build-managers/apache-maven/build-package.nix @@ -16,7 +16,7 @@ # originally extracted from dbeaver # created to allow using maven packages in the same style as rust -stdenv.mkDerivation (rec { +let fetchedMavenDeps = stdenv.mkDerivation ({ name = "${pname}-${version}-maven-deps"; inherit src patches; @@ -44,6 +44,13 @@ stdenv.mkDerivation (rec { outputHashMode = "recursive"; outputHash = mvnHash; } // mvnFetchExtraArgs); +in +stdenv.mkDerivation (builtins.removeAttrs args [ "mvnFetchExtraArgs" ] // { + inherit fetchedMavenDeps; + + nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ + maven + ]; buildPhase = '' runHook preBuild @@ -53,4 +60,8 @@ stdenv.mkDerivation (rec { runHook postBuild ''; -} // builtins.removeAttrs args [ "mvnFetchExtraArgs" ]) + + meta = args.meta or { } // { + platforms = args.meta.platforms or maven.meta.platforms; + }; +})