Skip to content

Commit 5989dde

Browse files
authored
Add development profile/manifest (#159)
1 parent dff12ca commit 5989dde

23 files changed

+186
-100
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ cd Workbench
8686
git submodule update
8787
```
8888

89+
Also make sure that you're building the development target (`re.sonny.Workbench.Devel`).
90+
8991
Feel free to come by [#workbench:matrix.org](https://matrix.to/#/#workbench:matrix.org).
9092

9193
## Packaging

data/re.sonny.Workbench.desktop renamed to data/app.desktop

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Exec=workbench %U
66
Terminal=false
77
Type=Application
88
Categories=WebDevelopment;Development;IDE;GNOME;GTK;
9-
Icon=re.sonny.Workbench
9+
Icon=@app_id@
1010
# TRANSLATORS: Don't translate
1111
Keywords=CSS;JavaScript;GJS;Blueprint;builder;Vala;
1212
DBusActivatable=true

data/re.sonny.Workbench.gschema.xml renamed to data/app.gschema.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
2-
<schemalist gettext-domain="re.sonny.Workbench">
3-
<schema id="re.sonny.Workbench" path="/re/sonny/Workbench/">
2+
<schemalist gettext-domain="@app_id@">
3+
<schema id="@app_id@" path="/re/sonny/Workbench/">
44
<key name="color-scheme" type="i">
55
<default>0</default>
66
</key>

data/re.sonny.Workbench.metainfo.xml renamed to data/app.metainfo.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<component type="desktop">
3-
<id>re.sonny.Workbench</id>
4-
<launchable type="desktop-id">re.sonny.Workbench.desktop</launchable>
3+
<id>@app_id@</id>
4+
<launchable type="desktop-id">@app_id@.desktop</launchable>
55
<name translatable="no">Workbench</name>
66
<developer_name translatable="no">Sonny Piers</developer_name>
77
<update_contact>[email protected]</update_contact>
88
<metadata_license>CC0-1.0</metadata_license>
99
<project_license>GPL-3.0</project_license>
1010
<summary>Learn and prototype with GNOME technologies</summary>
11-
<translation type="gettext">re.sonny.Workbench</translation>
11+
<translation type="gettext">@app_id@</translation>
1212
<description>
1313
<p>Workbench goal is to let you experiment with GNOME technologies, no matter if tinkering for the first time or building and testing a GTK user interface.</p>
1414
<p>Among other things, Workbench comes with</p>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[D-BUS Service]
2-
Name=re.sonny.Workbench
2+
Name=@app_id@
33
Exec=@bindir@/workbench --gapplication-service

data/meson.build

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
desktop_file = i18n.merge_file(
2-
input: 're.sonny.Workbench.desktop',
3-
output: 're.sonny.Workbench.desktop',
2+
input: configure_file(
3+
input: 'app.desktop',
4+
output: 'tmp.app.desktop',
5+
configuration: { 'app_id': app_id }
6+
),
7+
output: '@[email protected]'.format(app_id),
48
type: 'desktop',
59
po_dir: '../po',
610
install: true,
@@ -15,19 +19,21 @@ if desktop_utils.found()
1519
endif
1620

1721
appstream_file = i18n.merge_file(
18-
input: 're.sonny.Workbench.metainfo.xml',
19-
output: 're.sonny.Workbench.metainfo.xml',
22+
input: configure_file(
23+
input: 'app.metainfo.xml',
24+
output: 'tmp.app.metainfo.xml',
25+
configuration: { 'app_id': app_id }
26+
),
27+
output: '@[email protected]'.format(app_id),
2028
po_dir: '../po',
2129
install: true,
2230
install_dir: join_paths(get_option('datadir'), 'metainfo')
2331
)
2432

25-
service_conf = configuration_data()
26-
service_conf.set('bindir', bindir)
2733
configure_file(
28-
input: 're.sonny.Workbench.service',
29-
output: 're.sonny.Workbench.service',
30-
configuration: service_conf,
34+
input: 'app.service',
35+
output: '@0@.service'.format(app_id),
36+
configuration: { 'app_id': app_id, 'bindir': bindir },
3137
install_dir: join_paths(get_option('datadir'), 'dbus-1/services')
3238
)
3339

@@ -38,7 +44,10 @@ if appstream_util.found()
3844
)
3945
endif
4046

41-
install_data('re.sonny.Workbench.gschema.xml',
47+
configure_file(
48+
input: 'app.gschema.xml',
49+
output: '@[email protected]'.format(app_id),
50+
configuration: { 'app_id': app_id },
4251
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
4352
)
4453

@@ -49,4 +58,4 @@ if compile_schemas.found()
4958
)
5059
endif
5160

52-
install_subdir('icons/', install_dir : join_paths(get_option('datadir')))
61+
install_subdir('icons/hicolor', install_dir : join_paths(get_option('datadir'), 'icons'))

meson.build

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project('re.sonny.Workbench', ['vala', 'c'],
1+
project('Workbench', ['vala', 'c'],
22
version: '43.0',
33
meson_version: '>= 0.59.0',
44
license: 'GPL-3.0-only'
@@ -7,11 +7,23 @@ project('re.sonny.Workbench', ['vala', 'c'],
77
gnome = import('gnome')
88
i18n = import('i18n')
99

10-
application_id = meson.project_name()
10+
if get_option('profile') == 'development'
11+
app_id = 're.sonny.Workbench.Devel'
12+
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
13+
if vcs_tag == ''
14+
version_suffix = '-devel'
15+
else
16+
version_suffix = '-@0@'.format (vcs_tag)
17+
endif
18+
else
19+
app_id = 're.sonny.Workbench'
20+
version_suffix = ''
21+
endif
22+
1123
prefix = get_option('prefix')
1224
bindir = join_paths(prefix, 'bin')
1325
datadir = join_paths(prefix, get_option('datadir'))
14-
pkgdatadir = join_paths(datadir, application_id)
26+
pkgdatadir = join_paths(datadir, app_id)
1527

1628
subdir('data')
1729
subdir('src')

meson_options.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
option(
2+
'profile',
3+
type: 'combo',
4+
choices: [
5+
'default',
6+
'development'
7+
],
8+
value: 'default'
9+
)

po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
i18n.gettext(application_id, preset: 'glib', args: ['--no-wrap'])
1+
i18n.gettext(app_id, preset: 'glib', args: ['--no-wrap'])

re.sonny.Workbench.Devel.json

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"app-id": "re.sonny.Workbench.Devel",
3+
"runtime": "org.gnome.Sdk",
4+
"runtime-version": "43",
5+
"sdk": "org.gnome.Sdk",
6+
"command": "workbench",
7+
"finish-args": [
8+
"--share=ipc",
9+
"--socket=fallback-x11",
10+
"--socket=wayland",
11+
"--device=dri",
12+
"--socket=session-bus",
13+
"--share=network"
14+
],
15+
"modules": [
16+
{
17+
"name": "vte",
18+
"buildsystem": "meson",
19+
"config-opts": [
20+
"-Ddocs=false",
21+
"-Dgtk3=false",
22+
"-Dgtk4=true",
23+
"-Dvapi=false",
24+
"-Dglade=false"
25+
],
26+
"sources": [
27+
{
28+
"type": "git",
29+
"url": "https://gitlab.gnome.org/GNOME/vte.git",
30+
"commit": "ae4a5d7df9e32ab40ceca5e06240561e819db148",
31+
"tag": "0.70.0"
32+
}
33+
]
34+
},
35+
{
36+
"name": "libportal",
37+
"buildsystem": "meson",
38+
"config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"],
39+
"sources": [
40+
{
41+
"type": "archive",
42+
"url": "https://github.com/flatpak/libportal/releases/download/0.6/libportal-0.6.tar.xz",
43+
"sha256": "88a12c3ba71bc31acff7238c280de697d609cebc50830c3766776ec35abc6566"
44+
}
45+
]
46+
},
47+
{
48+
"name": "blueprint-compiler",
49+
"buildsystem": "meson",
50+
"builddir": true,
51+
"sources": [
52+
{
53+
"type": "dir",
54+
"path": "./blueprint-compiler"
55+
}
56+
]
57+
},
58+
{
59+
"name": "Workbench",
60+
"buildsystem": "meson",
61+
"builddir": true,
62+
"config-opts": ["-Dprofile=development"],
63+
"sources": [
64+
{
65+
"type": "dir",
66+
"path": "."
67+
}
68+
]
69+
}
70+
]
71+
}

re.sonny.Workbench.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "re.sonny.Workbench",
2+
"app-id": "re.sonny.Workbench",
33
"runtime": "org.gnome.Sdk",
44
"runtime-version": "43",
55
"sdk": "org.gnome.Sdk",
@@ -12,7 +12,6 @@
1212
"--socket=session-bus",
1313
"--share=network"
1414
],
15-
"x-run-args": [],
1615
"modules": [
1716
{
1817
"name": "vte",
@@ -51,19 +50,23 @@
5150
"builddir": true,
5251
"sources": [
5352
{
54-
"type": "dir",
55-
"path": "./blueprint-compiler"
53+
"type": "git",
54+
"url": "https://gitlab.gnome.org/sonny/blueprint-compiler",
55+
"commit": "592ed7acab26f1633c03b0cd703a9cf2b7f09cb9"
5656
}
5757
]
5858
},
5959
{
6060
"name": "Workbench",
6161
"buildsystem": "meson",
6262
"builddir": true,
63+
"config-opts": ["-Dprofile=default"],
6364
"sources": [
6465
{
65-
"type": "dir",
66-
"path": "."
66+
"type": "git",
67+
"url": "https://github.com/sonnyp/Workbench.git",
68+
"tag": "v43.0",
69+
"commit": "dff12cab700f452601b23e4cafbbb4c24d610946"
6770
}
6871
]
6972
}

src/PanelUI.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import WorkbenchHoverProvider from "./WorkbenchHoverProvider.js";
2121

2222
const { addSignalMethods } = imports.signals;
2323

24-
export default function PanelUI({ builder, data_dir, version, term_console }) {
24+
const SYSLOG_IDENTIFIER = pkg.name;
25+
26+
export default function PanelUI({ builder, data_dir, term_console }) {
2527
let lang;
2628

2729
const panel = {
@@ -162,8 +164,8 @@ export default function PanelUI({ builder, data_dir, version, term_console }) {
162164
await blueprint.request("initialize", {
163165
processId: getPid(),
164166
clientInfo: {
165-
name: "re.sonny.Workbench",
166-
version,
167+
name: pkg.name,
168+
version: pkg.version,
167169
},
168170
// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities
169171
capabilities: {
@@ -224,14 +226,14 @@ export default function PanelUI({ builder, data_dir, version, term_console }) {
224226
function logBlueprintError(err) {
225227
GLib.log_structured("Blueprint", GLib.LogLevelFlags.LEVEL_CRITICAL, {
226228
MESSAGE: `${err.message}`,
227-
SYSLOG_IDENTIFIER: "re.sonny.Workbench",
229+
SYSLOG_IDENTIFIER,
228230
});
229231
}
230232

231233
// function logBlueprintInfo(info) {
232234
// GLib.log_structured("Blueprint", GLib.LogLevelFlags.LEVEL_WARNING, {
233235
// MESSAGE: `${info.line + 1}:${info.col} ${info.message}`,
234-
// SYSLOG_IDENTIFIER: "re.sonny.Workbench",
236+
// SYSLOG_IDENTIFIER,
235237
// });
236238
// }
237239

@@ -242,7 +244,7 @@ function logBlueprintDiagnostic({ range, message, severity }) {
242244
}:${range.start.character} to ${range.end.line + 1}:${
243245
range.end.character
244246
} ${message}`,
245-
SYSLOG_IDENTIFIER: "re.sonny.Workbench",
247+
SYSLOG_IDENTIFIER,
246248
});
247249
}
248250

