meson: mingw installation fixes & nsis conversion
Subsystems (2)
v2 cover meson: mingw installation fixes & nsis conversion
From: Marc-André Lureau <[email protected]>
Hi,
The following patches fix installation path when cross-compiling Windows version, and move the NSIS build rule to meson.
v2:
- replaced the shell script by a python version
- add copyright/license for the new python script
Marc-André Lureau (5):
meson: pass confsuffix option
meson: use meson datadir instead of qemu_datadir
meson: add docdir option and pass pre-prefix qemu_docdir
meson: use meson mandir instead of qemu_mandir
meson: add NSIS building
Makefile | 56 --------------------- configure | 2 + contrib/vhost-user-gpu/meson.build | 2 +- docs/meson.build | 4 +- meson.build | 33 +++++++++++-- meson_options.txt | 2 + pc-bios/descriptors/meson.build | 2 +- pc-bios/keymaps/meson.build | 6 +-- pc-bios/meson.build | 2 +- scripts/nsis.py | 78 ++++++++++++++++++++++++++++++ tools/virtiofsd/meson.build | 2 +- trace/meson.build | 2 +- 12 files changed, 122 insertions(+), 69 deletions(-) create mode 100644 scripts/nsis.py
Signature · 1 line
2.26.2
PATCH v2 1/5 meson: pass confsuffix option
From: Marc-André Lureau <[email protected]>
The following patches will make use of it to fix installation paths.
--- configure | 1 + meson_options.txt | 1 + 2 files changed, 2 insertions(+)
configure +1 -0
@@ -8222,6 +8222,7 @@ NINJA=$PWD/ninjatool $meson setup \ --mandir "${pre_prefix}$mandir" \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ + -Dconfsuffix="$confsuffix" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
meson_options.txt +1 -0
@@ -1,3 +1,4 @@ +option('confsuffix', type : 'string', value: 'qemu') option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto')
Signature · 1 line
2.26.2
Re: [PATCH v2 1/5] meson: pass confsuffix option
Quoted 27 lines · On Tue, Aug 25, 2020 at 09:58:23PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
The following patches will make use of it to fix installation paths.
Signed-off-by Marc-André Lureau <[email protected]>--- configure | 1 + meson_options.txt | 1 + 2 files changed, 2 insertions(+)configure +1
-0@@ -8222,6 +8222,7 @@ NINJA=$PWD/ninjatool $meson setup \ --mandir "${pre_prefix}$mandir" \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ + -Dconfsuffix="$confsuffix" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \meson_options.txt +0
-0
meson_options.txt line 1
Quoted 1 line
meson_options.txt +1
-0@@ -1,3 +1,4 @@ +option('confsuffix', type : 'string', value: 'qemu')
In "configure", $confsuffix defaults to "/qemu", but here is misses the "/". Not having the "/" is better as meson will add the correct platform specific dir separator, but it makes me think that configure needs updating to strip a leading "/" when passing it into meson ?
Quoted 6 lines
meson_options.txt +0
-0option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto')Signature · 1 line
2.26.2
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH v2 2/5 meson: use meson datadir instead of qemu_datadir
In reply to [email protected]From: Marc-André Lureau <[email protected]>
When cross-compiling, by default qemu_datadir is 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again.
--- contrib/vhost-user-gpu/meson.build | 2 +- meson.build | 3 ++- pc-bios/descriptors/meson.build | 2 +- pc-bios/keymaps/meson.build | 6 +++--- pc-bios/meson.build | 2 +- tools/virtiofsd/meson.build | 2 +- trace/meson.build | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-)
contrib/vhost-user-gpu/meson.build +1 -1
@@ -9,5 +9,5 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \ configure_file(input: '50-qemu-gpu.json.in', output: '50-qemu-gpu.json', configuration: config_host, - install_dir: config_host['qemu_datadir'] / 'vhost-user') + install_dir: qemu_datadir / 'vhost-user') endif
meson.build +2 -1
@@ -17,6 +17,7 @@ config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak enable_modules = 'CONFIG_MODULES' in config_host enable_static = 'CONFIG_STATIC' in config_host build_docs = 'BUILD_DOCS' in config_host +qemu_datadir = get_option('datadir') + get_option('confsuffix') config_host_data = configuration_data() genh = []
@@ -1039,7 +1040,7 @@ foreach target : target_dirs output: exe_name + stp['ext'], capture: true, install: stp['install'], - install_dir: config_host['qemu_datadir'] / '../systemtap/tapset', + install_dir: qemu_datadir / '../systemtap/tapset', command: [ tracetool, '--group=all', '--format=' + stp['fmt'], '--binary=' + stp['bin'],
pc-bios/descriptors/meson.build +1 -1
@@ -10,5 +10,5 @@ foreach f: [ output: f, configuration: {'DATADIR': config_host['qemu_datadir']}, install: install_blobs, - install_dir: config_host['qemu_datadir'] / 'firmware') + install_dir: qemu_datadir / 'firmware') endforeach
pc-bios/keymaps/meson.build +3 -3
@@ -44,13 +44,13 @@ foreach km, args: keymaps build_by_default: true, output: km, command: [native_qemu_keymap, '-f', '@OUTPUT@', args.split()], - install_dir: config_host['qemu_datadir'] / 'keymaps') + install_dir: qemu_datadir / 'keymaps') endforeach if t.length() > 0 alias_target('update-keymaps', t) else # install from the source tree - install_data(keymaps.keys(), install_dir: config_host['qemu_datadir'] / 'keymaps') + install_data(keymaps.keys(), install_dir: qemu_datadir / 'keymaps') endif -install_data(['sl', 'sv'], install_dir: config_host['qemu_datadir'] / 'keymaps') +install_data(['sl', 'sv'], install_dir: qemu_datadir / 'keymaps')
pc-bios/meson.build +1 -1
@@ -19,7 +19,7 @@ if 'DECOMPRESS_EDK2_BLOBS' in config_host input: '@[email protected]'.format(f), capture: true, install: install_blobs, - install_dir: config_host['qemu_datadir'], + install_dir: qemu_datadir, command: [ bzip2, '-dc', '@INPUT0@' ]) endforeach endif
tools/virtiofsd/meson.build +1 -1
@@ -16,4 +16,4 @@ executable('virtiofsd', files( configure_file(input: '50-qemu-virtiofsd.json.in', output: '50-qemu-virtiofsd.json', configuration: config_host, - install_dir: config_host['qemu_datadir'] / 'vhost-user') + install_dir: qemu_datadir / 'vhost-user')
trace/meson.build +1 -1
@@ -55,7 +55,7 @@ trace_events_all = custom_target('trace-events-all', command: [ 'cat', '@INPUT@' ], capture: true, install: true, - install_dir: config_host['qemu_datadir']) + install_dir: qemu_datadir) foreach d : [ ['generated-tcg-tracers.h', 'tcg-h'],
Signature · 1 line
2.26.2
Re: [PATCH v2 2/5] meson: use meson datadir instead of qemu_datadir
Quoted 23 lines · On Tue, Aug 25, 2020 at 09:58:24PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When cross-compiling, by default
qemu_datadiris 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again.Signed-off-by Marc-André Lureau <[email protected]>--- contrib/vhost-user-gpu/meson.build | 2 +- meson.build | 3 ++- pc-bios/descriptors/meson.build | 2 +- pc-bios/keymaps/meson.build | 6 +++--- pc-bios/meson.build | 2 +- tools/virtiofsd/meson.build | 2 +- trace/meson.build | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-)meson.build +0
-0
meson.build config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak · line 20
Quoted 4 lines
meson.build +1
-0@@ -17,6 +17,7 @@ config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak enable_modules = 'CONFIG_MODULES' in config_host enable_static = 'CONFIG_STATIC' in config_host build_docs = 'BUILD_DOCS' in config_host +qemu_datadir = get_option('datadir') + get_option('confsuffix')
This needs to be
get_option('datadir') / get_option('confsuffix')
to add the dir separator if we're using the default meson value for "confsuffix" which lacks a leading "/".
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH v2 2/5] meson: use meson datadir instead of qemu_datadir
Hi
Quoted 31 lines · Daniel P. Berrangé
meson.build config_all_disas =
Quoted 23 lines · On Tue, Aug 25, 2020 at 09:58:24PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When cross-compiling, by default
qemu_datadiris 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again.Signed-off-by Marc-André Lureau <[email protected]>--- contrib/vhost-user-gpu/meson.build | 2 +- meson.build | 3 ++- pc-bios/descriptors/meson.build | 2 +- pc-bios/keymaps/meson.build | 6 +++--- pc-bios/meson.build | 2 +- tools/virtiofsd/meson.build | 2 +- trace/meson.build | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-)meson.build +0
-0@@ -17,6 +17,7 @@ config_all_disas =keyval.load(meson.current_build_dir() / 'config-all-disas.mak
meson.build config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak · line 20
Quoted 4 lines
meson.build +1
-0enable_modules = 'CONFIG_MODULES' in config_host enable_static = 'CONFIG_STATIC' in config_host build_docs = 'BUILD_DOCS' in config_host +qemu_datadir = get_option('datadir') + get_option('confsuffix')
Quoted 7 lines
This needs to be
get_option('datadir')/get_option('confsuffix')to add the dir separator if we're using the default meson value for "confsuffix" which lacks a leading "/".
right, fixed
Signature · 1 line
Marc-André Lureau
Re: [PATCH v2 2/5] meson: use meson datadir instead of qemu_datadir
You'd need to check first if it works correctly if confsuffix "looks like" an absolute path ('/qemu'). So + looks correct to me.
(Sorry for top posting).
Paolo
Il mer 26 ago 2020, 10:53 Marc-André Lureau <[email protected]> ha scritto:
Quoted 49 lines
Hi
Quoted 31 lines · Daniel P. Berrangé
meson.build config_all_disas =
Quoted 23 lines · On Tue, Aug 25, 2020 at 09:58:24PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When cross-compiling, by default
qemu_datadiris 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again.Signed-off-by Marc-André Lureau <[email protected]>--- contrib/vhost-user-gpu/meson.build | 2 +- meson.build | 3 ++- pc-bios/descriptors/meson.build | 2 +- pc-bios/keymaps/meson.build | 6 +++--- pc-bios/meson.build | 2 +- tools/virtiofsd/meson.build | 2 +- trace/meson.build | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-)meson.build +0
-0@@ -17,6 +17,7 @@ config_all_disas =keyval.load(meson.current_build_dir() / 'config-all-disas.mak
meson.build config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak · line 20
Quoted 4 lines
meson.build +1
-0enable_modules = 'CONFIG_MODULES' in config_host enable_static = 'CONFIG_STATIC' in config_host build_docs = 'BUILD_DOCS' in config_host +qemu_datadir = get_option('datadir') + get_option('confsuffix')Quoted 7 lines
This needs to be
get_option('datadir')/get_option('confsuffix')to add the dir separator if we're using the default meson value for "confsuffix" which lacks a leading "/".
right, fixed
--
Marc-André Lureau
PATCH v2 3/5 meson: add docdir option and pass pre-prefix qemu_docdir
In reply to [email protected]From: Marc-André Lureau <[email protected]>
When cross-compiling, by default qemu_docdir is 'c:\Program Files\QEMU\' which is not recognized as being an absolute path, and meson will end up adding the prefix again.
Add an option to pass docdir location to meson, pre-prefixed like we do with other directories and use that instead of config_host['qemu_docdir'].
--- configure | 1 + docs/meson.build | 4 ++-- meson.build | 3 ++- meson_options.txt | 1 + 4 files changed, 6 insertions(+), 3 deletions(-)
configure +1 -0
@@ -8223,6 +8223,7 @@ NINJA=$PWD/ninjatool $meson setup \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ -Dconfsuffix="$confsuffix" \ + -Ddocdir="${pre_prefix}$qemu_docdir" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
docs/meson.build +2 -2
@@ -10,7 +10,7 @@ if build_docs configure_file(output: 'index.html', input: files('index.html.in'), configuration: {'VERSION': meson.project_version()}, - install_dir: config_host['qemu_docdir']) + install_dir: get_option('docdir')) manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ] man_pages = { 'interop' : {
@@ -48,7 +48,7 @@ if build_docs input_dir, output_dir]) sphinxdocs += this_manual if build_docs and manual != 'devel' - install_subdir(output_dir, install_dir: config_host['qemu_docdir']) + install_subdir(output_dir, install_dir: get_option('docdir')) endif these_man_pages = []
meson.build +2 -1
@@ -1170,7 +1170,7 @@ if build_docs input: input, output: output, install: true, - install_dir: config_host['qemu_docdir'] / 'interop', + install_dir: get_option('docdir') / 'interop', command: cmd + args) endforeach alias_target(ext, t)
@@ -1233,6 +1233,7 @@ if targetos != 'windows' else summary_info += {'local state directory': 'queried at runtime'} endif +summary_info += {'Doc directory': get_option('docdir')} summary_info += {'Build directory': meson.current_build_dir()} summary_info += {'Source path': meson.current_source_dir()} summary_info += {'GIT binary': config_host['GIT']}
meson_options.txt +1 -0
@@ -1,4 +1,5 @@ option('confsuffix', type : 'string', value: 'qemu') +option('docdir', type : 'string', value : 'doc/qemu') option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto')
Signature · 1 line
2.26.2
Re: [PATCH v2 3/5] meson: add docdir option and pass pre-prefix qemu_docdir
Quoted 22 lines · On Tue, Aug 25, 2020 at 09:58:25PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When cross-compiling, by default
qemu_docdiris 'c:\Program Files\QEMU\' which is not recognized as being an absolute path, and meson will end up adding the prefix again.Add an option to pass docdir location to meson, pre-prefixed like we do with other directories and use that instead of config_host['qemu_docdir'].
Signed-off-by Marc-André Lureau <[email protected]>--- configure | 1 + docs/meson.build | 4 ++-- meson.build | 3 ++- meson_options.txt | 1 + 4 files changed, 6 insertions(+), 3 deletions(-)configure +0
-0
configure NINJA=$PWD/ninjatool $meson setup \ · line 8226
Quoted 4 lines
configure +1
-0@@ -8223,6 +8223,7 @@ NINJA=$PWD/ninjatool $meson setup \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ -Dconfsuffix="$confsuffix" \ + -Ddocdir="${pre_prefix}$qemu_docdir" \
This is passing an absolute path.....
meson_options.txt line 2
Quoted 7 lines
meson_options.txt +1
-0@@ -1,4 +1,5 @@ option('confsuffix', type : 'string', value: 'qemu') +option('docdir', type : 'string', value : 'doc/qemu')
...but this default is a relative dir, presumably relative to datadir. The code expects an absolute dir.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH v2 3/5] meson: add docdir option and pass pre-prefix qemu_docdir
Hi
Quoted 33 lines · Daniel P. Berrangé
Quoted 8 lines · On Tue, Aug 25, 2020 at 09:58:25PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When cross-compiling, by default
qemu_docdiris 'c:\Program Files\QEMU\' which is not recognized as being an absolute path, and meson will end up adding the prefix again.Add an option to pass docdir location to meson, pre-prefixed like we do with other directories and use that instead of
config_host['qemu_docdir'].
Quoted 14 lines
Signed-off-by Marc-André Lureau <[email protected]>--- configure | 1 + docs/meson.build | 4 ++-- meson.build | 3 ++- meson_options.txt | 1 + 4 files changed, 6 insertions(+), 3 deletions(-)configure +0
-0configure NINJA=$PWD/ninjatool $meson setup \ · line 8226
Quoted 4 lines
configure +1
-0@@ -8223,6 +8223,7 @@ NINJA=$PWD/ninjatool $meson setup \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ -Dconfsuffix="$confsuffix" \ + -Ddocdir="${pre_prefix}$qemu_docdir" \This is passing an absolute path.....
Quoted 11 lines
meson_options.txt line 2
Quoted 7 lines
meson_options.txt +1
-0@@ -1,4 +1,5 @@ option('confsuffix', type : 'string', value: 'qemu') +option('docdir', type : 'string', value : 'doc/qemu')...but this default is a relative dir, presumably relative to datadir. The code expects an absolute dir.
Meson accepts both absolute and relative path for installation location. If it's relative, it will be under the $prefix directory.
Quoted 13 lines
Regards,
Daniel
--
|: https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-
https://fstop138.berrange.com :|
|: https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|
Signature · 1 line
Marc-André Lureau
PATCH v2 4/5 meson: use meson mandir instead of qemu_mandir
In reply to [email protected]From: Marc-André Lureau <[email protected]>
When cross-compiling, by default qemu_mandir is 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again.
Use the pre-prefixed meson mandir option instead.
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
@@ -1210,7 +1210,7 @@ if build_docs output: man, capture: true, install: true, - install_dir: config_host['mandir'] / 'man7', + install_dir: get_option('mandir') / 'man7', command: [pod2man, '--utf8', '--section=7', '--center=" "', '--release=" "', '@INPUT@']) endforeach
Signature · 1 line
2.26.2
Re: [PATCH v2 4/5] meson: use meson mandir instead of qemu_mandir
Quoted 6 lines · On Tue, Aug 25, 2020 at 09:58:26PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When cross-compiling, by default
qemu_mandiris 'c:\Program Files\QEMU', which is not recognized as being an absolute path, and meson will end up adding the prefix again.
Quoted 6 lines
Use the pre-prefixed meson mandir option instead.
Signed-off-by Marc-André Lureau <[email protected]>--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
PATCH v2 5/5 meson: add NSIS building
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- Makefile | 56 ----------------------------------- meson.build | 25 ++++++++++++++++ scripts/nsis.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 56 deletions(-) create mode 100644 scripts/nsis.py
Makefile +0 -56
@@ -294,62 +294,6 @@ endif "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop" $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" -ifdef CONFIG_WIN32 - -INSTALLER = qemu-setup-$(VERSION)$(EXESUF) - -nsisflags = -V2 -NOCD - -ifneq ($(wildcard $(SRC_PATH)/dll),) -ifeq ($(ARCH),x86_64) -# 64 bit executables -DLL_PATH = $(SRC_PATH)/dll/w64 -nsisflags += -DW64 -else -# 32 bit executables -DLL_PATH = $(SRC_PATH)/dll/w32 -endif -endif - -.PHONY: installer -installer: $(INSTALLER) - -INSTDIR=/tmp/qemu-nsis - -$(INSTALLER): $(SRC_PATH)/qemu.nsi - $(MAKE) install DESTDIR=${INSTDIR} -ifdef SIGNCODE - (cd ${INSTDIR}/${bindir}; \ - for i in *.exe; do \ - $(SIGNCODE) $${i}; \ - done \ - ) -endif # SIGNCODE - (cd ${INSTDIR}/${bindir}; \ - for i in qemu-system-*.exe; do \ - arch=$${i%.exe}; \ - arch=$${arch#qemu-system-}; \ - echo Section \"$$arch\" Section_$$arch; \ - echo SetOutPath \"\$$INSTDIR\"; \ - echo File \"\$${BINDIR}\\$$i\"; \ - echo SectionEnd; \ - done \ - ) >${INSTDIR}/${bindir}/system-emulations.nsh - makensis $(nsisflags) \ - $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \ - $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \ - -DBINDIR="${INSTDIR}/${bindir}" \ - $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \ - -DSRCDIR="$(SRC_PATH)" \ - -DOUTFILE="$(INSTALLER)" \ - -DDISPLAYVERSION="$(VERSION)" \ - $(SRC_PATH)/qemu.nsi - rm -r ${INSTDIR} -ifdef SIGNCODE - $(SIGNCODE) $(INSTALLER) -endif # SIGNCODE -endif # CONFIG_WIN - # Add a dependency on the generated files, so that they are always # rebuilt before other object files ifneq ($(wildcard config-host.mak),)
meson.build +25 -0
@@ -1217,6 +1217,31 @@ if build_docs endif endif +if host_machine.system() == 'windows' + nsis_cmd = [ + find_program('scripts/nsis.py'), + '@OUTPUT@', + get_option('prefix'), + meson.current_source_dir(), + host_machine.cpu_family(), + '--', + '-DDISPLAYVERSION=' + meson.project_version(), + ] + if build_docs + nsis_cmd += '-DCONFIG_DOCUMENTATION=y' + endif + if 'CONFIG_GTK' in config_host + nsis_cmd += '-DCONFIG_GTK=y' + endif + + nsis = custom_target('nsis', + output: 'qemu-setup-' + meson.project_version() + '.exe', + input: files('qemu.nsi'), + build_always_stale: true, + command: nsis_cmd + ['@INPUT@']) + alias_target('installer', nsis) +endif + summary_info = {} summary_info += {'Install prefix': config_host['prefix']} summary_info += {'BIOS directory': config_host['qemu_datadir']}
scripts/nsis.py new file +78 -0
78 lines not on this page · raw message
Signature · 1 line
2.26.2
Re: [PATCH v2 5/5] meson: add NSIS building
Quoted 25 lines · On Tue, Aug 25, 2020 at 09:58:27PM +0400, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
Signed-off-by Marc-André Lureau <[email protected]>--- Makefile | 56 ----------------------------------- meson.build | 25 ++++++++++++++++ scripts/nsis.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 56 deletions(-) create mode 100644 scripts/nsis.pyscripts/nsis.py new file +9
-0@@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020 Red Hat, Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import argparse +import glob +import os
scripts/nsis.py line 19
Quoted 10 lines
scripts/nsis.py new file +10
-0+import shutil +import subprocess +import tempfile + + +def signcode(path): + cmd = os.environ.get("SIGNCODE") + if not cmd: + return + subprocess.run([cmd, path])
I know the existing makefile used $SIGNCODE env variable, but I can't help thinking it would be better to have it as a configure arg, and in turn a meson arg.
None the less, it isn't worse than what already exists so
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|