Skip to content

Commit c9b58b5

Browse files
committed
Refactoring build system
1 parent d6c9875 commit c9b58b5

File tree

5 files changed

+96
-43
lines changed

5 files changed

+96
-43
lines changed

data/meson.build

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,22 @@ compiled_ui_stamp = custom_target(
2828
command: ['touch', '@OUTPUT@'],
2929
)
3030

31-
css_copy = configure_file(input: 'ssh-studio.css', output: 'ssh-studio.css', copy: true)
32-
icon_256_copy = configure_file(input: 'media/icon_256.png', output: 'icon_256.png', copy: true)
33-
icon_128_copy = configure_file(input: 'media/icon_128.png', output: 'icon_128.png', copy: true)
31+
css_copy = configure_file(
32+
input: 'ssh-studio.css',
33+
output: 'ssh-studio.css',
34+
copy: true
35+
)
36+
37+
configure_file(
38+
input: 'media/icon_256.png',
39+
output: 'icon_256.png',
40+
copy: true
41+
)
42+
configure_file(
43+
input: 'media/icon_128.png',
44+
output: 'icon_128.png',
45+
copy: true
46+
)
3447

3548
gnome.compile_resources('ssh-studio-resources',
3649
'ssh-studio.gresource.xml',
@@ -39,6 +52,3 @@ gnome.compile_resources('ssh-studio-resources',
3952
gresource_bundle: true,
4053
install: true,
4154
install_dir: join_paths(get_option('datadir'), application_id))
42-
43-
install_data('io.github.BuddySirJava.SSH-Studio.metainfo.xml',
44-
install_dir: join_paths(get_option('datadir'), 'metainfo'))

io.github.BuddySirJava.SSH-Studio.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@
1010
"--socket=wayland",
1111
"--share=network",
1212
"--filesystem=~/.ssh:rw",
13-
"--socket=ssh-auth",
14-
"--talk-name=org.freedesktop.Flatpak",
15-
"--socket=session-bus",
16-
"--device=dri",
17-
"--share=ipc",
18-
"filesystem=home"
19-
],
13+
"--socket=ssh-auth"
14+
],
2015
"cleanup" : [
2116
"/include",
2217
"/lib/pkgconfig",
@@ -55,7 +50,7 @@
5550
"type" : "git",
5651
"url" : "https://github.com/BuddySirJava/SSH-Studio.git",
5752
"tag" : "1.3.1",
58-
"commit" : "528e5c0e207c63b9ead2adf3f169316950ee81af",
53+
"commit" : "9e3d73ccd0bdbdb26f56e1ff114a85523305bc30",
5954
"x-checker-data" : {
6055
"type" : "git",
6156
"tag-pattern" : "^v([\\d.]+)$"

meson.build

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ project('ssh-studio', 'c',
22
version: '1.3.1',
33
license: 'GPL-3.0-or-later',
44
meson_version: '>= 0.60.0',
5-
default_options: ['warning_level=2',
6-
'buildtype=debugoptimized'])
7-
5+
default_options: [
6+
'warning_level=2',
7+
'buildtype=debugoptimized',
8+
'python.install_env=auto',
9+
'python.platlibdir='
10+
])
811

912
python = import('python')
10-
python_installation = python.find_installation()
13+
python_installation = python.find_installation('python3', required: true)
1114

1215
gnome = import('gnome')
1316

@@ -22,24 +25,45 @@ subdir('src')
2225

2326
subdir('data')
2427

25-
install_data(join_paths(meson.current_source_dir(), 'data', application_id + '.desktop'),
26-
install_dir: join_paths(get_option('datadir'), 'applications'))
27-
28-
install_data(join_paths(meson.current_source_dir(), 'data', 'ssh-studio.in'),
29-
rename: 'ssh-studio',
30-
install_mode: 'rwxr-xr-x',
31-
install_dir: join_paths(get_option('bindir')))
32-
33-
install_data(join_paths(meson.current_source_dir(), 'data', 'media', 'icon_256.png'),
34-
rename: application_id + '.png',
35-
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', '256x256', 'apps'))
36-
install_data(join_paths(meson.current_source_dir(), 'data', 'media', 'icon_128.png'),
37-
rename: application_id + '.png',
38-
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', '128x128', 'apps'))
39-
install_data(join_paths(meson.current_source_dir(), 'data', 'media', 'icon_512.png'),
40-
rename: application_id + '.png',
41-
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', '512x512', 'apps'))
42-
install_data(join_paths(meson.current_source_dir(), 'data', 'media', 'icon.svg'),
43-
rename: application_id + '.svg',
44-
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'))
28+
if get_option('install_desktop_file')
29+
install_data(
30+
join_paths(meson.current_source_dir(), 'data', application_id + '.desktop'),
31+
install_dir: join_paths(get_option('datadir'), 'applications')
32+
)
33+
endif
34+
35+
install_data(
36+
join_paths(meson.current_source_dir(), 'data', 'ssh-studio.in'),
37+
rename: 'ssh-studio',
38+
install_mode: 'rwxr-xr-x',
39+
install_dir: join_paths(get_option('bindir'))
40+
)
41+
42+
if get_option('install_icons')
43+
icon_sizes = ['128', '256', '512']
44+
icon_extensions = ['png', 'png', 'png']
45+
46+
foreach i : range(icon_sizes.length())
47+
size = icon_sizes[i]
48+
ext = icon_extensions[i]
49+
install_data(
50+
join_paths(meson.current_source_dir(), 'data', 'media', 'icon_' + size + '.' + ext),
51+
rename: application_id + '.' + ext,
52+
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', size + 'x' + size, 'apps')
53+
)
54+
endforeach
55+
56+
install_data(
57+
join_paths(meson.current_source_dir(), 'data', 'media', 'icon.svg'),
58+
rename: application_id + '.svg',
59+
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps')
60+
)
61+
endif
62+
63+
if get_option('install_metainfo')
64+
install_data(
65+
join_paths(meson.current_source_dir(), 'data', application_id + '.metainfo.xml'),
66+
install_dir: join_paths(get_option('datadir'), 'metainfo')
67+
)
68+
endif
4569

meson_options.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
option('package_for_flatpak',
2+
type: 'boolean',
3+
value: false,
4+
description: 'Optimize build for Flatpak packaging'
5+
)
6+
7+
option('package_for_appimage',
8+
type: 'boolean',
9+
value: false,
10+
description: 'Optimize build for AppImage packaging'
11+
)
12+
13+
option('install_icons',
14+
type: 'boolean',
15+
value: true,
16+
description: 'Install application icons'
17+
)
18+
19+
option('install_desktop_file',
20+
type: 'boolean',
21+
value: true,
22+
description: 'Install desktop file'
23+
)
24+
25+
option('install_metainfo',
26+
type: 'boolean',
27+
value: true,
28+
description: 'Install metainfo file'
29+
)

src/meson.build

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,3 @@ python_installation.install_sources(
2222
['ui/host_editor.py', 'ui/host_list.py', 'ui/main_window.py', 'ui/preferences_dialog.py', 'ui/test_connection_dialog.py', 'ui/ssh_key_manager_dialog.py', 'ui/generate_key_dialog.py', 'ui/key_picker_dialog.py', 'ui/keyboard_shortcuts_dialog.py', 'ui/welcome_view.py', 'ui/__init__.py'],
2323
subdir: 'ssh_studio/ui'
2424
)
25-
26-
python_installation.install_sources(
27-
[],
28-
subdir: 'ssh_studio/ui'
29-
)

0 commit comments

Comments
 (0)