From b5160bba86e7a47573dde96c779dffa0526d9858 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 1 Jul 2021 17:08:24 -0700 Subject: [PATCH] appimageTools.wrapAppImage: Fix passing arguments to wrapped executable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit appimage-exec.sh parses its arguments with getopts, so we need to delimit arguments intended for the wrapped executable with ‘--’, in case some of them begin with ‘-’. Without this fix, a wrapped application like Zulip Desktop can’t be opened the normal way using the .desktop file, which includes ‘Exec=zulip --no-sandbox %U’ (as per the electron-builder default): $ gtk-launch zulip.desktop /usr/bin/appimage-exec.sh: illegal option -- - Usage: appimage-run [appimage-run options] [AppImage options] […] Signed-off-by: Anders Kaseorg --- pkgs/build-support/appimage/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/appimage/default.nix b/pkgs/build-support/appimage/default.nix index 6ba5890885d..a759726eb10 100644 --- a/pkgs/build-support/appimage/default.nix +++ b/pkgs/build-support/appimage/default.nix @@ -45,7 +45,7 @@ rec { targetPkgs = pkgs: [ appimage-exec ] ++ defaultFhsEnvArgs.targetPkgs pkgs ++ extraPkgs pkgs; - runScript = "appimage-exec.sh -w ${src}"; + runScript = "appimage-exec.sh -w ${src} --"; } // (removeAttrs args (builtins.attrNames (builtins.functionArgs wrapAppImage)))); wrapType2 = args@{ name, src, extraPkgs ? pkgs: [ ], ... }: wrapAppImage