From 27668c7b1bf4f8831bb0aad1118b87f62db9c5e0 Mon Sep 17 00:00:00 2001 From: Bruce Cowan <bruce@bcowan.me.uk> Date: Mon, 3 Jan 2022 18:19:49 +0000 Subject: [PATCH] Meson build improvements --- build-aux/post_install.py | 20 -------------------- meson.build | 16 +++++++++++----- 2 files changed, 11 insertions(+), 25 deletions(-) delete mode 100644 build-aux/post_install.py diff --git a/build-aux/post_install.py b/build-aux/post_install.py deleted file mode 100644 index 40fa31e..0000000 --- a/build-aux/post_install.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 - -# SPDX-FileCopyrightText: 2017 Carlos Sanchez <csoriano@gnome.org> -# SPDX-FileCopyrightText: 2020 Bruce Cowan <bruce@bcowan.me.uk> -# -# SPDX-License-Identifier: CC0-1.0 - -import os -import subprocess - -prefix = os.environ.get("MESON_INSTALL_PREFIX", "/usr/local") -datadir = os.path.join(prefix, "share") - -if "DESTDIR" not in os.environ: - print("Compiling GSettings schemas...") - schemas_dir = os.path.join(datadir, "glib-2.0", "schemas") - if not os.path.exists(schemas_dir): - os.makedirs(schemas_dir) - subprocess.call(["glib-compile-schemas", schemas_dir]) - diff --git a/meson.build b/meson.build index 9369ba8..8b09720 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,17 @@ -# SPDX-FileCopyrightText: 2016-2021 Bruce Cowan <bruce@bcowan.me.uk> +# SPDX-FileCopyrightText: 2016-2022 Bruce Cowan <bruce@bcowan.me.uk> # # SPDX-License-Identifier: CC0-1.0 project('rugby', 'c', - version: '0.3.0', - license:'GPL', - default_options: ['c_std=gnu11', 'warning_level=3']) + version: '0.3.0', + license:'GPLv3+', + meson_version: '>= 0.57.0', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=gnu11', + 'warning_level=3' + ], +) datadir = get_option('datadir') @@ -40,4 +46,4 @@ add_project_arguments(cc.get_supported_arguments(cflags), subdir('data') subdir('src') -meson.add_install_script('build-aux/post_install.py') +gnome.post_install(glib_compile_schemas: true) -- GitLab