about summary refs log tree commit diff
path: root/pkgs/development/libraries/json-glib
diff options
context:
space:
mode:
authorWill Bush <will.g.bush@gmail.com>2022-07-31 21:38:12 -0500
committerWill Bush <will.g.bush@gmail.com>2022-07-31 21:38:12 -0500
commit37bfb2a8a3903ab8e445259eb44e10f2a64ba46a (patch)
tree31541092b0f1335c7957f1533d4165cd45219f47 /pkgs/development/libraries/json-glib
parentec11cf53377a3d4626a29135b206641012c41cb5 (diff)
json-glib: simplify meson-add-installed-tests-prefix-option.patch
Diffstat (limited to 'pkgs/development/libraries/json-glib')
-rw-r--r--pkgs/development/libraries/json-glib/0001-meson-add-options-for-tests-installation-dirs.patch51
-rw-r--r--pkgs/development/libraries/json-glib/default.nix5
-rw-r--r--pkgs/development/libraries/json-glib/meson-add-installed-tests-prefix-option.patch27
3 files changed, 29 insertions, 54 deletions
diff --git a/pkgs/development/libraries/json-glib/0001-meson-add-options-for-tests-installation-dirs.patch b/pkgs/development/libraries/json-glib/0001-meson-add-options-for-tests-installation-dirs.patch
deleted file mode 100644
index 8e6d345ffcccd..0000000000000
--- a/pkgs/development/libraries/json-glib/0001-meson-add-options-for-tests-installation-dirs.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 06418362d5a6c8bc592acb7572f4d1b48213884f Mon Sep 17 00:00:00 2001
-From: Will Bush <will.g.bush@gmail.com>
-Date: Sun, 31 Jul 2022 02:48:18 -0500
-Subject: [PATCH] meson: add options for tests installation dirs
-
----
- json-glib/tests/meson.build | 13 +++++++++++--
- meson_options.txt           |  6 ++++++
- 2 files changed, 17 insertions(+), 2 deletions(-)
-
-diff --git a/json-glib/tests/meson.build b/json-glib/tests/meson.build
-index 1eb56c8..beab6c7 100644
---- a/json-glib/tests/meson.build
-+++ b/json-glib/tests/meson.build
-@@ -21,8 +21,17 @@ test_data = [
-   'stream-load.json',
- ]
- 
--installed_test_bindir = join_paths(json_libexecdir, 'installed-tests', json_api_name)
--installed_test_datadir = join_paths(json_datadir, 'installed-tests', json_api_name)
-+installed_test_suffix = join_paths('installed-tests', json_api_name)
-+
-+installed_test_bindir = join_paths(get_option('installed_test_bindir'), installed_test_suffix)
-+if installed_test_bindir == ''
-+  installed_test_bindir = join_paths(json_libexecdir, installed_test_suffix)
-+endif
-+
-+installed_test_datadir = join_paths(get_option('installed_test_datadir'), installed_test_suffix)
-+if installed_test_datadir == ''
-+  installed_test_datadir = join_paths(json_datadir, installed_test_suffix)
-+endif
- 
- install_data(test_data, install_dir: installed_test_bindir)
- 
-diff --git a/meson_options.txt b/meson_options.txt
-index 068a03f..b3b1837 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -10,3 +10,9 @@ option('man',
- option('tests',
-        type: 'boolean', value: true,
-        description: 'Build the tests')
-+option('installed_test_datadir', type: 'string',
-+       value: '',
-+       description: 'Installation directory for data files in tests')
-+option('installed_test_bindir', type: 'string',
-+       value: '',
-+       description: 'Installation directory for binary files in tests')
--- 
-2.36.1
-
diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix
index 11aacb3e604bc..e095945dabaac 100644
--- a/pkgs/development/libraries/json-glib/default.nix
+++ b/pkgs/development/libraries/json-glib/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     # Add option for changing installation path of installed tests.
-    ./0001-meson-add-options-for-tests-installation-dirs.patch
+    ./meson-add-installed-tests-prefix-option.patch
   ];
 
   strictDeps = true;
@@ -56,8 +56,7 @@ stdenv.mkDerivation rec {
   ];
 
   mesonFlags = [
-    "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec"
-    "-Dinstalled_test_datadir=${placeholder "installedTests"}/share"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
   ];
 
   # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
diff --git a/pkgs/development/libraries/json-glib/meson-add-installed-tests-prefix-option.patch b/pkgs/development/libraries/json-glib/meson-add-installed-tests-prefix-option.patch
new file mode 100644
index 0000000000000..626db09cd03f1
--- /dev/null
+++ b/pkgs/development/libraries/json-glib/meson-add-installed-tests-prefix-option.patch
@@ -0,0 +1,27 @@
+diff --git a/json-glib/tests/meson.build b/json-glib/tests/meson.build
+index 1eb56c8..dca444e 100644
+--- a/json-glib/tests/meson.build
++++ b/json-glib/tests/meson.build
+@@ -21,8 +21,9 @@ test_data = [
+   'stream-load.json',
+ ]
+ 
+-installed_test_bindir = join_paths(json_libexecdir, 'installed-tests', json_api_name)
+-installed_test_datadir = join_paths(json_datadir, 'installed-tests', json_api_name)
++installed_test_prefix = get_option('installed_test_prefix')
++installed_test_bindir = join_paths(installed_test_prefix, 'libexec', 'installed-tests', json_api_name)
++installed_test_datadir = join_paths(installed_test_prefix, 'share', 'installed-tests', json_api_name)
+ 
+ install_data(test_data, install_dir: installed_test_bindir)
+ 
+diff --git a/meson_options.txt b/meson_options.txt
+index 068a03f..03f398a 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -10,3 +10,6 @@ option('man',
+ option('tests',
+        type: 'boolean', value: true,
+        description: 'Build the tests')
++option('installed_test_prefix',
++       description: 'Prefix for installed tests',
++       type: 'string')