summaryrefslogtreecommitdiff
path: root/examples/gtk4/simple-bar/py/src/meson.build
diff options
context:
space:
mode:
authorAylur <[email protected]>2025-03-01 20:59:09 +0100
committerAylur <[email protected]>2025-03-01 21:02:29 +0100
commit23cdbc8088b5c308a068b432a6b03213ede68f07 (patch)
tree1e8bd6ffde5273fcd80aca0d30cbb38dbe5f9461 /examples/gtk4/simple-bar/py/src/meson.build
parentdfd1f23c7562694e571d44c45aa74fcea9b1ba01 (diff)
add gtk4 examples
Diffstat (limited to 'examples/gtk4/simple-bar/py/src/meson.build')
-rw-r--r--examples/gtk4/simple-bar/py/src/meson.build59
1 files changed, 59 insertions, 0 deletions
diff --git a/examples/gtk4/simple-bar/py/src/meson.build b/examples/gtk4/simple-bar/py/src/meson.build
new file mode 100644
index 0000000..54ecd17
--- /dev/null
+++ b/examples/gtk4/simple-bar/py/src/meson.build
@@ -0,0 +1,59 @@
+pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name()
+bindir = get_option('prefix') / get_option('bindir')
+
+blp = find_program('blueprint-compiler', required: true)
+sass = find_program('sass', required: true)
+python = find_program('python3', required: true)
+layer_shell = dependency('gtk4-layer-shell-0')
+
+blueprint_sources = files(
+ 'ui/Bar.blp',
+)
+
+# transplie blueprints
+ui = custom_target(
+ 'blueprint',
+ input: blueprint_sources,
+ output: '.',
+ command: [
+ blp,
+ 'batch-compile',
+ '@OUTPUT@',
+ '@CURRENT_SOURCE_DIR@',
+ '@INPUT@',
+ ],
+)
+
+# bundle styles
+css = custom_target(
+ 'scss',
+ input: files('main.scss'),
+ command: [sass, '@INPUT@', '@OUTPUT@'],
+ output: 'main.css',
+)
+
+# compiling ui and css into a binary
+import('gnome').compile_resources(
+ 'data',
+ files('gresource.xml'),
+ dependencies: [ui, css],
+ gresource_bundle: true,
+ install: true,
+ install_dir: pkgdatadir,
+)
+
+# install python sources
+install_subdir('py', install_dir: pkgdatadir)
+
+# configure the main python entry file
+configure_file(
+ input: 'main.in.py',
+ output: meson.project_name(),
+ configuration: {
+ 'PYTHON': python.full_path(),
+ 'LAYER_SHELL_PREFIX': layer_shell.get_variable('prefix'),
+ 'PKGDATADIR': pkgdatadir,
+ },
+ install: true,
+ install_dir: bindir,
+)