Skip to contentSkip to conversation

meson: convert the remaining of install target

PATCH In review [email protected] 2 participants 9 messages Aug 26, 2020 – Aug 30, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover meson: convert the remaining of install target

From: Marc-André Lureau <[email protected]>

Hi,

A few patches to finish replacing the Makefile install target by meson.

Marc-André Lureau (6):
meson: install pc-bios blobs
meson: install scripts/qemu-trace-stap
meson: install icons
meson: install desktop file
meson: install $localstatedir/run for qga
build-sys: remove install target from Makefile

 Makefile             | 62 -------------------------------------------
 meson.build          |  1 +
 pc-bios/meson.build  | 63 ++++++++++++++++++++++++++++++++++++++++++++
 qga/meson.build      |  2 ++
 scripts/meson.build  |  3 +++
 ui/icons/meson.build | 13 +++++++++
 ui/meson.build       |  3 +++
 7 files changed, 85 insertions(+), 62 deletions(-)
 create mode 100644 scripts/meson.build
 create mode 100644 ui/icons/meson.build
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/6 meson: install pc-bios blobs

From: Marc-André Lureau <[email protected]>

---
 Makefile            | 31 ----------------------
 pc-bios/meson.build | 63 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 31 deletions(-)
Makefile +0 -31
index 81794d5c34..16b2ffa7fe 100644
@@ -229,32 +229,6 @@ distclean: clean ninja-distclean
 	rm -f linux-headers/asm
 	rm -Rf .sdk
 
-ifdef INSTALL_BLOBS
-BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
-vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
-vgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \
-openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
-pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
-pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
-efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
-efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
-efi-e1000e.rom efi-vmxnet3.rom \
-qemu-nsis.bmp \
-bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
-multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
-s390-ccw.img s390-netboot.img \
-slof.bin skiboot.lid \
-palcode-clipper \
-u-boot.e500 u-boot-sam460-20100605.bin \
-qemu_vga.ndrv \
-edk2-licenses.txt \
-hppa-firmware.img \
-opensbi-riscv32-generic-fw_dynamic.bin opensbi-riscv64-generic-fw_dynamic.bin \
-opensbi-riscv32-generic-fw_dynamic.elf opensbi-riscv64-generic-fw_dynamic.elf
-else
-BLOBS=
-endif
-
 install-datadir:
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
 
