Re-Revert Merge #184360: json-glib: add installed tests

This reverts commit 78182194c652df7bdcfa0a6a788d17895188b777.

+47 -1
+1
nixos/tests/installed-tests/default.nix
··· 98 98 gnome-photos = callInstalledTest ./gnome-photos.nix {}; 99 99 graphene = callInstalledTest ./graphene.nix {}; 100 100 gsconnect = callInstalledTest ./gsconnect.nix {}; 101 + json-glib = callInstalledTest ./json-glib.nix {}; 101 102 ibus = callInstalledTest ./ibus.nix {}; 102 103 libgdata = callInstalledTest ./libgdata.nix {}; 103 104 librsvg = callInstalledTest ./librsvg.nix {};
+5
nixos/tests/installed-tests/json-glib.nix
··· 1 + { pkgs, makeInstalledTest, ... }: 2 + 3 + makeInstalledTest { 4 + tested = pkgs.json-glib; 5 + }
+14 -1
pkgs/development/libraries/json-glib/default.nix
··· 4 4 , glib 5 5 , meson 6 6 , ninja 7 + , nixosTests 7 8 , pkg-config 8 9 , gettext 9 10 , gobject-introspection ··· 17 18 pname = "json-glib"; 18 19 version = "1.6.6"; 19 20 20 - outputs = [ "out" "dev" "devdoc" ]; 21 + outputs = [ "out" "dev" "devdoc" "installedTests" ]; 21 22 22 23 src = fetchurl { 23 24 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 24 25 sha256 = "luyYvnqR9t3jNjZyDj2i/27LuQ52zKpJSX8xpoVaSQ4="; 25 26 }; 27 + 28 + patches = [ 29 + # Add option for changing installation path of installed tests. 30 + ./meson-add-installed-tests-prefix-option.patch 31 + ]; 26 32 27 33 strictDeps = true; 28 34 ··· 49 55 glib 50 56 ]; 51 57 58 + mesonFlags = [ 59 + "-Dinstalled_test_prefix=${placeholder "installedTests"}" 60 + ]; 52 61 53 62 # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) 54 63 # it should be a build-time dep for build ··· 73 82 ''; 74 83 75 84 passthru = { 85 + tests = { 86 + installedTests = nixosTests.installed-tests.json-glib; 87 + }; 88 + 76 89 updateScript = gnome.updateScript { 77 90 packageName = pname; 78 91 versionPolicy = "odd-unstable";
+27
pkgs/development/libraries/json-glib/meson-add-installed-tests-prefix-option.patch
··· 1 + diff --git a/json-glib/tests/meson.build b/json-glib/tests/meson.build 2 + index 1eb56c8..dca444e 100644 3 + --- a/json-glib/tests/meson.build 4 + +++ b/json-glib/tests/meson.build 5 + @@ -21,8 +21,9 @@ test_data = [ 6 + 'stream-load.json', 7 + ] 8 + 9 + -installed_test_bindir = join_paths(json_libexecdir, 'installed-tests', json_api_name) 10 + -installed_test_datadir = join_paths(json_datadir, 'installed-tests', json_api_name) 11 + +installed_test_prefix = get_option('installed_test_prefix') 12 + +installed_test_bindir = join_paths(installed_test_prefix, 'libexec', 'installed-tests', json_api_name) 13 + +installed_test_datadir = join_paths(installed_test_prefix, 'share', 'installed-tests', json_api_name) 14 + 15 + install_data(test_data, install_dir: installed_test_bindir) 16 + 17 + diff --git a/meson_options.txt b/meson_options.txt 18 + index 068a03f..03f398a 100644 19 + --- a/meson_options.txt 20 + +++ b/meson_options.txt 21 + @@ -10,3 +10,6 @@ option('man', 22 + option('tests', 23 + type: 'boolean', value: true, 24 + description: 'Build the tests') 25 + +option('installed_test_prefix', 26 + + description: 'Prefix for installed tests', 27 + + type: 'string')