src/about.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from "./troll/src/util.js";
1111
import { getFlatpakInfo } from "./util.js";
1212

13-
export default function About({ application, version }) {
13+
export default function About({ application }) {
1414
const flatpak_info = getFlatpakInfo();
1515

1616
const debug_info = `
@@ -30,11 +30,11 @@ ${getBlueprintVersion()}
3030
developer_name: "Sonny Piers",
3131
copyright: "Copyright 2022 Sonny Piers",
3232
license_type: Gtk.License.GPL_3_0_ONLY,
33-
version,
33+
version: pkg.version,
3434
transient_for: application.get_active_window(),
3535
modal: true,
3636
website: "https://workbench.sonny.re",
37-
application_icon: "re.sonny.Workbench",
37+
application_icon: pkg.name,
3838
issue_url: "https://github.com/sonnyp/Workbench/issues",
3939
// TRANSLATORS: eg. 'Translator Name <[email protected]>' or 'Translator Name https://website.example'
4040
translator_credits: _("translator-credits"),

src/actions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import About from "./about.js";
1010
import shortcutsWindow from "./shortcutsWindow.js";
1111
import { portal, languages, settings } from "./util.js";
1212

13-
export default function Actions({ application, version }) {
13+
export default function Actions({ application }) {
1414
const quit = new Gio.SimpleAction({
1515
name: "quit",
1616
parameter_type: null,
@@ -26,7 +26,7 @@ export default function Actions({ application, version }) {
2626
parameter_type: null,
2727
});
2828
showAboutDialog.connect("activate", () => {
29-
About({ application, version });
29+
About({ application });
3030
});
3131
application.add_action(showAboutDialog);
3232

File renamed without changes.

0 commit comments

Comments
 (0)