@@ -272,11 +246,6 @@ export DESTDIR
 install: all install-datadir install-localstatedir
 ifdef CONFIG_TRACE_SYSTEMTAP
 	$(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
-endif
-ifneq ($(BLOBS),)
-	set -e; for x in $(BLOBS); do \
-		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
-	done
 endif
 	for s in $(ICON_SIZES); do \
 		mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
pc-bios/meson.build +63 -0

68 lines not on this page · raw message

Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/6 meson: install scripts/qemu-trace-stap

In reply to [email protected]

From: Marc-André Lureau <[email protected]>

---
 Makefile            | 3 ---
 meson.build         | 1 +
 scripts/meson.build | 3 +++
 3 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 scripts/meson.build
Makefile +0 -3
index 16b2ffa7fe..058cf87f54 100644
@@ -244,9 +244,6 @@ ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
 # Needed by "meson install"
 export DESTDIR
 install: all install-datadir install-localstatedir
-ifdef CONFIG_TRACE_SYSTEMTAP
-	$(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
-endif
 	for s in $(ICON_SIZES); do \
 		mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
 		$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
meson.build +1 -0
index f0fe5f8799..6bd66243ee 100644
@@ -1123,6 +1123,7 @@ if have_tools
   endif
 endif
 
+subdir('scripts')
 subdir('tools')
 subdir('pc-bios')
 subdir('tests')
scripts/meson.build new file +3 -0
new file mode 100644
index 0000000000..e8cc63896d
@@ -0,0 +1,3 @@
+if 'CONFIG_TRACE_SYSTEMTAP' in config_host
+  install_data('qemu-trace-stap', install_dir: get_option('bindir'))
+endif
Signature · 1 line
2.26.2
#3 lore raw

PATCH 3/6 meson: install icons

In reply to [email protected]

From: Marc-André Lureau <[email protected]>

---
 Makefile             | 12 ------------
 ui/icons/meson.build | 13 +++++++++++++
 ui/meson.build       |  1 +
 3 files changed, 14 insertions(+), 12 deletions(-)
 create mode 100644 ui/icons/meson.build
Makefile +0 -12
index 058cf87f54..d1a3cd77a5 100644
@@ -239,22 +239,10 @@ ifeq ($(CONFIG_GUEST_AGENT),y)
 endif
 endif
 
-ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
 
 # Needed by "meson install"
 export DESTDIR
 install: all install-datadir install-localstatedir
-	for s in $(ICON_SIZES); do \
-		mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
-		$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
-			"$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
-	done; \
-	mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \
-	$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \
-		"$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
-	mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \
-	$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
-		"$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
 	mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
 	$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
 		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
ui/icons/meson.build new file +13 -0
new file mode 100644
index 0000000000..b6e21f6ad7
@@ -0,0 +1,13 @@
+foreach s: [16, 24, 32, 48, 64, 128, 256, 512]
+  s = '@0@x@0@'.format(s.to_string())
+  install_data('qemu_@[email protected]'.format(s),
+               rename: 'qemu.png',
+               install_dir: config_host['qemu_icondir'] / 'hicolor' / s / 'apps')
+endforeach
+
+install_data('qemu_32x32.bmp',
+             rename: 'qemu.bmp',
+             install_dir: config_host['qemu_icondir'] / 'hicolor' / '32x32' / 'apps')
+
+install_data('qemu.svg',
+             install_dir: config_host['qemu_icondir'] / 'hicolor' / 'scalable' / 'apps')
ui/meson.build +1 -0
index 018c5698bf..0b937e4455 100644
@@ -110,5 +110,6 @@ if have_system or xkbcommon.found()
 endif
 
 subdir('shader')
+subdir('icons')
 
 modules += {'ui': ui_modules}
Signature · 1 line
2.26.2
#4 lore raw

PATCH 4/6 meson: install desktop file

In reply to [email protected]

From: Marc-André Lureau <[email protected]>

---
 Makefile       | 3 ---
 ui/meson.build | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)
Makefile +0 -3
index d1a3cd77a5..dc3c20dd5e 100644
@@ -243,9 +243,6 @@ endif
 # Needed by "meson install"
 export DESTDIR
 install: all install-datadir install-localstatedir
-	mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
-	$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
-		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
 
 ifdef CONFIG_WIN32
ui/meson.build +2 -0
index 0b937e4455..e963c9e525 100644
@@ -112,4 +112,6 @@ endif
 subdir('shader')
 subdir('icons')
 
+install_data('qemu.desktop', install_dir: config_host['qemu_desktopdir'])
+
 modules += {'ui': ui_modules}
Signature · 1 line
2.26.2
#5 lore raw

PATCH 5/6 meson: install $localstatedir/run for qga

In reply to [email protected]

From: Marc-André Lureau <[email protected]>

---
 Makefile        | 10 +---------
 qga/meson.build |  2 ++
 2 files changed, 3 insertions(+), 9 deletions(-)
Makefile +1 -9
index dc3c20dd5e..9a9e7c0301 100644
@@ -232,17 +232,9 @@ distclean: clean ninja-distclean
 install-datadir:
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
 
-install-localstatedir:
-ifdef CONFIG_POSIX
-ifeq ($(CONFIG_GUEST_AGENT),y)
-	$(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
-endif
-endif
-
-
 # Needed by "meson install"
 export DESTDIR
-install: all install-datadir install-localstatedir
+install: all install-datadir
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
 
 ifdef CONFIG_WIN32
qga/meson.build +2 -0
index 3f28f74b52..e5c5778a3e 100644
@@ -82,6 +82,8 @@ if targetos == 'windows'
     all_qga += [qga_msi]
     alias_target('msi', qga_msi)
   endif
+else
+  install_subdir('run', install_dir: get_option('localstatedir'))
 endif
 
 alias_target('qemu-ga', all_qga)
Signature · 1 line
2.26.2
#6 lore raw

Re: [PATCH 5/6] meson: install $localstatedir/run for qga

qga/meson.build if targetos == 'windows' · line 87

Quoted 11 lines · On 26/08/20 15:06, [email protected] wrote:
qga/meson.build +2 -0
index 3f28f74b52..e5c5778a3e 100644
@@ -82,6 +82,8 @@ if targetos == 'windows'
     all_qga += [qga_msi]
     alias_target('msi', qga_msi)
   endif
+else
+  install_subdir('run', install_dir: get_option('localstatedir'))
 endif

This doesn't work if /var/run exists and is a symlink:

Installing subdir /home/pbonzini/ff/run to /home/pbonzini/ff/build/test/var/local/run Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/mesonbuild/mesonmain.py", line 131, in run
return options.run_func(options)
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 538, in run
installer.do_install(datafilename)
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 357, in do_install
self.install_subdirs(d) # Must be first, because it needs to delete the old subtree.
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 383, in install_subdirs
d.dirmaker.makedirs(full_dst_dir, exist_ok=True)
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 60, in makedirs
os.makedirs(path, exist_ok=exist_ok)
File "/usr/lib64/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/home/pbonzini/ff/build/test/var/local/run'

Since DESTDIR is not available, there isn't really a good way to do this check. We can:

- keep the makefile

- use an install script

- create it in qemu-ga just like on win32

Probably the last one is the best.

Paolo

#7 lore raw

Re: [PATCH 5/6] meson: install $localstatedir/run for qga

Quoted 17 lines · Paolo Bonzini

This doesn't work if /var/run exists and is a symlink:

Installing subdir /home/pbonzini/ff/run to /home/pbonzini/ff/build/test/var/local/run Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/mesonbuild/mesonmain.py", line 131, in run
return options.run_func(options)
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 538, in run
installer.do_install(datafilename)
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 357, in do_install
self.install_subdirs(d) # Must be first, because it needs to delete the old subtree.
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 383, in install_subdirs
d.dirmaker.makedirs(full_dst_dir, exist_ok=True)
File "/usr/lib/python3.8/site-packages/mesonbuild/minstall.py", line 60, in makedirs
os.makedirs(path, exist_ok=exist_ok)
File "/usr/lib64/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/home/pbonzini/ff/build/test/var/local/run'

Nevermind, it works in 0.55.1. I'll do a few more tests just to be sure, but I've queued the series.

Paolo

#8 lore raw

PATCH 6/6 build-sys: remove install target from Makefile

In reply to [email protected]

From: Marc-André Lureau <[email protected]>

Now covered by meson

---
 Makefile | 5 -----
 1 file changed, 5 deletions(-)
Makefile +0 -5
index 9a9e7c0301..75db8be52e 100644
@@ -229,13 +229,8 @@ distclean: clean ninja-distclean
 	rm -f linux-headers/asm
 	rm -Rf .sdk
 
-install-datadir:
-	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
-
 # Needed by "meson install"
 export DESTDIR
-install: all install-datadir
-	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
 
 ifdef CONFIG_WIN32
 
Signature · 1 line
2.26.2