Merge pull request #143347 from SuperSandro2000/appimage-wrapType2-pname-version
This commit is contained in:
commit
31b495592f
|
@ -3,17 +3,16 @@
|
|||
let
|
||||
pname = "molotov";
|
||||
version = "4.4.0";
|
||||
name = "${pname}-${version}";
|
||||
src = fetchurl {
|
||||
url = "http://desktop-auto-upgrade.molotov.tv/linux/${version}/molotov.AppImage";
|
||||
sha256 = "sha256-l4Il6i8uXSeJqH3ITC8ZUpKXPQb0qcW7SpKx1R46XDc=";
|
||||
};
|
||||
appimageContents = appimageTools.extractType2 { inherit name src; };
|
||||
appimageContents = appimageTools.extractType2 { inherit pname version src; };
|
||||
in
|
||||
appimageTools.wrapType2 {
|
||||
inherit name src;
|
||||
inherit pname version src;
|
||||
extraInstallCommands = ''
|
||||
mv $out/bin/${name} $out/bin/${pname}
|
||||
mv $out/bin/${pname}-${version} $out/bin/${pname}
|
||||
install -m 444 -D \
|
||||
${appimageContents}/@molotovdesktop-wrapper.desktop \
|
||||
$out/share/applications/${pname}.desktop
|
||||
|
|
|
@ -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; };
|
||||
|
|
Loading…
Reference in a new issue