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

This reverts commit 78182194c652df7bdcfa0a6a788d17895188b777.

+47 -1
+1
nixos/tests/installed-tests/default.nix
··· 98 gnome-photos = callInstalledTest ./gnome-photos.nix {}; 99 graphene = callInstalledTest ./graphene.nix {}; 100 gsconnect = callInstalledTest ./gsconnect.nix {}; 101 ibus = callInstalledTest ./ibus.nix {}; 102 libgdata = callInstalledTest ./libgdata.nix {}; 103 librsvg = callInstalledTest ./librsvg.nix {};
··· 98 gnome-photos = callInstalledTest ./gnome-photos.nix {}; 99 graphene = callInstalledTest ./graphene.nix {}; 100 gsconnect = callInstalledTest ./gsconnect.nix {}; 101 + json-glib = callInstalledTest ./json-glib.nix {}; 102 ibus = callInstalledTest ./ibus.nix {}; 103 libgdata = callInstalledTest ./libgdata.nix {}; 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 , glib 5 , meson 6 , ninja 7 , pkg-config 8 , gettext 9 , gobject-introspection ··· 17 pname = "json-glib"; 18 version = "1.6.6"; 19 20 - outputs = [ "out" "dev" "devdoc" ]; 21 22 src = fetchurl { 23 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 24 sha256 = "luyYvnqR9t3jNjZyDj2i/27LuQ52zKpJSX8xpoVaSQ4="; 25 }; 26 27 strictDeps = true; 28 ··· 49 glib 50 ]; 51 52 53 # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) 54 # it should be a build-time dep for build ··· 73 ''; 74 75 passthru = { 76 updateScript = gnome.updateScript { 77 packageName = pname; 78 versionPolicy = "odd-unstable";
··· 4 , glib 5 , meson 6 , ninja 7 + , nixosTests 8 , pkg-config 9 , gettext 10 , gobject-introspection ··· 18 pname = "json-glib"; 19 version = "1.6.6"; 20 21 + outputs = [ "out" "dev" "devdoc" "installedTests" ]; 22 23 src = fetchurl { 24 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 25 sha256 = "luyYvnqR9t3jNjZyDj2i/27LuQ52zKpJSX8xpoVaSQ4="; 26 }; 27 + 28 + patches = [ 29 + # Add option for changing installation path of installed tests. 30 + ./meson-add-installed-tests-prefix-option.patch 31 + ]; 32 33 strictDeps = true; 34 ··· 55 glib 56 ]; 57 58 + mesonFlags = [ 59 + "-Dinstalled_test_prefix=${placeholder "installedTests"}" 60 + ]; 61 62 # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) 63 # it should be a build-time dep for build ··· 82 ''; 83 84 passthru = { 85 + tests = { 86 + installedTests = nixosTests.installed-tests.json-glib; 87 + }; 88 + 89 updateScript = gnome.updateScript { 90 packageName = pname; 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')