appimage: support pname+version for wrapType2

This commit is contained in:
Sandro Jäckel 2021-10-28 11:50:58 +02:00
parent 19b87ec97d
commit db44b28a06
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -1,5 +1,4 @@
{ lib
, bash
, binutils-unwrapped
, coreutils
@ -27,7 +26,7 @@ rec {
];
};
extract = { name, src }: pkgs.runCommand "${name}-extracted" {
extract = args@{ name ? "${args.pname}-${args.version}", src, ... }: pkgs.runCommand "${name}-extracted" {
buildInputs = [ appimage-exec ];
} ''
appimage-exec.sh -x $out ${src}
@ -38,7 +37,7 @@ rec {
extractType2 = extract;
wrapType1 = wrapType2;
wrapAppImage = args@{ name, src, extraPkgs, ... }: buildFHSUserEnv
wrapAppImage = args@{ name ? "${args.pname}-${args.version}", src, extraPkgs, ... }: buildFHSUserEnv
(defaultFhsEnvArgs // {
inherit name;
@ -46,9 +45,9 @@ rec {
++ defaultFhsEnvArgs.targetPkgs pkgs ++ extraPkgs pkgs;
runScript = "appimage-exec.sh -w ${src} --";
} // (removeAttrs args (builtins.attrNames (builtins.functionArgs wrapAppImage))));
} // (removeAttrs args ([ "pname" "version" ] ++ (builtins.attrNames (builtins.functionArgs wrapAppImage)))));
wrapType2 = args@{ name, src, extraPkgs ? pkgs: [ ], ... }: wrapAppImage
wrapType2 = args@{ name ? "${args.pname}-${args.version}", src, extraPkgs ? pkgs: [ ], ... }: wrapAppImage
(args // {
inherit name extraPkgs;
src = extract { inherit name src; };