-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Meson: Support separate development/release profiles (#44)
* Devel: add separate profile, use icon * Workflows: only use Devel manifest * Meson: bump minimum Meson version * Use `devel` as profile name, add CSS class
- Loading branch information
1 parent
cb4ed9e
commit cd66fe6
Showing
14 changed files
with
113 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gresources> | ||
<gresource prefix="/com/cassidyjames/butler/"> | ||
<file preprocess="xml-stripblanks">metainfo.xml</file> | ||
<file>style.css</file> | ||
</gresource> | ||
<gresource prefix="/com/cassidyjames/butler/icons/scalable/actions/"> | ||
<file alias="app.svg">icons/app.svg</file> | ||
<file preprocess="xml-stripblanks" compressed="true">metainfo.xml.in</file> | ||
<file alias="Devel/style.css">style.css</file> | ||
</gresource> | ||
</gresources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[Desktop Entry] | ||
Name=Butler | ||
Name=@app_name@ | ||
GenericName=Smart Home Dashboard | ||
Comment=Control your smart home | ||
Categories=Network;GTK; | ||
Exec=com.cassidyjames.butler | ||
Icon=com.cassidyjames.butler | ||
Exec=@app_id@ | ||
Icon=@app_id@ | ||
Terminal=false | ||
Type=Application | ||
X-GNOME-Gettext-Domain=com.cassidyjames.butler | ||
X-GNOME-Gettext-Domain=@app_id@ | ||
Keywords=hass;home;assistant;smart;lights; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,51 @@ | ||
data_config = configuration_data() | ||
data_config.set('app_id', app_id) | ||
data_config.set('app_name', app_name) | ||
|
||
install_data( | ||
'icons' / 'app.svg', | ||
'icons' / profile + '.svg', | ||
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'), | ||
rename: meson.project_name() + '.svg' | ||
rename: app_id + '.svg' | ||
) | ||
|
||
install_data( | ||
'icons' / 'symbolic.svg', | ||
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'symbolic', 'apps'), | ||
rename: meson.project_name() + '-symbolic.svg' | ||
rename: app_id + '-symbolic.svg' | ||
) | ||
|
||
install_data( | ||
'gschema.xml', | ||
gschema_file = configure_file( | ||
input: files('gschema.xml.in'), | ||
output: app_id + '.gschema.xml', | ||
configuration: data_config, | ||
install: true, | ||
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas', | ||
rename: meson.project_name() + '.gschema.xml' | ||
) | ||
|
||
install_data( | ||
'launcher.desktop', | ||
desktop_file = configure_file( | ||
input: files('launcher.desktop.in'), | ||
output: app_id + '.desktop', | ||
configuration: data_config, | ||
install: true, | ||
install_dir: get_option('datadir') / 'applications', | ||
rename: meson.project_name() + '.desktop' | ||
) | ||
|
||
install_data( | ||
'metainfo.xml', | ||
metainfo_file = configure_file( | ||
input: files('metainfo.xml.in'), | ||
output: '@BASENAME@', | ||
configuration: data_config, | ||
install: true, | ||
install_dir: get_option('datadir') / 'metainfo', | ||
rename: meson.project_name() + '.metainfo.xml' | ||
) | ||
|
||
asresources = gnome.compile_resources( | ||
'as-resources', | ||
'gresource.xml', | ||
source_dir: 'data', | ||
c_name: 'as', | ||
) | ||
|
||
desktop_utils = find_program('desktop-file-validate', required: false) | ||
if desktop_utils.found() | ||
test('Validate desktop file', desktop_utils, args: [desktop_file]) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Copyright 2024 Cassidy James Blaede <[email protected]> --> | ||
<component type="desktop"> | ||
<id>com.cassidyjames.butler</id> | ||
<id>@app_id@</id> | ||
<metadata_license>CC-BY-SA-4.0</metadata_license> | ||
<project_license>GPL-3.0-or-later</project_license> | ||
|
||
<name>Butler</name> | ||
<name>@app_name@</name> | ||
<summary>Companion for Home Assistant</summary> | ||
|
||
<branding> | ||
|
@@ -38,9 +38,9 @@ | |
</description> | ||
|
||
<provides> | ||
<binary>com.cassidyjames.butler</binary> | ||
<binary>@app_id@</binary> | ||
</provides> | ||
<launchable type="desktop-id">com.cassidyjames.butler.desktop</launchable> | ||
<launchable type="desktop-id">@app_id@.desktop</launchable> | ||
|
||
<recommends> | ||
<display_length compare="ge">360</display_length> | ||
|
@@ -63,6 +63,14 @@ | |
</screenshots> | ||
|
||
<releases> | ||
<release version="1.2.0" date="2024-08-27"> | ||
<description> | ||
<p>Under the hood</p> | ||
<ul> | ||
<li>Separate development and release profiles to make development easier</li> | ||
</ul> | ||
</description> | ||
</release> | ||
<release version="1.1.3" date="2024-04-23"> | ||
<description> | ||
<p>Improved app listing</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,41 @@ | ||
project( | ||
'com.cassidyjames.butler', | ||
'vala', 'c', | ||
version: '1.1.3', | ||
meson_version: '>=0.58', | ||
version: '1.2.0', | ||
meson_version: '>=1.1', | ||
) | ||
|
||
gnome = import('gnome') | ||
app_id = meson.project_name() | ||
app_name = 'Butler' | ||
|
||
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), language:'c') | ||
profile = get_option('profile') | ||
if profile == 'devel' | ||
app_id += '.Devel' | ||
app_name += ' (Devel)' | ||
endif | ||
|
||
asresources = gnome.compile_resources( | ||
'as-resources', | ||
'data' / 'gresource.xml', | ||
source_dir: 'data', | ||
c_name: 'as', | ||
) | ||
summary({ | ||
'Profile': profile, | ||
}, section: 'Development') | ||
|
||
config_data = configuration_data() | ||
config_include = include_directories('.') | ||
|
||
config_data.set_quoted('APP_ID', meson.project_name()) | ||
config_data.set_quoted('VERSION', meson.project_version()) | ||
config = configuration_data() | ||
config.set_quoted('APP_ID', app_id) | ||
config.set_quoted('APP_NAME', app_name) | ||
config.set_quoted('VERSION', meson.project_version()) | ||
config.set_quoted('PROFILE', profile) | ||
|
||
config_file = configure_file( | ||
input: 'src/Config.vala.in', | ||
output: '@BASENAME@', | ||
configuration: config_data | ||
configuration: config | ||
) | ||
|
||
executable( | ||
meson.project_name(), | ||
'src' / 'App.vala', | ||
'src' / 'MainWindow.vala', | ||
'src' / 'Widgets' / 'WebView.vala', | ||
asresources, | ||
config_file, | ||
dependencies: [ | ||
dependency('glib-2.0'), | ||
dependency('gtk4'), | ||
dependency('libadwaita-1', version: '>=1.5'), | ||
dependency('webkitgtk-6.0'), | ||
meson.get_compiler('vala').find_library('posix'), | ||
], | ||
install: true | ||
) | ||
gnome = import('gnome') | ||
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(app_id), language:'c') | ||
|
||
subdir('data') | ||
subdir('src') | ||
|
||
meson.add_install_script('build-aux' / 'meson'/ 'post_install.py') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
option('profile', type: 'combo', choices: ['devel', 'release'], value: 'devel', description: 'Whether this is an in-development or release build; affects app ID, icon, etc.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
public const string APP_ID = @APP_ID@; | ||
public const string APP_NAME = @APP_NAME@; | ||
public const string VERSION = @VERSION@; | ||
public const string PROFILE = @PROFILE@; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
executable( | ||
app_id, | ||
'App.vala', | ||
'MainWindow.vala', | ||
'Widgets' / 'WebView.vala', | ||
asresources, | ||
config_file, | ||
include_directories: config_include, | ||
dependencies: [ | ||
dependency('glib-2.0'), | ||
dependency('gtk4'), | ||
dependency('libadwaita-1', version: '>=1.5'), | ||
dependency('webkitgtk-6.0'), | ||
meson.get_compiler('vala').find_library('posix'), | ||
], | ||
install: true | ||
) |