Skip to content

Commit fd72295

Browse files
committed
add blueprint templates, fix meson build
1 parent bd80d58 commit fd72295

21 files changed

+466
-328
lines changed

.github/workflows/build-flatpak.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
- uses: actions/checkout@v2
1515
- uses: bilelmoussaoui/flatpak-github-actions@v2
1616
with:
17-
bundle: "com.ranfdev.GeopardDevel.flatpak"
18-
manifest-path: "build-aux/com.ranfdev.GeopardDevel.json"
17+
bundle: "com.ranfdev.Geopard.Devel.flatpak"
18+
manifest-path: "build-aux/com.ranfdev.Geopard.Devel.json"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
/result
33
_build/
4+
subprojects/blueprint-compiler

build-aux/cargo.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"app-id" : "com.ranfdev.GeopardDevel",
3-
"runtime" : "org.gnome.Platform",
4-
"runtime-version" : "master",
2+
"app-id" : "com.ranfdev.Geopard.Devel",
3+
"runtime" : "org.gnome.Sdk",
4+
"runtime-version" : "42",
55
"sdk" : "org.gnome.Sdk",
66
"sdk-extensions" : [
77
"org.freedesktop.Sdk.Extension.rust-stable"
@@ -21,13 +21,10 @@
2121
"build-args" : [
2222
"--share=network"
2323
],
24-
"env" : {
25-
"RUSTFLAGS" : "--remap-path-prefix =../",
26-
"CARGO_HOME" : "/run/build/Geopard/cargo"
27-
}
24+
"env" : { }
2825
},
2926
"modules" : [
30-
{
27+
{
3128
"name" : "libsass",
3229
"cleanup" : [
3330
"*"
@@ -93,12 +90,10 @@
9390
],
9491
"sources" : [
9592
{
96-
"type" : "git",
97-
"url" : "../",
98-
"branch" : "master"
93+
"type" : "dir",
94+
"url" : "../"
9995
}
10096
]
10197
}
10298
]
10399
}
104-

build-aux/meson_post_install.py

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<schemalist>
3+
<schema path="/com/ranfdev/Geopard/" id="@app-id@" gettext-domain="@gettext-package@">
4+
<key name="window-width" type="i">
5+
<default>600</default>
6+
<summary>Window width</summary>
7+
</key>
8+
<key name="window-height" type="i">
9+
<default>400</default>
10+
<summary>Window height</summary>
11+
</key>
12+
<key name="is-maximized" type="b">
13+
<default>false</default>
14+
<summary>Window maximized state</summary>
15+
</key>
16+
</schema>
17+
</schemalist>

data/icons/hicolor/scalable/apps/com.ranfdev.GeopardDevel.svg renamed to data/icons/hicolor/scalable/apps/com.ranfdev.Geopard.Devel.svg

File renamed without changes.

data/meson.build

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
subdir('icons')
2+
subdir('resources')
23
# Desktop file
34
desktop_conf = configuration_data()
45
desktop_conf.set('icon', application_id)
@@ -21,7 +22,8 @@ if desktop_file_validate.found()
2122
desktop_file_validate,
2223
args: [
2324
desktop_file.full_path()
24-
]
25+
],
26+
depends: desktop_file,
2527
)
2628
endif
2729

@@ -46,7 +48,29 @@ if appstream_util.found()
4648
'validate-appdata', appstream_util,
4749
args: [
4850
'validate', '--nonet', appdata_file.full_path()
49-
]
51+
],
52+
depends: appdata_file,
5053
)
5154
endif
5255

56+
# GSchema
57+
gschema_conf = configuration_data()
58+
gschema_conf.set('app-id', application_id)
59+
gschema_conf.set('gettext-package', gettext_package)
60+
configure_file(
61+
input: '@[email protected]'.format(base_id),
62+
output: '@[email protected]'.format(application_id),
63+
configuration: gschema_conf,
64+
install: true,
65+
install_dir: datadir / 'glib-2.0' / 'schemas'
66+
)
67+
68+
# Validata GSchema
69+
if glib_compile_schemas.found()
70+
test(
71+
'validate-gschema', glib_compile_schemas,
72+
args: [
73+
'--strict', '--dry-run', meson.current_build_dir()
74+
],
75+
)
76+
endif

data/resources/meson.build

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
blueprints = custom_target('blueprints',
2+
input: files(
3+
'ui/window.blp',
4+
'ui/shortcuts.blp'
5+
),
6+
output: '.',
7+
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
8+
)
9+
10+
resources = gnome.compile_resources(
11+
'resources',
12+
'resources.gresource.xml',
13+
gresource_bundle: true,
14+
source_dir: meson.current_build_dir(),
15+
install: true,
16+
dependencies: blueprints,
17+
install_dir: pkgdatadir,
18+
)
19+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<gresources>
3+
<gresource prefix="/com/ranfdev/Geopard/">
4+
<!-- see https://gtk-rs.org/gtk4-rs/git/docs/gtk4/struct.Application.html#automatic-resources -->
5+
<file compressed="true" preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">ui/shortcuts.ui</file>
6+
<file compressed="true" preprocess="xml-stripblanks">ui/window.ui</file>
7+
</gresource>
8+
</gresources>

0 commit comments

Comments
 (0)