Set icon for QEMU binary on Mac OS
PATCH 1/1 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.
--- meson.build | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
meson.build +20 -0
@@ -2183,6 +2183,26 @@ foreach target : target_dirs link_args: link_args, gui_app: exe['gui']) +# set QEMU's icon on Mac OS +if targetos == 'darwin' + newiconpart1 = custom_target('Icon for ' + exe_name + ' - part 1', + depends : emulator, + input : emulator, + output : 'new icon for ' + exe_name + ' - 1', + command : ['Rez', '-append', + meson.source_root() + '/pc-bios/qemu.rsrc', '-o', + meson.current_build_dir() / exe['name']], + build_by_default : true) + + custom_target('Icon for ' + exe_name + ' - part 2', + depends : newiconpart1, + input : emulator, + output : 'new icon for ' + exe_name + ' - 2', + command : ['SetFile', '-a', 'C', + meson.current_build_dir() / exe['name']], + build_by_default : true) +endif + if exe_sign emulators += {exe['name'] : custom_target(exe['name'], install: true,
Signature · 1 line
2.24.3 (Apple Git-128)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 45 lines · Paolo Bonzini
Quoted 27 lines · John Arbuckle
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.
Signed-off-by John Arbuckle <[email protected]>--- meson.build | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)meson.build +12
-0@@ -2183,6 +2183,26 @@ foreach target : target_dirs link_args: link_args, gui_app: exe['gui']) +# set QEMU's icon on Mac OS +if targetos == 'darwin' + newiconpart1 = custom_target('Icon for ' + exe_name + ' - part 1', + depends : emulator, + input : emulator, + output : 'new icon for ' + exe_name + ' - 1', + command : ['Rez', '-append', + meson.source_root() + '/pc-bios/qemu.rsrc', '-o', + meson.current_build_dir() / exe['name']], + build_by_default : true) + + custom_target('Icon for ' + exe_name + ' - part 2', + depends : newiconpart1,meson.build foreach target : target_dirs · line 2207
Quoted 10 lines
meson.build +7
-0+ input : emulator, + output : 'new icon for ' + exe_name + ' - 2', + command : ['SetFile', '-a', 'C', + meson.current_build_dir() / exe['name']], + build_by_default : true) +endif + if exe_sign emulators += {exe['name'] : custom_target(exe['name'], install: true,Maybe you can do it on install, using
add_install_scriptinstead?
Quoted 1 line
Paolo
The script would only be two lines long:
Rez -append ./pc-bios/qemu.rsrc -o $(QEMU_BINARY)
SetFile -a C $(QEMU_BINARY)Is a separate script file still preferred?
Quoted 37 lines · Programmingkid
Quoted 37 lines · Paolo Bonzini
Quoted 31 lines · John Arbuckle
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.
Signed-off-by John Arbuckle <[email protected]>--- meson.build | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)meson.build +16
-0@@ -2183,6 +2183,26 @@ foreach target : target_dirs link_args: link_args, gui_app: exe['gui']) +# set QEMU's icon on Mac OS +if targetos == 'darwin' + newiconpart1 = custom_target('Icon for ' + exe_name + ' - part 1', + depends : emulator, + input : emulator, + output : 'new icon for ' + exe_name + ' - 1', + command : ['Rez', '-append', + meson.source_root() + '/pc-bios/qemu.rsrc', '-o', + meson.current_build_dir() / exe['name']], + build_by_default : true) + + custom_target('Icon for ' + exe_name + ' - part 2', + depends : newiconpart1, + input : emulator, + output : 'new icon for ' + exe_name + ' - 2', + command : ['SetFile', '-a', 'C', + meson.current_build_dir() / exe['name']],
Quoted 8 lines
Quoted 8 lines
meson.build foreach target : target_dirs · line 2208
Quoted 6 lines
meson.build +3
-0+ build_by_default : true) +endif + if exe_sign emulators += {exe['name'] : custom_target(exe['name'], install: true,Maybe you can do it on install, using
add_install_scriptinstead?
Why would we want to only do it on install? A QEMU which you run from the build tree ought to still have its icon, surely ?
-- PMM
Quoted 47 lines · Peter Maydell
Quoted 37 lines · Programmingkid
Quoted 37 lines · Paolo Bonzini
Quoted 31 lines · John Arbuckle
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.
Signed-off-by John Arbuckle <[email protected]>--- meson.build | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)meson.build +16
-0@@ -2183,6 +2183,26 @@ foreach target : target_dirs link_args: link_args, gui_app: exe['gui']) +# set QEMU's icon on Mac OS +if targetos == 'darwin' + newiconpart1 = custom_target('Icon for ' + exe_name + ' - part 1', + depends : emulator, + input : emulator, + output : 'new icon for ' + exe_name + ' - 1', + command : ['Rez', '-append', + meson.source_root() + '/pc-bios/qemu.rsrc', '-o', + meson.current_build_dir() / exe['name']], + build_by_default : true) + + custom_target('Icon for ' + exe_name + ' - part 2', + depends : newiconpart1, + input : emulator, + output : 'new icon for ' + exe_name + ' - 2', + command : ['SetFile', '-a', 'C', + meson.current_build_dir() / exe['name']],Quoted 8 lines
Quoted 8 lines
meson.build foreach target : target_dirs · line 2208
Quoted 6 lines
meson.build +3
-0+ build_by_default : true) +endif + if exe_sign emulators += {exe['name'] : custom_target(exe['name'], install: true,Maybe you can do it on install, using
add_install_scriptinstead?
Quoted 3 lines
Why would we want to only do it on install? A QEMU which you run from the build tree ought to still have its icon, surely ?
Mostly because edit-in-place commands are not very well suited to a "make" workflow, while they're common at install time (e.g. strip).
But since we already have scripts/entitlement.sh, and it's only Apple that like in-place build steps it is even better to combine all the in-place adjustment to the executable in scripts/entitlement.sh. For example if no entitlements are needed, you pass an empty third argument and scripts/entitlement.sh (now scripts/postprocess-darwin-executable.sh or something like that?) can do Rez+SetFile but not codesign. The existing "if exe_sign" becomes an "if targetos == 'darwin'".
Paolo