Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package blueprint-compiler for openSUSE:Factory checked in at 2026-07-17 18:47:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/blueprint-compiler (Old) and /work/SRC/openSUSE:Factory/.blueprint-compiler.new.24530 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "blueprint-compiler" Fri Jul 17 18:47:11 2026 rev:12 rq:1366024 version:0.22.2 Changes: -------- --- /work/SRC/openSUSE:Factory/blueprint-compiler/blueprint-compiler.changes 2026-07-08 17:32:15.044504452 +0200 +++ /work/SRC/openSUSE:Factory/.blueprint-compiler.new.24530/blueprint-compiler.changes 2026-07-17 18:47:28.277187038 +0200 @@ -1,0 +2,25 @@ +Sun Jul 12 14:00:10 UTC 2026 - Bjørn Lie <[email protected]> + +- Update to version 0.22.2: + + Build/Packaging Changes: + - The meson build now checks the minimum Python version + (currently 3.9) + - The installed blueprint-compiler executable's shebang line + now hardcodes the absolute path to the python executable that + blueprint was built with `__pycache__` files from the source + directory are no longer installed + + Added: + - Added support for extern enum types + - Added support for GList in expressions + + Fixed: + - Fixed a bug where casting from uint to bool didn't work + - Fixed test failures when using GTK <4.22 + - Fixed decompilation for try expressions + - Fixed the decompiler adding unnecessary casts + - Fixed a crash when running with some older Python versions + - Fixed batch-compile to not allow input files that aren't in + the input directory + - Fixed a crash when the GTK typelib fails to load. + + Documentation: Fixed the TryExpression syntax example + +------------------------------------------------------------------- Old: ---- blueprint-compiler-0.20.4.tar.xz New: ---- blueprint-compiler-0.22.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ blueprint-compiler.spec ++++++ --- /var/tmp/diff_new_pack.qy7xCF/_old 2026-07-17 18:47:29.465227274 +0200 +++ /var/tmp/diff_new_pack.qy7xCF/_new 2026-07-17 18:47:29.469227410 +0200 @@ -23,7 +23,7 @@ %endif Name: blueprint-compiler -Version: 0.20.4 +Version: 0.22.2 Release: 0 Summary: A markup language for GTK user interfaces License: LGPL-3.0-or-later ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.qy7xCF/_old 2026-07-17 18:47:29.517229035 +0200 +++ /var/tmp/diff_new_pack.qy7xCF/_new 2026-07-17 18:47:29.525229306 +0200 @@ -1,5 +1,5 @@ -mtime: 1783286614 -commit: 2dd3fab6cd40258d72203eb6486e0ddbb4fd918da2956add8b6eb63a6830bd25 +mtime: 1783876884 +commit: 40708a066ca134db21dbeb0cbe3eedc8d7b8bf0aa73cf8fb5da05f7817a97fee url: https://src.opensuse.org/GNOME/blueprint-compiler revision: factory ++++++ _service ++++++ --- /var/tmp/diff_new_pack.qy7xCF/_old 2026-07-17 18:47:29.549230119 +0200 +++ /var/tmp/diff_new_pack.qy7xCF/_new 2026-07-17 18:47:29.549230119 +0200 @@ -3,7 +3,7 @@ <service name="obs_scm" mode="manual"> <param name="scm">git</param> <param name="url">https://gitlab.gnome.org/GNOME/blueprint-compiler.git</param> - <param name="revision">v0.20.4</param> + <param name="revision">v0.22.2</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="versionrewrite-pattern">v?(.*)(?:\+0)</param> <param name="versionrewrite-replacement">\1</param> ++++++ blueprint-compiler-0.20.4.tar.xz -> blueprint-compiler-0.22.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/.gitlab-ci.yml new/blueprint-compiler-0.22.2/.gitlab-ci.yml --- old/blueprint-compiler-0.20.4/.gitlab-ci.yml 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/.gitlab-ci.yml 2026-07-11 00:13:10.000000000 +0200 @@ -9,7 +9,9 @@ image: registry.gitlab.gnome.org/gnome/blueprint-compiler stage: build script: + - black --version - black --check --diff ./ tests + - isort --version - isort --check --diff --profile black ./ tests - mypy --python-version=3.9 blueprintcompiler/ - G_DEBUG=fatal-warnings xvfb-run coverage run -m unittest @@ -27,6 +29,12 @@ - cd .. - meson dist -C _build --include-subprojects --no-tests - cp -r "_build/meson-dist/" "${CI_PROJECT_DIR}/public-dist/" + # Make sure uninstalling works + - ninja -C _build uninstall + # Make sure the python wheel build works + - pip install . + - blueprint-compiler compile tests/samples/using.blp + - pip uninstall -y blueprint-compiler coverage: '/TOTAL.*\s([.\d]+)%/' artifacts: paths: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/MAINTENANCE.md new/blueprint-compiler-0.22.2/MAINTENANCE.md --- old/blueprint-compiler-0.20.4/MAINTENANCE.md 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/MAINTENANCE.md 2026-07-11 00:13:10.000000000 +0200 @@ -2,9 +2,7 @@ 1. Look at the git log since the previous release. Note every significant change in the NEWS file. -2. Update the version number, according to semver: - - At the top of meson.build - - In docs/flatpak.rst +2. Update the version number, according to semver, at the top of meson.build and in pyproject.toml. 3. Make a new commit with just these two changes. Use `Release v{version}` as the commit message. Tag the commit as `v{version}` and push the tag. 4. Create a "Post-release version bump" commit. 5. Go to the Releases page in GitLab and create a new release from the tag. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/NEWS.md new/blueprint-compiler-0.22.2/NEWS.md --- old/blueprint-compiler-0.20.4/NEWS.md 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/NEWS.md 2026-07-11 00:13:10.000000000 +0200 @@ -1,26 +1,25 @@ -# v0.20.4 +# v0.22.0 -## Fixed -- Fixed a crash in Python 3.9. - -# v0.20.3 - -## Fixed -- Fixed GtkTryExpression tests that were failing on GTK 4.22. -- The decompiler no longer emits some unnecessary casts. +## Build/Packaging Changes +- The meson build now checks the minimum Python version (currently 3.9) +- The installed blueprint-compiler executable's shebang line now hardcodes the absolute path to the python executable that blueprint was built with +- `__pycache__` files from the source directory are no longer installed -# v0.20.2 - -## Fixed -- Fixed a test failure due to an updated version of black. - -# v0.20.1 +## Added +- Added support for extern enum types (Jamie Gravendeel) +- Added support for GList in expressions ## Fixed -- Fix casting from uint to bool, which should work but was generating an error. +- Fixed a bug where casting from uint to bool didn't work +- Fixed test failures when using GTK <4.22 +- Fixed decompilation for try expressions +- Fixed the decompiler adding unnecessary casts +- Fixed a crash when running with some older Python versions +- Fixed batch-compile to not allow input files that aren't in the input directory +- Fixed a crash when the GTK typelib fails to load. -## Docs -- Fixed the syntax documentation for TryExpression. (Jamie Gravendeel) +## Documentation +- Fixed the TryExpression syntax example (Jamie Gravendeel) # v0.20.0 @@ -28,7 +27,7 @@ - Added help-text and visited accessibility properties - Added a --minify argument to compile and batch-compile to emit XML with no comments or whitespace - Extern class names can now include a "." for readability -- Added a linter (Sonny Piers, Neighborhoodie/STA) +- Added a linter (Sonny Piers, Neighbourhoodie/STA) - Added extension syntax for Gtk.LevelBar offsets (Matthijs Velsink) - Allow translated string constants in expressions (Julian Sparber) - Added support for some Pango types to be specified as strings (Matthijs Velsink) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/blueprint-compiler.pc.in new/blueprint-compiler-0.22.2/blueprint-compiler.pc.in --- old/blueprint-compiler-0.20.4/blueprint-compiler.pc.in 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/blueprint-compiler.pc.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -Name: blueprint-compiler -Description: Markup compiler for GTK user interface definitions -Version: @VERSION@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/blueprint-compiler.py new/blueprint-compiler-0.22.2/blueprint-compiler.py --- old/blueprint-compiler-0.20.4/blueprint-compiler.py 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/blueprint-compiler.py 2026-07-11 00:13:10.000000000 +0200 @@ -19,25 +19,9 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -import os -import sys - -# These variables should be set by meson. If they aren't, we're running -# uninstalled, and we might have to guess some values. -version = "@VERSION@" -module_path = r"@MODULE_PATH@" -libdir = r"@LIBDIR@" -datadir = r"@DATADIR@" - -if version == "\u0040VERSION@": - version = "uninstalled" - libdir = None - datadir = None -else: - # If Meson set the configuration values, insert the module path it set - sys.path.insert(0, module_path) +# This blueprint-compiler script can be used to run the compiler from the source tree. from blueprintcompiler import main if __name__ == "__main__": - main.main(version, libdir, datadir) + main.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/blueprintcompiler/gir.py new/blueprint-compiler-0.22.2/blueprintcompiler/gir.py --- old/blueprint-compiler-0.20.4/blueprintcompiler/gir.py 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/blueprintcompiler/gir.py 2026-07-11 00:13:10.000000000 +0200 @@ -149,6 +149,7 @@ hints=[ "search path: " + os.pathsep.join(gir_repo.get_search_path()) ], + fatal=namespace == "Gtk", ) else: raise e @@ -976,6 +977,9 @@ elif type_tag == GIRepository.TypeTag.ARRAY: item_type = type_info_get_param_type(typeinfo, 0) return ArrayType(self._resolve_type_info(item_type)) + elif type_tag == GIRepository.TypeTag.GLIST: + item_type = type_info_get_param_type(typeinfo, 0) + return GListType(self._resolve_type_info(item_type)) else: raise CompilerBugError("Unknown type tag", type_tag) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/blueprintcompiler/language/expression.py new/blueprint-compiler-0.22.2/blueprintcompiler/language/expression.py --- old/blueprint-compiler-0.20.4/blueprintcompiler/language/expression.py 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/blueprintcompiler/language/expression.py 2026-07-11 00:13:10.000000000 +0200 @@ -473,21 +473,24 @@ if ctx.parent_node is not None and ctx.parent_node.tag == "property": ctx.print("expr ") + gtype = ctx.type_by_cname(type) if type else None + if truthy(initial) and type is not None: - t = ctx.type_by_cname(type) - if t is None: + if gtype is None: ctx.print(f"null as <${type}>") else: - ctx.print(f"null as <{full_name(t)}>") + ctx.print(f"null as <{full_name(gtype)}>") elif type is None: if cdata == ctx.template_class: ctx.print("template") else: ctx.print(cdata) + elif gtype is None: + ctx.print(f"{cdata} as <${type}>") else: _, string = ctx.decompile_value( cdata, - ctx.type_by_cname(type), + gtype, (translatable, context, comment), ) ctx.print(string) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/blueprintcompiler/language/values.py new/blueprint-compiler-0.22.2/blueprintcompiler/language/values.py --- old/blueprint-compiler-0.20.4/blueprintcompiler/language/values.py 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/blueprintcompiler/language/values.py 2026-07-11 00:13:10.000000000 +0200 @@ -288,7 +288,11 @@ actions=[CodeAction("Use 'template'", "template")], ) - elif expected_type is not None or self.context[ValueTypeCtx].must_infer_type: + elif ( + expected_type is not None + and not isinstance(expected_type, ExternType) + or self.context[ValueTypeCtx].must_infer_type + ): object = self.context[ScopeCtx].objects.get(self.ident) if object is None: if self.ident == "null": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/blueprintcompiler/main.py new/blueprint-compiler-0.22.2/blueprintcompiler/main.py --- old/blueprint-compiler-0.20.4/blueprintcompiler/main.py 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/blueprintcompiler/main.py 2026-07-11 00:13:10.000000000 +0200 @@ -21,6 +21,7 @@ import argparse import difflib import os +import pathlib import sys import typing as T @@ -39,7 +40,6 @@ from .utils import Colors VERSION = "uninstalled" -LIBDIR = None DATADIR = None @@ -236,10 +236,26 @@ for gir_path in opts.gir_path: add_gir_search_path(gir_path) + try: + input_dir_path = pathlib.Path(opts.input_dir).resolve(strict=True) + except FileNotFoundError: + print( + f"{Colors.RED}{Colors.BOLD}error: input directory '{opts.input_dir}' does not exist{Colors.CLEAR}" + ) + sys.exit(1) + for file in opts.inputs: + file_path = pathlib.Path(file.name).resolve(strict=True) + + if not file_path.is_relative_to(input_dir_path): + print( + f"{Colors.RED}{Colors.BOLD}error: input file '{file.name}' is not in input directory '{opts.input_dir}'{Colors.CLEAR}" + ) + sys.exit(1) + path = os.path.join( opts.output_dir, - os.path.relpath(os.path.splitext(file.name)[0] + ".ui", opts.input_dir), + str(file_path.relative_to(input_dir_path).with_suffix(".ui")), ) if os.path.isfile(path): @@ -250,16 +266,8 @@ continue data = file.read() - file_abs = os.path.abspath(file.name) - input_dir_abs = os.path.abspath(opts.input_dir) try: - if not os.path.commonpath([file_abs, input_dir_abs]): - print( - f"{Colors.RED}{Colors.BOLD}error: input file '{file.name}' is not in input directory '{opts.input_dir}'{Colors.CLEAR}" - ) - sys.exit(1) - xml, warnings = self._compile(data, minify=opts.minify) for warning in warnings: @@ -482,7 +490,19 @@ return formatter.emit(ast), warnings -def main(version, libdir, datadir): - global VERSION, LIBDIR, DATADIR - VERSION, LIBDIR, DATADIR = version, libdir, datadir +def main(): + global VERSION, DATADIR + + try: + from . import config + + VERSION = config.VERSION + if config.DATADIR == "": + DATADIR = None + else: + DATADIR = config.DATADIR + except ImportError: + # running from source tree + pass + BlueprintApp().main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/blueprintcompiler/types.py new/blueprint-compiler-0.22.2/blueprintcompiler/types.py --- old/blueprint-compiler-0.20.4/blueprintcompiler/types.py 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/blueprintcompiler/types.py 2026-07-11 00:13:10.000000000 +0200 @@ -113,6 +113,28 @@ return self._inner.full_name + "[]" +class GListType(GirType): + """GList values don't have any blueprint syntax, but they can be passed between functions in expressions.""" + + def __init__(self, inner: GirType) -> None: + self._inner = inner + + def assignable_to(self, other: GirType) -> bool: + return isinstance(other, GListType) and self._inner.assignable_to(other._inner) + + @property + def inner(self) -> GirType: + return self._inner + + @property + def name(self) -> str: + return "GList<" + self._inner.name + ">" + + @property + def full_name(self) -> str: + return "GList<" + self._inner.full_name + ">" + + class BasicType(GirType): name: str = "unknown type" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/build-aux/Dockerfile new/blueprint-compiler-0.22.2/build-aux/Dockerfile --- old/blueprint-compiler-0.20.4/build-aux/Dockerfile 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/build-aux/Dockerfile 2026-07-11 00:13:10.000000000 +0200 @@ -4,7 +4,7 @@ python3-devel python3-gobject git diffutils xorg-x11-server-Xvfb \ appstream-devel dbus-x11 "dnf-command(builddep)" glslc RUN dnf build-dep -y gtk4 libadwaita -RUN pip3 install furo mypy sphinx coverage black isort +RUN pip3 install furo mypy sphinx coverage black isort build twine COPY install_deps.sh . RUN ./install_deps.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/data/blueprint-compiler.pc.in new/blueprint-compiler-0.22.2/data/blueprint-compiler.pc.in --- old/blueprint-compiler-0.20.4/data/blueprint-compiler.pc.in 1970-01-01 01:00:00.000000000 +0100 +++ new/blueprint-compiler-0.22.2/data/blueprint-compiler.pc.in 2026-07-11 00:13:10.000000000 +0200 @@ -0,0 +1,3 @@ +Name: blueprint-compiler +Description: Markup compiler for GTK user interface definitions +Version: @VERSION@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/data/blueprint-compiler.py.in new/blueprint-compiler-0.22.2/data/blueprint-compiler.py.in --- old/blueprint-compiler-0.20.4/data/blueprint-compiler.py.in 1970-01-01 01:00:00.000000000 +0100 +++ new/blueprint-compiler-0.22.2/data/blueprint-compiler.py.in 2026-07-11 00:13:10.000000000 +0200 @@ -0,0 +1,28 @@ +#!@PYTHON@ + +# blueprint-compiler.py +# +# Copyright 2021 James Westman <[email protected]> +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 3 of the +# License, or (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# SPDX-License-Identifier: LGPL-3.0-or-later + +# This is the blueprint-compiler script that meson configures and installs. Its shebang line is configured with the +# path to the environment's python executable. + +from blueprintcompiler import main + +if __name__ == "__main__": + main.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/data/config.py.in new/blueprint-compiler-0.22.2/data/config.py.in --- old/blueprint-compiler-0.20.4/data/config.py.in 1970-01-01 01:00:00.000000000 +0100 +++ new/blueprint-compiler-0.22.2/data/config.py.in 2026-07-11 00:13:10.000000000 +0200 @@ -0,0 +1,2 @@ +VERSION = "@VERSION@" +DATADIR = "@DATADIR@" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/docs/flatpak.rst new/blueprint-compiler-0.22.2/docs/flatpak.rst --- old/blueprint-compiler-0.20.4/docs/flatpak.rst 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/docs/flatpak.rst 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -======= -Flatpak -======= - -Flathub's builders don't allow internet access during the build; everything that -goes into the build must be specified in the manifest. This means meson -submodules won't work. Instead, you need to install blueprint-compiler as -a module in your flatpak manifest: - -.. code-block:: json - - { - "name": "blueprint-compiler", - "buildsystem": "meson", - "cleanup": ["*"], - "sources": [ - { - "type": "git", - "url": "https://gitlab.gnome.org/GNOME/blueprint-compiler", - "tag": "v0.20.4" - } - ] - } - -You can keep the submodule configuration--Meson will ignore it if -blueprint-compiler is already installed. \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/docs/index.rst new/blueprint-compiler-0.22.2/docs/index.rst --- old/blueprint-compiler-0.20.4/docs/index.rst 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/docs/index.rst 2026-07-11 00:13:10.000000000 +0200 @@ -17,7 +17,6 @@ setup translations - flatpak reference/index packaging linter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/meson.build new/blueprint-compiler-0.22.2/meson.build --- old/blueprint-compiler-0.20.4/meson.build 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/meson.build 2026-07-11 00:13:10.000000000 +0200 @@ -1,5 +1,5 @@ project('blueprint-compiler', - version: '0.20.4', + version: '0.22.2', ) prefix = get_option('prefix') @@ -7,40 +7,76 @@ py = import('python').find_installation('python3') -subdir('docs') - -configure_file( - input: 'blueprint-compiler.pc.in', - output: 'blueprint-compiler.pc', - configuration: { 'VERSION': meson.project_version() }, - install: not meson.is_subproject(), - install_dir: join_paths(datadir, 'pkgconfig'), -) +required_python_version = '>=3.9' +if not py.language_version().version_compare(required_python_version) + error('Python @0@ is required, but found @1@'.format(required_python_version, py.language_version())) +endif -config = configuration_data({ - 'VERSION': meson.project_version(), - 'LIBDIR': get_option('prefix') / get_option('libdir'), - 'DATADIR': get_option('prefix') / get_option('datadir'), -}) +subdir('docs') -if meson.is_subproject() - config.set('MODULE_PATH', meson.current_source_dir()) +if get_option('python_wheel') + config = configuration_data({ + 'VERSION': meson.project_version(), + 'DATADIR': '', + }) else - config.set('MODULE_PATH', py.get_install_dir()) + config = configuration_data({ + 'VERSION': meson.project_version(), + 'DATADIR': get_option('prefix') / get_option('datadir'), + }) endif -blueprint_compiler = configure_file( - input: 'blueprint-compiler.py', - output: 'blueprint-compiler', +configure_file( + input: 'data/config.py.in', + output: 'config.py', configuration: config, install: not meson.is_subproject(), - install_dir: get_option('bindir'), + install_dir: py.get_install_dir() / 'blueprintcompiler', ) +if not get_option('python_wheel') + # In wheel builds, the wrapper script is specified in pyproject.toml and doesn't need to be generated here. + blueprint_compiler = configure_file( + input: 'data/blueprint-compiler.py.in', + output: 'blueprint-compiler', + configuration: { 'PYTHON': py.full_path() }, + install: not meson.is_subproject(), + install_dir: get_option('bindir'), + install_mode: 'rwxr-xr-x', + ) +endif + if meson.is_subproject() + if get_option('python_wheel') + error('Building a wheel from a subproject is not supported') + endif + meson.override_find_program('blueprint-compiler', blueprint_compiler) else - install_subdir('blueprintcompiler', install_dir: py.get_install_dir()) + if get_option('python_wheel') + pkgconfig_path = 'share' / 'pkgconfig' + else + pkgconfig_path = 'pkgconfig' + endif + + blueprint_compiler_pc = configure_file( + input: 'data/blueprint-compiler.pc.in', + output: 'blueprint-compiler.pc', + configuration: { 'VERSION': meson.project_version() }, + install_dir: get_option('datadir') / pkgconfig_path, + ) + + install_subdir( + 'blueprintcompiler', + install_dir: py.get_install_dir(), + exclude_directories: [ + '__pycache__', + 'data/__pycache__', + 'language/__pycache__', + 'linter_rules/__pycache__', + 'outputs/__pycache__' + ], + ) endif subdir('tests') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/meson_options.txt new/blueprint-compiler-0.22.2/meson_options.txt --- old/blueprint-compiler-0.20.4/meson_options.txt 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/meson_options.txt 2026-07-11 00:13:10.000000000 +0200 @@ -1 +1,3 @@ option('docs', type: 'boolean', value: false) + +option('python_wheel', type: 'boolean', value: false, description: 'Enabled when building a Python wheel to make sure paths are correct') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/pyproject.toml new/blueprint-compiler-0.22.2/pyproject.toml --- old/blueprint-compiler-0.20.4/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/blueprint-compiler-0.22.2/pyproject.toml 2026-07-11 00:13:10.000000000 +0200 @@ -0,0 +1,30 @@ +[build-system] +build-backend = 'mesonpy' +requires = ['meson-python'] + +[tool.meson-python.args] +setup = ['-Dpython_wheel=true'] + +[project] +name = 'blueprint-compiler' +description = 'Markup compiler for GTK user interface definitions' +dynamic = ['version'] +readme = 'README.md' +requires-python = '>=3.9' +license = {file = 'COPYING'} +authors = [ + {name = 'James Westman', email = '[email protected]'}, +] +dependencies = [ + 'PyGObject', +] + +[project.scripts] +blueprint-compiler = 'blueprintcompiler.main:main' + +[project.urls] +Homepage = 'https://gitlab.gnome.org/GNOME/blueprint-compiler' +Documentation = 'https://gnome.pages.gitlab.gnome.org/blueprint-compiler/' +Repository = 'https://gitlab.gnome.org/GNOME/blueprint-compiler.git' +Issues = 'https://gitlab.gnome.org/GNOME/blueprint-compiler/-/issues' +Changelog = 'https://gitlab.gnome.org/GNOME/blueprint-compiler/-/blob/main/NEWS.md' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/tests/samples/extern_enum.blp new/blueprint-compiler-0.22.2/tests/samples/extern_enum.blp --- old/blueprint-compiler-0.20.4/tests/samples/extern_enum.blp 1970-01-01 01:00:00.000000000 +0100 +++ new/blueprint-compiler-0.22.2/tests/samples/extern_enum.blp 2026-07-11 00:13:10.000000000 +0200 @@ -0,0 +1,5 @@ +using Gtk 4.0; + +Label { + label: bind $nick_to_string(nick as <$Enum>); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/tests/samples/extern_enum.ui new/blueprint-compiler-0.22.2/tests/samples/extern_enum.ui --- old/blueprint-compiler-0.20.4/tests/samples/extern_enum.ui 1970-01-01 01:00:00.000000000 +0100 +++ new/blueprint-compiler-0.22.2/tests/samples/extern_enum.ui 2026-07-11 00:13:10.000000000 +0200 @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +DO NOT EDIT! +This file was @generated by blueprint-compiler. Instead, edit the +corresponding .blp file and regenerate this file with blueprint-compiler. +--> +<interface> + <requires lib="gtk" version="4.0"/> + <object class="GtkLabel"> + <binding name="label"> + <closure function="nick_to_string" type="gchararray"> + <constant type="Enum">nick</constant> + </closure> + </binding> + </object> +</interface> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/blueprint-compiler-0.20.4/tests/test_samples.py new/blueprint-compiler-0.22.2/tests/test_samples.py --- old/blueprint-compiler-0.20.4/tests/test_samples.py 2026-03-20 03:47:16.000000000 +0100 +++ new/blueprint-compiler-0.22.2/tests/test_samples.py 2026-07-11 00:13:10.000000000 +0200 @@ -208,6 +208,7 @@ "expr_try", "expr_value_closure", "extern_class_with_namespace", + "extern_enum", "issue_221", "parseable", "signal", ++++++ blueprint-compiler.obsinfo ++++++ --- /var/tmp/diff_new_pack.qy7xCF/_old 2026-07-17 18:47:29.985244886 +0200 +++ /var/tmp/diff_new_pack.qy7xCF/_new 2026-07-17 18:47:29.993245157 +0200 @@ -1,5 +1,5 @@ name: blueprint-compiler -version: 0.20.4 -mtime: 1773974836 -commit: 31b62c24a72c1670d2d93dcdf2d130f1ae12778e +version: 0.22.2 +mtime: 1783721590 +commit: ed35ac74de0c1bb1f5e852410b97edd1f08904c9 ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-07-12 19:21:24.000000000 +0200 @@ -0,0 +1,5 @@ +*.obscpio +*.osc +_build.* +.pbuild +osc-collab.*
