summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorTill Höppner <tilpner@users.noreply.github.com>2018-09-19 18:42:13 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-09-19 18:42:12 +0200
commit5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967 (patch)
tree70a059dbff4d09bbf36c8049d02228b686eb30b9 /pkgs
parent3410dcd90e0d1ddcf3e3ec483bab7c0cbfc152c9 (diff)
downloadnixpkgs-5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967.tar
nixpkgs-5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967.tar.gz
nixpkgs-5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967.tar.bz2
nixpkgs-5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967.tar.lz
nixpkgs-5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967.tar.xz
nixpkgs-5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967.tar.zst
nixpkgs-5fb0ed64d0dfcb68d1e60e8a220f68ecc22c3967.zip
appimage-run: Support type-1 Appimages (#45973)
This attempts to detect older appimages and extract them
in the same manner as new ones, without changing filesystem paths
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/package-management/appimage-run/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/tools/package-management/appimage-run/default.nix b/pkgs/tools/package-management/appimage-run/default.nix
index a7fb8da9966..8e236aa426f 100644
--- a/pkgs/tools/package-management/appimage-run/default.nix
+++ b/pkgs/tools/package-management/appimage-run/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, writeScript, buildFHSUserEnv, coreutils
+{ stdenv, writeScript, buildFHSUserEnv, coreutils, file, libarchive
 , extraPkgs ? pkgs: [] }:
 
 buildFHSUserEnv {
@@ -131,7 +131,14 @@ buildFHSUserEnv {
     export APPDIR="$SQUASHFS_ROOT/squashfs-root"
     if [ ! -x "$APPDIR" ]; then
       cd "$SQUASHFS_ROOT"
-      "$APPIMAGE" --appimage-extract 2>/dev/null
+
+      if ${file}/bin/file --mime-type --brief --keep-going "$APPIMAGE" | grep -q iso; then
+        # is type-1 appimage
+        ${libarchive}/bin/bsdtar -x -C "$SQUASHFS_ROOT" -f "$APPIMAGE"
+      else
+        # is type-2 appimage
+        "$APPIMAGE" --appimage-extract 2>/dev/null
+      fi
     fi
 
     cd "$APPDIR"