2020-03-05 23:57:36 +01:00
|
|
|
{ stdenv, buildFHSUserEnv, writeScript, pkgs
|
|
|
|
, bash, radare2, jq, squashfsTools, ripgrep
|
|
|
|
, coreutils, libarchive, file, runtimeShell, pv
|
|
|
|
, lib, runCommand }:
|
2019-01-27 14:02:50 +01:00
|
|
|
|
|
|
|
rec {
|
2020-03-05 23:57:36 +01:00
|
|
|
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 ];
|
2019-01-27 14:02:50 +01:00
|
|
|
};
|
|
|
|
|
2020-03-05 23:57:36 +01:00
|
|
|
extract = { name, src }: runCommand "${name}-extracted" {
|
|
|
|
buildInputs = [ appimage-exec ];
|
|
|
|
} ''
|
2020-03-08 20:34:23 +01:00
|
|
|
appimage-exec.sh -x $out ${src}
|
2020-03-05 23:57:36 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
# for compatibility, deprecated
|
2020-03-04 00:46:00 +01:00
|
|
|
extractType1 = extract;
|
|
|
|
extractType2 = extract;
|
2020-03-08 17:55:43 +01:00
|
|
|
wrapType1 = wrapType2;
|
2020-03-04 00:46:00 +01:00
|
|
|
|
2019-02-13 05:31:35 +01:00
|
|
|
wrapAppImage = args@{ name, src, extraPkgs, ... }: buildFHSUserEnv (defaultFhsEnvArgs // {
|
2019-01-27 14:02:50 +01:00
|
|
|
inherit name;
|
|
|
|
|
2020-03-05 23:57:36 +01:00
|
|
|
targetPkgs = pkgs: [ appimage-exec ]
|
|
|
|
++ defaultFhsEnvArgs.targetPkgs pkgs ++ extraPkgs pkgs;
|
2019-01-27 14:02:50 +01:00
|
|
|
|
2020-03-08 20:34:23 +01:00
|
|
|
runScript = "appimage-exec.sh -w ${src}";
|
2019-02-24 01:08:38 +01:00
|
|
|
} // (removeAttrs args (builtins.attrNames (builtins.functionArgs wrapAppImage))));
|
2019-01-27 14:02:50 +01:00
|
|
|
|
2019-02-13 05:31:35 +01:00
|
|
|
wrapType2 = args@{ name, src, extraPkgs ? pkgs: [], ... }: wrapAppImage (args // {
|
2019-04-28 16:41:31 +02:00
|
|
|
inherit name extraPkgs;
|
2020-03-08 17:55:43 +01:00
|
|
|
src = extract { inherit name src; };
|
2019-02-13 05:31:35 +01:00
|
|
|
});
|
2019-01-27 14:02:50 +01:00
|
|
|
|
|
|
|
defaultFhsEnvArgs = {
|
|
|
|
name = "appimage-env";
|
|
|
|
|
|
|
|
# Most of the packages were taken from the Steam chroot
|
|
|
|
targetPkgs = pkgs: with pkgs; [
|
|
|
|
gtk3
|
|
|
|
bashInteractive
|
|
|
|
gnome3.zenity
|
|
|
|
python2
|
|
|
|
xorg.xrandr
|
|
|
|
which
|
|
|
|
perl
|
|
|
|
xdg_utils
|
|
|
|
iana-etc
|
|
|
|
krb5
|
|
|
|
];
|
|
|
|
|
2019-03-09 22:03:26 +01:00
|
|
|
# list of libraries expected in an appimage environment:
|
|
|
|
# https://github.com/AppImage/pkg2appimage/blob/master/excludelist
|
2019-01-27 14:02:50 +01:00
|
|
|
multiPkgs = pkgs: with pkgs; [
|
|
|
|
desktop-file-utils
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXtst
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXfixes
|
|
|
|
libGL
|
|
|
|
|
|
|
|
gst_all_1.gstreamer
|
|
|
|
gst_all_1.gst-plugins-ugly
|
|
|
|
libdrm
|
|
|
|
xorg.xkeyboardconfig
|
|
|
|
xorg.libpciaccess
|
|
|
|
|
|
|
|
glib
|
|
|
|
gtk2
|
|
|
|
bzip2
|
|
|
|
zlib
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2019-01-27 14:02:50 +01:00
|
|
|
|
|
|
|
xorg.libXinerama
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
xorg.libXxf86vm
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libSM
|
|
|
|
xorg.libICE
|
|
|
|
gnome2.GConf
|
|
|
|
freetype
|
|
|
|
(curl.override { gnutlsSupport = true; sslSupport = false; })
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
fontconfig
|
|
|
|
cairo
|
|
|
|
pango
|
|
|
|
expat
|
|
|
|
dbus
|
|
|
|
cups
|
|
|
|
libcap
|
|
|
|
SDL2
|
|
|
|
libusb1
|
|
|
|
udev
|
|
|
|
dbus-glib
|
|
|
|
libav
|
|
|
|
atk
|
|
|
|
at-spi2-atk
|
|
|
|
libudev0-shim
|
|
|
|
networkmanager098
|
|
|
|
|
|
|
|
xorg.libXt
|
|
|
|
xorg.libXmu
|
|
|
|
xorg.libxcb
|
2019-04-21 20:10:31 +02:00
|
|
|
xorg.xcbutil
|
|
|
|
xorg.xcbutilwm
|
|
|
|
xorg.xcbutilimage
|
|
|
|
xorg.xcbutilkeysyms
|
|
|
|
xorg.xcbutilrenderutil
|
2019-01-27 14:02:50 +01:00
|
|
|
libGLU
|
|
|
|
libuuid
|
|
|
|
libogg
|
|
|
|
libvorbis
|
|
|
|
SDL
|
|
|
|
SDL2_image
|
|
|
|
glew110
|
|
|
|
openssl
|
|
|
|
libidn
|
|
|
|
tbb
|
|
|
|
wayland
|
2019-05-28 21:09:34 +02:00
|
|
|
mesa
|
2019-01-27 14:02:50 +01:00
|
|
|
libxkbcommon
|
|
|
|
|
|
|
|
flac
|
|
|
|
freeglut
|
|
|
|
libjpeg
|
|
|
|
libpng12
|
|
|
|
libsamplerate
|
|
|
|
libmikmod
|
|
|
|
libtheora
|
|
|
|
libtiff
|
|
|
|
pixman
|
|
|
|
speex
|
|
|
|
SDL_image
|
|
|
|
SDL_ttf
|
|
|
|
SDL_mixer
|
|
|
|
SDL2_ttf
|
|
|
|
SDL2_mixer
|
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
libappindicator-gtk2
|
|
|
|
libcaca
|
|
|
|
libcanberra
|
|
|
|
libgcrypt
|
|
|
|
libvpx
|
|
|
|
librsvg
|
|
|
|
xorg.libXft
|
|
|
|
libvdpau
|
|
|
|
alsaLib
|
2019-03-09 22:03:26 +01:00
|
|
|
|
|
|
|
harfbuzz
|
|
|
|
e2fsprogs
|
|
|
|
libgpgerror
|
|
|
|
keyutils.lib
|
|
|
|
libjack2
|
|
|
|
fribidi
|
2019-11-23 21:28:01 +01:00
|
|
|
p11-kit
|
2019-04-20 12:28:45 +02:00
|
|
|
|
|
|
|
# libraries not on the upstream include list, but nevertheless expected
|
|
|
|
# by at least one appimage
|
|
|
|
libtool.lib # for Synfigstudio
|
2019-09-16 02:33:15 +02:00
|
|
|
at-spi2-core
|
2019-01-27 14:02:50 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|