summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2022-05-11 10:23:03 +0100
committerSimon McVittie <smcv@debian.org>2022-05-11 10:50:58 +0100
commit950fb4a5f761fd9171bb0e5a305ff1365d93030b (patch)
tree855404a5f3d7a4a19a0f38b7e07742d1e40f7297
parent5964fe1c60d6b05c361a402c493dd786145f41f5 (diff)
Build using Meson
-rw-r--r--debian/control2
-rw-r--r--debian/patches/meson-Optionally-install-tests-for-as-installed-testing.patch92
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules5
4 files changed, 97 insertions, 3 deletions
diff --git a/debian/control b/debian/control
index d4b494f..5df9020 100644
--- a/debian/control
+++ b/debian/control
@@ -5,12 +5,12 @@ Maintainer: Utopia Maintenance Team <pkg-utopia-maintainers@lists.alioth.debian.
Uploaders:
Simon McVittie <smcv@debian.org>,
Build-Depends:
- autoconf-archive,
dbus <!nocheck>,
debhelper-compat (= 13),
docbook-xml,
docbook-xsl,
libglib2.0-dev,
+ meson,
xsltproc,
Rules-Requires-Root: no
Standards-Version: 4.6.0
diff --git a/debian/patches/meson-Optionally-install-tests-for-as-installed-testing.patch b/debian/patches/meson-Optionally-install-tests-for-as-installed-testing.patch
new file mode 100644
index 0000000..39eadf6
--- /dev/null
+++ b/debian/patches/meson-Optionally-install-tests-for-as-installed-testing.patch
@@ -0,0 +1,92 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Wed, 11 May 2022 10:31:25 +0100
+Subject: meson: Optionally install tests for "as-installed" testing
+
+This is used in the Debian packaging via ginsttest-runner and the
+autopkgtest framework. Previously, it was supported by the Autotools
+build system but not by the Meson build system.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/flatpak/xdg-dbus-proxy/pull/43
+---
+ meson_options.txt | 6 ++++++
+ tests/Makefile.am.inc | 1 +
+ tests/meson.build | 18 ++++++++++++++++++
+ tests/tap.test.in | 4 ++++
+ 4 files changed, 29 insertions(+)
+ create mode 100644 tests/tap.test.in
+
+diff --git a/meson_options.txt b/meson_options.txt
+index 30dc257..a8652f4 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,3 +1,9 @@
++option(
++ 'installed_tests',
++ type : 'boolean',
++ description : 'Build and install "as-installed" tests',
++ value : 'false',
++)
+ option(
+ 'man',
+ type : 'feature',
+diff --git a/tests/Makefile.am.inc b/tests/Makefile.am.inc
+index 8ee80b1..649ae12 100644
+--- a/tests/Makefile.am.inc
++++ b/tests/Makefile.am.inc
+@@ -13,6 +13,7 @@ test_proxy_SOURCES = tests/test-proxy.c
+ test_proxy_LDADD = $(COMMON_LIBS)
+
+ EXTRA_DIST += tests/meson.build
++EXTRA_DIST += tests/tap.test.in
+ EXTRA_DIST += tests/use-as-subproject/README
+ EXTRA_DIST += tests/use-as-subproject/config.h
+ EXTRA_DIST += tests/use-as-subproject/dummy-config.h.in
+diff --git a/tests/meson.build b/tests/meson.build
+index 6345c1d..5aebdb4 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -1,3 +1,7 @@
++enable_installed_tests = get_option('installed_tests') and not meson.is_subproject()
++installed_testdir = get_option('libexecdir') / 'installed-tests' / meson.project_name()
++installed_tests_metadir = get_option('datadir') / 'installed-tests' / meson.project_name()
++
+ test_programs = [
+ [
+ 'test-proxy',
+@@ -6,6 +10,8 @@ test_programs = [
+ 'test-proxy.c',
+ dependencies : common_deps,
+ include_directories : common_include_directories,
++ install : enable_installed_tests,
++ install_dir : installed_testdir,
+ ),
+ ],
+ ]
+@@ -32,4 +38,16 @@ foreach pair : test_programs
+ env : test_env,
+ )
+ endif
++
++ if enable_installed_tests
++ configure_file(
++ input : 'tap.test.in',
++ output : name + '.test',
++ configuration : {
++ 'basename' : name,
++ 'installed_testdir' : get_option('prefix') / installed_testdir,
++ },
++ install_dir : installed_tests_metadir,
++ )
++ endif
+ endforeach
+diff --git a/tests/tap.test.in b/tests/tap.test.in
+new file mode 100644
+index 0000000..6a3aeb2
+--- /dev/null
++++ b/tests/tap.test.in
+@@ -0,0 +1,4 @@
++[Test]
++Type=session
++Exec=@installed_testdir@/@basename@ --tap
++Output=TAP
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..31b87d5
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+meson-Optionally-install-tests-for-as-installed-testing.patch
diff --git a/debian/rules b/debian/rules
index af5531b..d10a6c2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,9 +6,10 @@ export LC_ALL=C.UTF-8
include /usr/share/dpkg/default.mk
%:
- dh $@
+ dh $@ --buildsystem=meson
override_dh_auto_configure:
dh_auto_configure -- \
- --enable-installed-tests \
+ -Dauto_features=enabled \
+ -Dinstalled_tests=true \
$(NULL)