From eb02e003b067a1a5fe0ef0450745bb959c81ddb6 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 10 Dec 2023 12:19:26 +0100 Subject: [PATCH] buildFHSEnvBubblewrap/buildFHSEnv: permit pname+version instead of name --- .../build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix | 8 ++++++-- pkgs/build-support/build-fhsenv-bubblewrap/default.nix | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix index 2ab7847926e2..1e34ad1e5e44 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix @@ -8,14 +8,14 @@ , pkgsi686Linux }: -{ name ? null -, profile ? "" +{ profile ? "" , targetPkgs ? pkgs: [] , multiPkgs ? pkgs: [] , multiArch ? false # Whether to include 32bit packages , extraBuildCommands ? "" , extraBuildCommandsMulti ? "" , extraOutputsToInstall ? [] +, ... # for name, or pname+version } @ args: # HOWTO: @@ -36,6 +36,10 @@ let inherit (stdenv) is64bit; + name = if (args ? pname && args ? version) + then "${args.pname}-${args.version}" + else args.name; + # "use of glibc_multi is only supported on x86_64-linux" isMultiBuild = multiArch && stdenv.system == "x86_64-linux"; isTargetBuild = !isMultiBuild; diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix index 311212495f64..12f3e7d58552 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix @@ -47,10 +47,9 @@ let buildFHSEnv = callPackage ./buildFHSEnv.nix { }; - fhsenv = buildFHSEnv (removeAttrs (args // { inherit name; }) [ + fhsenv = buildFHSEnv (removeAttrs args [ "runScript" "extraInstallCommands" "meta" "passthru" "extraPreBwrapCmds" "extraBwrapArgs" "dieWithParent" "unshareUser" "unshareCgroup" "unshareUts" "unshareNet" "unsharePid" "unshareIpc" "privateTmp" - "pname" "version" ]); etcBindEntries = let