feat(meson): devel option (#55)
* Add new development flatpak manifest * feat(ci): use devel manifest * feat(meson): check if git is available * feat(meson): pass 'check' to run_command there was a warning * chore: install.sh should build devel * fix(meson_options): profile => devel Co-authored-by: Evangelos Paterakis <evan@geopjr.dev>
This commit is contained in:
parent
94688429bd
commit
15b8f4a0c2
|
@ -12,7 +12,7 @@ jobs:
|
||||||
options: --privileged
|
options: --privileged
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
|
- uses: flatpak/flatpak-github-actions/flatpak-builder@v5
|
||||||
with:
|
with:
|
||||||
bundle: "dev.geopjr.tooth.flatpak"
|
bundle: "dev.geopjr.tooth.Devel.flatpak"
|
||||||
manifest-path: "dev.geopjr.tooth.json"
|
manifest-path: "dev.geopjr.tooth.Devel.json"
|
||||||
|
|
|
@ -2,8 +2,13 @@ icons_dir = join_paths(get_option('datadir'), 'icons', 'hicolor')
|
||||||
scalable_dir = join_paths(icons_dir, 'scalable', 'apps')
|
scalable_dir = join_paths(icons_dir, 'scalable', 'apps')
|
||||||
symbolic_dir = join_paths(icons_dir, 'symbolic', 'apps')
|
symbolic_dir = join_paths(icons_dir, 'symbolic', 'apps')
|
||||||
|
|
||||||
|
icon = 'color.svg'
|
||||||
|
if get_option('devel')
|
||||||
|
icon = 'color-nightly.svg'
|
||||||
|
endif
|
||||||
|
|
||||||
install_data(
|
install_data(
|
||||||
join_paths('icons', 'color.svg'),
|
join_paths('icons', icon),
|
||||||
install_dir: scalable_dir,
|
install_dir: scalable_dir,
|
||||||
rename: meson.project_name() + '.svg',
|
rename: meson.project_name() + '.svg',
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"app-id": "dev.geopjr.tooth",
|
||||||
|
"runtime": "org.gnome.Platform",
|
||||||
|
"runtime-version": "43",
|
||||||
|
"sdk": "org.gnome.Sdk",
|
||||||
|
"sdk-extensions" : ["org.freedesktop.Sdk.Extension.vala"],
|
||||||
|
"build-options" : {
|
||||||
|
"prepend-path" : "/usr/lib/sdk/vala/bin/",
|
||||||
|
"prepend-ld-library-path" : "/usr/lib/sdk/vala/lib"
|
||||||
|
},
|
||||||
|
"command": "dev.geopjr.tooth",
|
||||||
|
"finish-args": [
|
||||||
|
"--device=dri",
|
||||||
|
"--share=ipc",
|
||||||
|
"--share=network",
|
||||||
|
"--socket=fallback-x11",
|
||||||
|
"--socket=wayland",
|
||||||
|
"--talk-name=org.gtk.vfs",
|
||||||
|
"--talk-name=org.gtk.vfs.*",
|
||||||
|
"--filesystem=xdg-run/gvfsd"
|
||||||
|
],
|
||||||
|
"cleanup": [
|
||||||
|
"/include",
|
||||||
|
"/lib/pkgconfig",
|
||||||
|
"/man",
|
||||||
|
"/share/doc",
|
||||||
|
"/share/gtk-doc",
|
||||||
|
"/share/man",
|
||||||
|
"/share/pkgconfig",
|
||||||
|
"/share/vala",
|
||||||
|
"*.la",
|
||||||
|
"*.a"
|
||||||
|
],
|
||||||
|
"modules": [
|
||||||
|
{
|
||||||
|
"name": "tooth",
|
||||||
|
"builddir": true,
|
||||||
|
"buildsystem": "meson",
|
||||||
|
"config-opts" : [
|
||||||
|
"-Ddevel=true"
|
||||||
|
],
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"type": "dir",
|
||||||
|
"path": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
meson setup build --prefix=/usr
|
meson setup build --prefix=/usr
|
||||||
|
meson configure build -Ddevel=true
|
||||||
cd build
|
cd build
|
||||||
ninja
|
ninja
|
||||||
sudo ninja install
|
sudo ninja install
|
||||||
|
|
14
meson.build
14
meson.build
|
@ -16,20 +16,32 @@ add_global_arguments(
|
||||||
language: 'c',
|
language: 'c',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
devel = get_option('devel')
|
||||||
config = configuration_data()
|
config = configuration_data()
|
||||||
config.set('EXEC_NAME', meson.project_name())
|
config.set('EXEC_NAME', meson.project_name())
|
||||||
config.set('GETTEXT_PACKAGE', meson.project_name())
|
config.set('GETTEXT_PACKAGE', meson.project_name())
|
||||||
config.set('RESOURCES', '/' + '/'.join(meson.project_name().split('.')) + '/')
|
config.set('RESOURCES', '/' + '/'.join(meson.project_name().split('.')) + '/')
|
||||||
config.set('VERSION', meson.project_version())
|
config.set('VERSION', meson.project_version())
|
||||||
config.set('PREFIX', get_option('prefix'))
|
config.set('PREFIX', get_option('prefix'))
|
||||||
|
config.set('PROFILE', devel ? 'development' : 'production')
|
||||||
config.set('NAME', 'Tooth')
|
config.set('NAME', 'Tooth')
|
||||||
config.set('WEBSITE', 'https://github.com/GeopJr/tooth')
|
config.set('WEBSITE', 'https://github.com/GeopJr/tooth')
|
||||||
config.set('SUPPORT_WEBSITE', 'https://github.com/GeopJr/tooth/issues')
|
config.set('SUPPORT_WEBSITE', 'https://github.com/GeopJr/tooth/issues')
|
||||||
config.set(
|
config.set(
|
||||||
'COPYRIGHT',
|
'COPYRIGHT',
|
||||||
'© 2018-2021 bleak_grey\n© 2022 Evangelos \"GeopJr\" Paterakis',
|
'© 2022 bleak_grey\n© 2022 Evangelos \"GeopJr\" Paterakis',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if devel
|
||||||
|
git = find_program('git')
|
||||||
|
if git.found()
|
||||||
|
branch = run_command('git', 'branch', '--show-current', check: true).stdout().strip()
|
||||||
|
revision = run_command('git', 'rev-parse', '--short', 'HEAD', check: true).stdout().strip()
|
||||||
|
version = '@0@-@1@'.format(branch, revision)
|
||||||
|
config.set('VERSION', version)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
gnome = import('gnome')
|
gnome = import('gnome')
|
||||||
i18n = import('i18n')
|
i18n = import('i18n')
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
option('devel', type: 'boolean', value: false)
|
|
@ -200,9 +200,9 @@ namespace Tooth {
|
||||||
refresh ();
|
refresh ();
|
||||||
}
|
}
|
||||||
|
|
||||||
string troubleshooting = "flatpak: %s\nversion: %s\ngtk: %u.%u.%u (%d.%d.%d)\nlibadwaita: %u.%u.%u (%d.%d.%d)\nlibsoup: %u.%u.%u (%d.%d.%d)\n".printf(
|
string troubleshooting = "flatpak: %s\nversion: %s (%s)\ngtk: %u.%u.%u (%d.%d.%d)\nlibadwaita: %u.%u.%u (%d.%d.%d)\nlibsoup: %u.%u.%u (%d.%d.%d)\n".printf(
|
||||||
(GLib.Environment.get_variable("FLATPAK_ID") != null || GLib.File.new_for_path("/.flatpak-info").query_exists()).to_string(),
|
(GLib.Environment.get_variable("FLATPAK_ID") != null || GLib.File.new_for_path("/.flatpak-info").query_exists()).to_string(),
|
||||||
Build.VERSION,
|
Build.VERSION, Build.PROFILE,
|
||||||
Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version(),
|
Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version(),
|
||||||
Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION, Gtk.MICRO_VERSION,
|
Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION, Gtk.MICRO_VERSION,
|
||||||
Adw.get_major_version(), Adw.get_minor_version(), Adw.get_micro_version(),
|
Adw.get_major_version(), Adw.get_minor_version(), Adw.get_micro_version(),
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class Build {
|
||||||
public const string SUPPORT_WEBSITE = "@SUPPORT_WEBSITE@";
|
public const string SUPPORT_WEBSITE = "@SUPPORT_WEBSITE@";
|
||||||
public const string COPYRIGHT = "@COPYRIGHT@";
|
public const string COPYRIGHT = "@COPYRIGHT@";
|
||||||
public const string PREFIX = "@PREFIX@";
|
public const string PREFIX = "@PREFIX@";
|
||||||
|
public const string PROFILE = "@PROFILE@";
|
||||||
|
|
||||||
public static string SYSTEM_INFO;
|
public static string SYSTEM_INFO;
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ public class Build {
|
||||||
SYSTEM_INFO = @"$NAME $VERSION";
|
SYSTEM_INFO = @"$NAME $VERSION";
|
||||||
SYSTEM_INFO += @"\nRunning on: $os_name $os_ver";
|
SYSTEM_INFO += @"\nRunning on: $os_name $os_ver";
|
||||||
SYSTEM_INFO += @"\nBuild prefix: \"$PREFIX\"";
|
SYSTEM_INFO += @"\nBuild prefix: \"$PREFIX\"";
|
||||||
|
SYSTEM_INFO += @"\nBuild profile: \"$PROFILE\"";
|
||||||
|
|
||||||
var lines = SYSTEM_INFO.split ("\n");
|
var lines = SYSTEM_INFO.split ("\n");
|
||||||
foreach (unowned string line in lines) {
|
foreach (unowned string line in lines) {
|
||||||
|
|
|
@ -32,6 +32,10 @@ public class Tooth.Dialogs.MainWindow: Adw.ApplicationWindow, Saveable {
|
||||||
);
|
);
|
||||||
sidebar.set_sidebar_selected_item(0);
|
sidebar.set_sidebar_selected_item(0);
|
||||||
open_view (new Views.Main ());
|
open_view (new Views.Main ());
|
||||||
|
|
||||||
|
if (Build.PROFILE == "development") {
|
||||||
|
this.add_css_class ("devel");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Views.Base open_view (Views.Base view) {
|
public Views.Base open_view (Views.Base view) {
|
||||||
|
|
Loading…
Reference in New Issue