aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Arbuckle <programmingkidx@gmail.com>2021-07-05 15:53:28 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2021-07-06 09:35:08 +0200
commit3983a767e3d85008c1fb4b8618ac67bf5aee7527 (patch)
tree85d6c8e73971e698099a503eb0b58b5ad119f606 /scripts
parent904806c69bd4e013491550d05f5c2cbdba9a9b38 (diff)
Set icon for QEMU binary on Mac OS
Before switching the build system over to Meson, an icon was added to the QEMU binary on Mac OS. This patch adds back that feature; it piggybacks on the existing scripts/entitlement.sh, which already does in-place changes to the executable on Darwin. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-Id: <20210705195328.36442-1-programmingkidx@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/entitlement.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
index f7aaaf2766..d2a7079ce3 100755
--- a/scripts/entitlement.sh
+++ b/scripts/entitlement.sh
@@ -11,6 +11,7 @@ fi
SRC="$1"
DST="$2"
ENTITLEMENT="$3"
+ICON="$4"
if $in_place; then
trap 'rm "$DST.tmp"' exit
@@ -20,6 +21,13 @@ else
cd "$MESON_INSTALL_DESTDIR_PREFIX"
fi
-codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
+if test "$ENTITLEMENT" != '/dev/null'; then
+ codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
+fi
+
+# Add the QEMU icon to the binary on Mac OS
+Rez -append "$ICON" -o "$SRC"
+SetFile -a C "$SRC"
+
mv -f "$SRC" "$DST"
trap '' exit