Skip to content

Commit 3d95cdb

Browse files
committed
Add build icon in executable and gate more linux stuff with meson
1 parent 6c644cb commit 3d95cdb

File tree

5 files changed

+52
-45
lines changed

5 files changed

+52
-45
lines changed

data/meson.build

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,53 @@ install_data (
55
rename: meson.project_name() + '.gschema.xml'
66
)
77

8-
#======== Internationalization ========
9-
#Translate and install our .desktop file
10-
i18n.merge_file(
11-
input: 'jorts.desktop.in',
12-
output: meson.project_name() + '.desktop',
13-
po_dir: meson.project_source_root() / 'po' / 'extra',
14-
type: 'desktop',
15-
install: true,
16-
install_dir: get_option('datadir') / 'applications'
17-
)
18-
19-
20-
# metainfo confuses windows
8+
# metainfo confuses windows, and icons are
219
if not windows_build
2210

23-
#Translate and install our .metainfo file
24-
i18n.merge_file(
25-
input: 'jorts.metainfo.xml.in',
26-
output: meson.project_name() + '.metainfo.xml',
27-
po_dir: meson.project_source_root() / 'po' / 'extra',
28-
install: true,
29-
install_dir: get_option('datadir') / 'metainfo'
30-
)
31-
32-
endif
11+
#======== Internationalization ========
12+
#Translate and install our .desktop file
13+
i18n.merge_file(
14+
input: 'jorts.desktop.in',
15+
output: meson.project_name() + '.desktop',
16+
po_dir: meson.project_source_root() / 'po' / 'extra',
17+
type: 'desktop',
18+
install: true,
19+
install_dir: get_option('datadir') / 'applications'
20+
)
3321

34-
#======== ICONS ========
22+
#======== Metainfo ========
23+
#Translate and install our .metainfo file
24+
i18n.merge_file(
25+
input: 'jorts.metainfo.xml.in',
26+
output: meson.project_name() + '.metainfo.xml',
27+
po_dir: meson.project_source_root() / 'po' / 'extra',
28+
install: true,
29+
install_dir: get_option('datadir') / 'metainfo'
30+
)
3531

36-
# Install our icons in all the required sizes
37-
# "variant" variable has been declared earlier in the base meson
38-
icon_sizes = ['16', '24', '32', '48', '64', '128']
32+
#======== ICONS ========
33+
# Install our icons in all the required sizes
34+
# "variant" variable has been declared earlier in the base meson
35+
icon_sizes = ['16', '24', '32', '48', '64', '128']
36+
37+
foreach i : icon_sizes
38+
install_data(
39+
'icons' / variant / 'hicolor' / i + '.png',
40+
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
41+
rename: meson.project_name() + '.png'
42+
)
43+
install_data(
44+
'icons' / variant / 'hicolor@2' / i + '@2.png',
45+
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
46+
rename: meson.project_name() + '.png'
47+
)
48+
endforeach
3949

40-
foreach i : icon_sizes
41-
install_data(
42-
'icons' / variant / 'hicolor' / i + '.png',
43-
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
44-
rename: meson.project_name() + '.png'
45-
)
4650
install_data(
47-
'icons' / variant / 'hicolor@2' / i + '@2.png',
48-
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
49-
rename: meson.project_name() + '.png'
51+
'icons' / variant / 'scalable.svg',
52+
install_dir: get_option('datadir') / 'icons' / 'scalable' / 'apps',
53+
rename: meson.project_name() + '.svg'
5054
)
51-
endforeach
5255

53-
install_data(
54-
'icons' / variant / 'scalable.svg',
55-
install_dir: get_option('datadir') / 'icons' / 'scalable' / 'apps',
56-
rename: meson.project_name() + '.svg'
57-
)
56+
endif
57+

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ dependencies = [
6767

6868
if windows_build
6969
dependencies += dependency('gio-windows-2.0')
70+
ico_src = import('windows').compile_resources('windows/icons/ico.rc', depends: windows/icons/icon.ico)
71+
7072
else
7173
dependencies += dependency('gio-unix-2.0')
7274
dependencies += dependency('libportal')

src/meson.build

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,22 @@ sources = files (
3030
'Application.vala',
3131
)
3232

33-
if not windows_build
33+
if windows_build
34+
sources += ico_src
35+
else
3436
sources += files('Utils' / 'Libportal.vala')
3537
endif
3638

3739
#================================
3840
# Let's define our executable
41+
# win_subsystem doesnt seem to bother standard builds
42+
3943
executable(
4044
meson.project_name(),
4145
gresource,
4246
config_file,
4347
sources,
4448
dependencies: dependencies,
45-
win_subsystem: 'windows',
49+
win_subsystem: 'windows',
4650
install : true
4751
)

windows/icons/ico.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
JORTS_ICON ICON "icon.ico"

windows/prep.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ pacman -S mingw-w64-libgee mingw-w64-gsettings-desktop-schemas
1313
pacman -S mingw-w64-x86_64-desktop-file-utils
1414
pacman -S mingw-w64-x86_64-gtk-elementary-theme mingw-w64-x86_64-elementary-icon-theme
1515
pacman -S mingw-w64-ucrt-x86_64-vala mingw-w64-x86_64-vala
16-
16+
pacman -S mingw-w64-x86_64-librsvg

0 commit comments

Comments
 (0)