meson: add icons

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2024-10-25 14:48:27 +02:00 committed by Pavel Hrdina
parent dd909f20bc
commit 2abd3e7565
24 changed files with 152 additions and 19 deletions

View File

@ -0,0 +1,8 @@
icons = files(
'icon_console.png',
'vm_new.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '16x16', 'cat': 'actions'}
endforeach

View File

@ -0,0 +1,7 @@
icons = files(
'virt-manager.png'
)
foreach icon : icons
install_icons += {'file': icon, 'size': '16x16', 'cat': 'apps'}
endforeach

View File

@ -0,0 +1,2 @@
subdir('actions')
subdir('apps')

View File

@ -0,0 +1,9 @@
icons = files(
'icon_console.png',
'icon_details.png',
'vm_new.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '22x22', 'cat': 'actions'}
endforeach

View File

@ -0,0 +1,7 @@
icons = files(
'virt-manager.png'
)
foreach icon : icons
install_icons += {'file': icon, 'size': '22x22', 'cat': 'apps'}
endforeach

View File

@ -0,0 +1,11 @@
icons = files(
'device_cpu.png',
'device_mem.png',
'device_pci.png',
'device_serial.png',
'device_usb.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '22x22', 'cat': 'devices'}
endforeach

View File

@ -0,0 +1,4 @@
subdir('actions')
subdir('apps')
subdir('devices')
subdir('status')

View File

@ -0,0 +1,9 @@
icons = files(
'state_paused.png',
'state_running.png',
'state_shutoff.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '22x22', 'cat': 'status'}
endforeach

View File

@ -0,0 +1,9 @@
icons = files(
'icon_console.png',
'vm_clone_wizard.png',
'vm_new.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '24x24', 'cat': 'actions'}
endforeach

View File

@ -0,0 +1,7 @@
icons = files(
'virt-manager.png'
)
foreach icon : icons
install_icons += {'file': icon, 'size': '24x24', 'cat': 'apps'}
endforeach

View File

@ -0,0 +1,2 @@
subdir('actions')
subdir('apps')

View File

@ -0,0 +1,7 @@
icons = files(
'virt-manager.png'
)
foreach icon : icons
install_icons += {'file': icon, 'size': '256x256', 'cat': 'apps'}
endforeach

View File

@ -0,0 +1 @@
subdir('apps')

View File

@ -0,0 +1,8 @@
icons = files(
'icon_console.png',
'vm_new.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '32x32', 'cat': 'actions'}
endforeach

View File

@ -0,0 +1,7 @@
icons = files(
'virt-manager.png'
)
foreach icon : icons
install_icons += {'file': icon, 'size': '32x32', 'cat': 'apps'}
endforeach

View File

@ -0,0 +1,3 @@
subdir('actions')
subdir('apps')
subdir('status')

View File

@ -0,0 +1,9 @@
icons = files(
'state_paused.png',
'state_running.png',
'state_shutoff.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '32x32', 'cat': 'status'}
endforeach

View File

@ -0,0 +1,10 @@
icons = files(
'vm_clone_wizard.png',
'vm_delete_wizard.png',
'vm_import_wizard.png',
'vm_new_wizard.png',
)
foreach icon : icons
install_icons += {'file': icon, 'size': '48x48', 'cat': 'actions'}
endforeach

View File

@ -0,0 +1,7 @@
icons = files(
'virt-manager.png'
)
foreach icon : icons
install_icons += {'file': icon, 'size': '48x48', 'cat': 'apps'}
endforeach

View File

@ -0,0 +1,2 @@
subdir('actions')
subdir('apps')

20
data/icons/meson.build Normal file
View File

@ -0,0 +1,20 @@
install_icons = []
subdir('16x16')
subdir('22x22')
subdir('24x24')
subdir('32x32')
subdir('48x48')
subdir('256x256')
foreach icon : install_icons
if icon['cat'] == 'apps'
icon_dir = datadir / 'icons' / 'hicolor' / icon['size'] / 'apps'
else
icon_dir = pkgdir / 'icons' / 'hicolor' / icon['size'] / icon['cat']
endif
install_data(
icon['file'],
install_dir: icon_dir,
)
endforeach

View File

@ -17,3 +17,5 @@ foreach script: ['virt-install', 'virt-clone', 'virt-xml']
install_dir: datadir / 'bash-completion' / 'completions',
)
endforeach
subdir('icons')

View File

@ -8,6 +8,7 @@ python3 = python.find_installation('python3')
prefix = get_option('prefix')
datadir = prefix / get_option('datadir')
pkgdir = datadir / 'virt-manager'
# figure out if we are building from git
git = run_command('test', '-e', '.git', check: false).returncode() == 0

View File

@ -160,27 +160,8 @@ from %(pkgname)s import %(filename)s
make_script("virtManager", "virtmanager", "virt-manager")
def _build_icons(self):
for size in glob.glob(os.path.join("data/icons", "*")):
for category in glob.glob(os.path.join(size, "*")):
icons = []
for icon in glob.glob(os.path.join(category, "*")):
icons.append(icon)
if not icons:
continue
category = os.path.basename(category)
dest = ("share/icons/hicolor/%s/%s" %
(os.path.basename(size), category))
if category != "apps":
dest = dest.replace("share/", "share/virt-manager/")
self.distribution.data_files.append((dest, icons))
def run(self):
self._make_bin_wrappers()
self._build_icons()
self.run_command("build_i18n")
super().run()