summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2022-03-31 14:04:52 +0200
committertoonn <toonn@toonn.io>2022-03-31 14:04:52 +0200
commitf31d9457551315abad6174c08646e39e09f8db70 (patch)
tree211594dbd80c77dac69ccf9597f3b41ae6652dba /pkgs/build-support
parent196f989ae88a13210720cb08d53a57c5c05481a0 (diff)
downloadnixpkgs-f31d9457551315abad6174c08646e39e09f8db70.tar
nixpkgs-f31d9457551315abad6174c08646e39e09f8db70.tar.gz
nixpkgs-f31d9457551315abad6174c08646e39e09f8db70.tar.bz2
nixpkgs-f31d9457551315abad6174c08646e39e09f8db70.tar.lz
nixpkgs-f31d9457551315abad6174c08646e39e09f8db70.tar.xz
nixpkgs-f31d9457551315abad6174c08646e39e09f8db70.tar.zst
nixpkgs-f31d9457551315abad6174c08646e39e09f8db70.zip
desktopToDarwinBundle: Implement %f and %u Exec field codes
`%f` and `%u` are used to signal the program only accepts a single file
or URI argument. I do not believe there's a way to signal this
information to macOS but it is possible the program really won't work if
multiple files are passed and it's possible the relative position of
`%i`, `%c` or `%k` matters. So we replace `%f` or `%u` with `$1`. That
way we only pass one file in the (possibly significant) position of the
field code.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh b/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
index 92c790e9907..b181ec1dc63 100644
--- a/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
+++ b/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
@@ -178,7 +178,8 @@ processExecFieldCodes() {
   local -r execNoKC="${execNoK/\%c/$(getDesktopParam "${file}" "Name")}"
   local -r icon=$(getDesktopParam "${file}" "Icon")
   local -r execNoKCI="${execNoKC/\%i/${icon:+--icon }${icon}}"
-  local -r exec="${execNoKCI// %[fFuU]}"
+  local -r execNoKCIfu="${execNoKCI/\%[fu]/\$1}"
+  local -r exec="${execNoKCIfu// %[FU]}"
   if [[ "$exec" != "$execRaw" ]]; then
     echo 1>&2 "desktopToDarwinBundle: Application bundles do not understand desktop entry field codes. Changed '$execRaw' to '$exec'."
   fi