appimage: replace radare2+jq with readelf+awk+sha256sum

radare2 does not play nicely with filenames containing spaces
https://github.com/radareorg/radare2/issues/16958
This commit is contained in:
Pavol Rusnak
2020-05-29 11:14:16 +02:00
parent d190eca583
commit 9444756222
2 changed files with 86 additions and 73 deletions
+37 -20
View File
@@ -1,40 +1,57 @@
{ stdenv, buildFHSUserEnv, writeScript, pkgs
, bash, radare2, jq, squashfsTools, ripgrep
, coreutils, libarchive, file, runtimeShell, pv
, lib, runCommand }:
{ stdenv
, bash
, binutils-unwrapped
, coreutils
, gawk
, libarchive
, pv
, squashfsTools
, buildFHSUserEnv
, pkgs
}:
rec {
appimage-exec = pkgs.substituteAll {
src = ./appimage-exec.sh;
isExecutable = true;
dir = "bin";
path = with pkgs; lib.makeBinPath [ pv ripgrep file radare2 libarchive jq squashfsTools coreutils bash ];
path = with pkgs; stdenv.lib.makeBinPath [
bash
binutils-unwrapped
coreutils
gawk
libarchive
pv
squashfsTools
];
};
extract = { name, src }: runCommand "${name}-extracted" {
buildInputs = [ appimage-exec ];
} ''
appimage-exec.sh -x $out ${src}
'';
extract = { name, src }: pkgs.runCommand "${name}-extracted" {
buildInputs = [ appimage-exec ];
} ''
appimage-exec.sh -x $out ${src}
'';
# for compatibility, deprecated
extractType1 = extract;
extractType2 = extract;
wrapType1 = wrapType2;
wrapAppImage = args@{ name, src, extraPkgs, ... }: buildFHSUserEnv (defaultFhsEnvArgs // {
inherit name;
wrapAppImage = args@{ name, src, extraPkgs, ... }: buildFHSUserEnv
(defaultFhsEnvArgs // {
inherit name;
targetPkgs = pkgs: [ appimage-exec ]
++ defaultFhsEnvArgs.targetPkgs pkgs ++ extraPkgs pkgs;
targetPkgs = pkgs: [ appimage-exec ]
++ defaultFhsEnvArgs.targetPkgs pkgs ++ extraPkgs pkgs;
runScript = "appimage-exec.sh -w ${src}";
} // (removeAttrs args (builtins.attrNames (builtins.functionArgs wrapAppImage))));
runScript = "appimage-exec.sh -w ${src}";
} // (removeAttrs args (builtins.attrNames (builtins.functionArgs wrapAppImage))));
wrapType2 = args@{ name, src, extraPkgs ? pkgs: [], ... }: wrapAppImage (args // {
inherit name extraPkgs;
src = extract { inherit name src; };
});
wrapType2 = args@{ name, src, extraPkgs ? pkgs: [ ], ... }: wrapAppImage
(args // {
inherit name extraPkgs;
src = extract { inherit name src; };
});
defaultFhsEnvArgs = {
name = "appimage-env";