* [PATCH v2] Set icon for QEMU binary on Mac OS
@ 2021-07-05 19:53 John Arbuckle
2021-07-05 20:07 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: John Arbuckle @ 2021-07-05 19:53 UTC (permalink / raw)
To: pbonzini, qemu-devel; +Cc: John Arbuckle
Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
v1 changes:
Rewrote the patch as the maintainer had wanted.
meson.build | 15 ++++++++++-----
scripts/entitlement.sh | 10 +++++++++-
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index db6789af9c..499ab49981 100644
--- a/meson.build
+++ b/meson.build
@@ -2360,8 +2360,7 @@ foreach target : target_dirs
endif
foreach exe: execs
exe_name = exe['name']
- exe_sign = 'CONFIG_HVF' in config_target
- if exe_sign
+ if targetos == 'darwin'
exe_name += '-unsigned'
endif
@@ -2375,7 +2374,13 @@ foreach target : target_dirs
link_args: link_args,
gui_app: exe['gui'])
- if exe_sign
+ if 'CONFIG_HVF' in config_target
+ entitlements = meson.current_source_dir() / 'accel/hvf/entitlements.plist'
+ else
+ entitlements = '/dev/null'
+ endif
+ if targetos == 'darwin'
+ icon = '...'
emulators += {exe['name'] : custom_target(exe['name'],
depends: emulator,
output: exe['name'],
@@ -2383,14 +2388,14 @@ foreach target : target_dirs
meson.current_source_dir() / 'scripts/entitlement.sh',
meson.current_build_dir() / exe_name,
meson.current_build_dir() / exe['name'],
- meson.current_source_dir() / 'accel/hvf/entitlements.plist'
+ entitlements, icon
])
}
meson.add_install_script('scripts/entitlement.sh', '--install',
get_option('bindir') / exe_name,
get_option('bindir') / exe['name'],
- meson.current_source_dir() / 'accel/hvf/entitlements.plist')
+ entitlements, icon)
else
emulators += {exe['name']: emulator}
endif
diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
index f7aaaf2766..46e378426b 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 '../pc-bios/qemu.rsrc' -o "$SRC"
+SetFile -a C "$SRC"
+
mv -f "$SRC" "$DST"
trap '' exit
--
2.24.3 (Apple Git-128)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Set icon for QEMU binary on Mac OS
2021-07-05 19:53 [PATCH v2] Set icon for QEMU binary on Mac OS John Arbuckle
@ 2021-07-05 20:07 ` Paolo Bonzini
2021-07-06 0:51 ` Programmingkid
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2021-07-05 20:07 UTC (permalink / raw)
To: John Arbuckle; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]
Well, you're not using $ICON at all but I can clean that up myself. Thanks
for testing.
Paolo
Il lun 5 lug 2021, 21:53 John Arbuckle <programmingkidx@gmail.com> ha
scritto:
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
> v1 changes:
> Rewrote the patch as the maintainer had wanted.
>
> meson.build | 15 ++++++++++-----
> scripts/entitlement.sh | 10 +++++++++-
> 2 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index db6789af9c..499ab49981 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2360,8 +2360,7 @@ foreach target : target_dirs
> endif
> foreach exe: execs
> exe_name = exe['name']
> - exe_sign = 'CONFIG_HVF' in config_target
> - if exe_sign
> + if targetos == 'darwin'
> exe_name += '-unsigned'
> endif
>
> @@ -2375,7 +2374,13 @@ foreach target : target_dirs
> link_args: link_args,
> gui_app: exe['gui'])
>
> - if exe_sign
> + if 'CONFIG_HVF' in config_target
> + entitlements = meson.current_source_dir() /
> 'accel/hvf/entitlements.plist'
> + else
> + entitlements = '/dev/null'
> + endif
> + if targetos == 'darwin'
> + icon = '...'
> emulators += {exe['name'] : custom_target(exe['name'],
> depends: emulator,
> output: exe['name'],
> @@ -2383,14 +2388,14 @@ foreach target : target_dirs
> meson.current_source_dir() /
> 'scripts/entitlement.sh',
> meson.current_build_dir() / exe_name,
> meson.current_build_dir() / exe['name'],
> - meson.current_source_dir() /
> 'accel/hvf/entitlements.plist'
> + entitlements, icon
> ])
> }
>
> meson.add_install_script('scripts/entitlement.sh', '--install',
> get_option('bindir') / exe_name,
> get_option('bindir') / exe['name'],
> - meson.current_source_dir() /
> 'accel/hvf/entitlements.plist')
> + entitlements, icon)
> else
> emulators += {exe['name']: emulator}
> endif
> diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
> index f7aaaf2766..46e378426b 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 '../pc-bios/qemu.rsrc' -o "$SRC"
> +SetFile -a C "$SRC"
> +
> mv -f "$SRC" "$DST"
> trap '' exit
> --
> 2.24.3 (Apple Git-128)
>
>
[-- Attachment #2: Type: text/html, Size: 4258 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Set icon for QEMU binary on Mac OS
2021-07-05 20:07 ` Paolo Bonzini
@ 2021-07-06 0:51 ` Programmingkid
0 siblings, 0 replies; 3+ messages in thread
From: Programmingkid @ 2021-07-06 0:51 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
> On Jul 5, 2021, at 4:07 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Well, you're not using $ICON at all but I can clean that up myself. Thanks for testing.
>
> Paolo
>
Please send me the cleaned up patch for testing once you complete it. Thank you.
> Il lun 5 lug 2021, 21:53 John Arbuckle <programmingkidx@gmail.com> ha scritto:
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
> v1 changes:
> Rewrote the patch as the maintainer had wanted.
>
> meson.build | 15 ++++++++++-----
> scripts/entitlement.sh | 10 +++++++++-
> 2 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index db6789af9c..499ab49981 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2360,8 +2360,7 @@ foreach target : target_dirs
> endif
> foreach exe: execs
> exe_name = exe['name']
> - exe_sign = 'CONFIG_HVF' in config_target
> - if exe_sign
> + if targetos == 'darwin'
> exe_name += '-unsigned'
> endif
>
> @@ -2375,7 +2374,13 @@ foreach target : target_dirs
> link_args: link_args,
> gui_app: exe['gui'])
>
> - if exe_sign
> + if 'CONFIG_HVF' in config_target
> + entitlements = meson.current_source_dir() / 'accel/hvf/entitlements.plist'
> + else
> + entitlements = '/dev/null'
> + endif
> + if targetos == 'darwin'
> + icon = '...'
> emulators += {exe['name'] : custom_target(exe['name'],
> depends: emulator,
> output: exe['name'],
> @@ -2383,14 +2388,14 @@ foreach target : target_dirs
> meson.current_source_dir() / 'scripts/entitlement.sh',
> meson.current_build_dir() / exe_name,
> meson.current_build_dir() / exe['name'],
> - meson.current_source_dir() / 'accel/hvf/entitlements.plist'
> + entitlements, icon
> ])
> }
>
> meson.add_install_script('scripts/entitlement.sh', '--install',
> get_option('bindir') / exe_name,
> get_option('bindir') / exe['name'],
> - meson.current_source_dir() / 'accel/hvf/entitlements.plist')
> + entitlements, icon)
> else
> emulators += {exe['name']: emulator}
> endif
> diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
> index f7aaaf2766..46e378426b 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 '../pc-bios/qemu.rsrc' -o "$SRC"
> +SetFile -a C "$SRC"
> +
> mv -f "$SRC" "$DST"
> trap '' exit
> --
> 2.24.3 (Apple Git-128)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-06 0:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 19:53 [PATCH v2] Set icon for QEMU binary on Mac OS John Arbuckle
2021-07-05 20:07 ` Paolo Bonzini
2021-07-06 0:51 ` Programmingkid
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.