From c58bf79e3ad89e4ffef1b8f3dae504fc8a6cc0fc Mon Sep 17 00:00:00 2001 From: SubhadeepJasu Date: Thu, 6 Feb 2025 11:51:38 +0530 Subject: [PATCH] Prebuild ui files --- data/meson.build | 47 +++++++++++++++++++++---------------- data/ui/scientific_view.blp | 1 - 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/data/meson.build b/data/meson.build index 34f252a..78177f1 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,21 +1,3 @@ -sassc = find_program('sassc') - -sassc_opts = [ '-a', '-M', '-t', 'compact' ] - -stylesheet_deps = custom_target( - 'style.scss', - input: 'style.scss', - output: 'style.css', - command: [ - sassc, - sassc_opts, - '@INPUT@', - '@OUTPUT@', - ], - install: true, - install_dir: get_option('datadir') / meson.project_name() -) - blueprint_files = [ 'ui/main_window.blp', 'ui/preferences_dialog.blp', @@ -27,15 +9,40 @@ blueprint_files = [ 'ui/scientific_view.blp' ] +blueprint_compiler = find_program('blueprint-compiler') + blueprints_ui = [] +bfs = [] foreach b : blueprint_files blueprints_ui += b.replace('.blp', '.ui') + bfs += meson.current_source_dir() / b endforeach +r = run_command('blueprint-compiler', 'batch-compile', meson.project_build_root() / 'data/ui', meson.current_source_dir() / 'ui', bfs, check: true) +r.returncode() + blueprints = custom_target('blueprints', input: files(blueprint_files), output: '.', - command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], + command: [blueprint_compiler, 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], +) + +sassc = find_program('sassc') + +sassc_opts = [ '-a', '-M', '-t', 'compact' ] + +stylesheet_deps = custom_target( + 'style.scss', + input: 'style.scss', + output: 'style.css', + command: [ + sassc, + sassc_opts, + '@INPUT@', + '@OUTPUT@', + ], + install: true, + install_dir: get_option('datadir') / meson.project_name() ) gresource_bundle = gnome.compile_resources( @@ -46,8 +53,8 @@ gresource_bundle = gnome.compile_resources( meson.current_source_dir(), ], dependencies: [ - stylesheet_deps, blueprints, + stylesheet_deps ], gresource_bundle: true, install: true, diff --git a/data/ui/scientific_view.blp b/data/ui/scientific_view.blp index 787b0ec..237d388 100644 --- a/data/ui/scientific_view.blp +++ b/data/ui/scientific_view.blp @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: 2024 Subhadeep Jasu using Gtk 4.0; -using Gdk 4.0; using Adw 1; template $PebblesScientificView: Gtk.Grid {