2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-06-02 18:00:15 +00:00
|
|
|
, bash
|
|
|
|
, binutils-unwrapped
|
|
|
|
, coreutils
|
|
|
|
, gawk
|
|
|
|
, libarchive
|
|
|
|
, pv
|
|
|
|
, squashfsTools
|
2023-04-29 16:46:19 +00:00
|
|
|
, buildFHSEnv
|
2020-06-02 18:00:15 +00:00
|
|
|
, pkgs
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rec {
|
|
|
|
appimage-exec = pkgs.substituteAll {
|
|
|
|
src = ./appimage-exec.sh;
|
|
|
|
isExecutable = true;
|
|
|
|
dir = "bin";
|
2021-02-05 17:12:51 +00:00
|
|
|
path = lib.makeBinPath [
|
2020-06-02 18:00:15 +00:00
|
|
|
bash
|
|
|
|
binutils-unwrapped
|
|
|
|
coreutils
|
|
|
|
gawk
|
|
|
|
libarchive
|
|
|
|
pv
|
|
|
|
squashfsTools
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
extract = args@{ name ? "${args.pname}-${args.version}", postExtract ? "", src, ... }: pkgs.runCommand "${name}-extracted" {
|
2020-06-02 18:00:15 +00:00
|
|
|
buildInputs = [ appimage-exec ];
|
|
|
|
} ''
|
|
|
|
appimage-exec.sh -x $out ${src}
|
2023-10-19 13:55:26 +00:00
|
|
|
${postExtract}
|
2020-06-02 18:00:15 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# for compatibility, deprecated
|
|
|
|
extractType1 = extract;
|
|
|
|
extractType2 = extract;
|
|
|
|
wrapType1 = wrapType2;
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
wrapAppImage = args@{
|
|
|
|
src,
|
2024-05-15 15:35:15 +00:00
|
|
|
extraPkgs ? pkgs: [ ],
|
2022-06-26 10:26:21 +00:00
|
|
|
meta ? {},
|
|
|
|
...
|
2023-04-29 16:46:19 +00:00
|
|
|
}: buildFHSEnv
|
2020-06-02 18:00:15 +00:00
|
|
|
(defaultFhsEnvArgs // {
|
|
|
|
targetPkgs = pkgs: [ appimage-exec ]
|
|
|
|
++ defaultFhsEnvArgs.targetPkgs pkgs ++ extraPkgs pkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
runScript = "appimage-exec.sh -w ${src} --";
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
|
|
} // meta;
|
2024-05-15 15:35:15 +00:00
|
|
|
} // (removeAttrs args (builtins.attrNames (builtins.functionArgs wrapAppImage))));
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapType2 = args@{ src, extraPkgs ? pkgs: [ ], ... }: wrapAppImage
|
2020-06-02 18:00:15 +00:00
|
|
|
(args // {
|
2024-05-15 15:35:15 +00:00
|
|
|
inherit extraPkgs;
|
|
|
|
src = extract (lib.filterAttrs (key: value: builtins.elem key [ "name" "pname" "version" "src" ]) args);
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
# passthru src to make nix-update work
|
|
|
|
# hack to keep the origin position (unsafeGetAttrPos)
|
|
|
|
passthru = lib.pipe args [
|
|
|
|
lib.attrNames
|
|
|
|
(lib.remove "src")
|
|
|
|
(removeAttrs args)
|
|
|
|
] // args.passthru or { };
|
2020-06-02 18:00:15 +00:00
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
defaultFhsEnvArgs = {
|
|
|
|
# Most of the packages were taken from the Steam chroot
|
|
|
|
targetPkgs = pkgs: with pkgs; [
|
|
|
|
gtk3
|
|
|
|
bashInteractive
|
2021-05-20 23:08:51 +00:00
|
|
|
gnome.zenity
|
2020-04-24 23:36:52 +00:00
|
|
|
xorg.xrandr
|
|
|
|
which
|
|
|
|
perl
|
2021-02-05 17:12:51 +00:00
|
|
|
xdg-utils
|
2020-04-24 23:36:52 +00:00
|
|
|
iana-etc
|
|
|
|
krb5
|
2022-03-30 09:31:56 +00:00
|
|
|
gsettings-desktop-schemas
|
|
|
|
hicolor-icon-theme # dont show a gtk warning about hicolor not being installed
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# list of libraries expected in an appimage environment:
|
|
|
|
# https://github.com/AppImage/pkg2appimage/blob/master/excludelist
|
|
|
|
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
|
2020-08-20 17:08:02 +00:00
|
|
|
gst_all_1.gst-plugins-base
|
2020-04-24 23:36:52 +00:00
|
|
|
libdrm
|
|
|
|
xorg.xkeyboardconfig
|
|
|
|
xorg.libpciaccess
|
|
|
|
|
|
|
|
glib
|
|
|
|
gtk2
|
|
|
|
bzip2
|
|
|
|
zlib
|
|
|
|
gdk-pixbuf
|
|
|
|
|
|
|
|
xorg.libXinerama
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
xorg.libXxf86vm
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libSM
|
|
|
|
xorg.libICE
|
|
|
|
freetype
|
2022-06-16 17:23:12 +00:00
|
|
|
curlWithGnuTls
|
2020-04-24 23:36:52 +00:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
fontconfig
|
|
|
|
cairo
|
|
|
|
pango
|
|
|
|
expat
|
|
|
|
dbus
|
|
|
|
cups
|
|
|
|
libcap
|
|
|
|
SDL2
|
|
|
|
libusb1
|
|
|
|
udev
|
|
|
|
dbus-glib
|
|
|
|
atk
|
|
|
|
at-spi2-atk
|
|
|
|
libudev0-shim
|
|
|
|
|
|
|
|
xorg.libXt
|
|
|
|
xorg.libXmu
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.xcbutil
|
|
|
|
xorg.xcbutilwm
|
|
|
|
xorg.xcbutilimage
|
|
|
|
xorg.xcbutilkeysyms
|
|
|
|
xorg.xcbutilrenderutil
|
|
|
|
libGLU
|
|
|
|
libuuid
|
|
|
|
libogg
|
|
|
|
libvorbis
|
|
|
|
SDL
|
|
|
|
SDL2_image
|
|
|
|
glew110
|
|
|
|
openssl
|
|
|
|
libidn
|
|
|
|
tbb
|
|
|
|
wayland
|
|
|
|
mesa
|
|
|
|
libxkbcommon
|
2022-09-30 11:47:45 +00:00
|
|
|
vulkan-loader
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
flac
|
|
|
|
freeglut
|
|
|
|
libjpeg
|
|
|
|
libpng12
|
2022-09-30 11:47:45 +00:00
|
|
|
libpulseaudio
|
2020-04-24 23:36:52 +00:00
|
|
|
libsamplerate
|
|
|
|
libmikmod
|
2024-01-02 11:29:13 +00:00
|
|
|
libthai
|
2020-04-24 23:36:52 +00:00
|
|
|
libtheora
|
|
|
|
libtiff
|
|
|
|
pixman
|
|
|
|
speex
|
|
|
|
SDL_image
|
|
|
|
SDL_ttf
|
|
|
|
SDL_mixer
|
|
|
|
SDL2_ttf
|
|
|
|
SDL2_mixer
|
|
|
|
libappindicator-gtk2
|
|
|
|
libcaca
|
|
|
|
libcanberra
|
|
|
|
libgcrypt
|
|
|
|
libvpx
|
|
|
|
librsvg
|
|
|
|
xorg.libXft
|
|
|
|
libvdpau
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
harfbuzz
|
|
|
|
e2fsprogs
|
2021-10-08 15:17:17 +00:00
|
|
|
libgpg-error
|
2020-04-24 23:36:52 +00:00
|
|
|
keyutils.lib
|
|
|
|
libjack2
|
|
|
|
fribidi
|
|
|
|
p11-kit
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
gmp
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# libraries not on the upstream include list, but nevertheless expected
|
|
|
|
# by at least one appimage
|
|
|
|
libtool.lib # for Synfigstudio
|
2021-03-16 09:55:35 +00:00
|
|
|
xorg.libxshmfence # for apple-music-electron
|
2020-04-24 23:36:52 +00:00
|
|
|
at-spi2-core
|
2023-10-09 19:29:22 +00:00
|
|
|
pciutils # for FreeCAD
|
2024-02-29 20:09:43 +00:00
|
|
|
pipewire # immersed-vr wayland support
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|