gjs: fix installed test paths

libgimarshallingtests references gobject-introspection.dev bloating the
closure.

authored by Tor Hedin Brønner and committed by Jan Tojnar 2e4e77ce 943c8700

+106 -8
+69 -8
pkgs/development/libraries/gjs/default.nix
··· 1 { fetchurl 2 , stdenv 3 , meson 4 , ninja ··· 16 , dbus 17 , gdk-pixbuf 18 , makeWrapper 19 , nixosTests 20 }: 21 22 - stdenv.mkDerivation rec { 23 pname = "gjs"; 24 version = "1.64.0"; 25 ··· 46 dbus # for dbus-run-session 47 ]; 48 49 propagatedBuildInputs = [ 50 glib 51 ]; 52 53 mesonFlags = [ 54 "-Dprofiler=disabled" 55 ]; 56 57 postPatch = '' 58 - for f in installed-tests/*.test.in; do 59 - substituteInPlace "$f" --subst-var-by pkglibexecdir "$installedTests/libexec/gjs" 60 - done 61 ''; 62 63 - postInstall = '' 64 - moveToOutput "share/installed-tests" "$installedTests" 65 - moveToOutput "libexec/gjs/installed-tests" "$installedTests" 66 67 wrapProgram "$installedTests/libexec/gjs/installed-tests/minijasmine" \ 68 - --prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" [ gtk3 atk pango.out gdk-pixbuf ]}:$installedTests/libexec/gjs/installed-tests" 69 ''; 70 71 separateDebugInfo = stdenv.isLinux;
··· 1 { fetchurl 2 + , fetchpatch 3 , stdenv 4 , meson 5 , ninja ··· 17 , dbus 18 , gdk-pixbuf 19 , makeWrapper 20 + , xvfb_run 21 , nixosTests 22 }: 23 24 + let 25 + testDeps = [ 26 + gobject-introspection # for Gio and cairo typelibs 27 + gtk3 atk pango.out gdk-pixbuf 28 + ]; 29 + in stdenv.mkDerivation rec { 30 pname = "gjs"; 31 version = "1.64.0"; 32 ··· 53 dbus # for dbus-run-session 54 ]; 55 56 + checkInputs = [ 57 + xvfb_run 58 + ] ++ testDeps; 59 + 60 propagatedBuildInputs = [ 61 glib 62 ]; 63 64 mesonFlags = [ 65 "-Dprofiler=disabled" 66 + "-Dinstalled_test_prefix=${placeholder "installedTests"}" 67 ]; 68 69 + patches = [ 70 + # Hard-code various paths 71 + ./fix-paths.patch 72 + 73 + # Clean-ups to make installing installed tests separately easier. 74 + # https://gitlab.gnome.org/GNOME/gjs/merge_requests/403 75 + (fetchpatch { 76 + url = "https://gitlab.gnome.org/GNOME/gjs/commit/14bae0e2bc7e817f53f0dcd8ecd032f554d12e6f.patch"; 77 + sha256 = "4eaNl2ddRMlUfBoOUnRy10+RlQR4f/mDMhjQ2txmRcg="; 78 + }) 79 + (fetchpatch { 80 + url = "https://gitlab.gnome.org/GNOME/gjs/commit/075f015d7980dc94fff48a1c4021cb50691dddb1.patch"; 81 + sha256 = "Iw0XfGiOUazDbpT5SqFx3UVvBRtNm3Fds1gCsdxKucw="; 82 + }) 83 + (fetchpatch { 84 + url = "https://gitlab.gnome.org/GNOME/gjs/commit/5cfd2c2ffd2d8c002d40f658e1c54027dc5d8506.patch"; 85 + sha256 = "rJ5Je1zcfthIl7+hRoWw3cwzz/ZkS2rtjvFOQ8znBi8="; 86 + }) 87 + (fetchpatch { 88 + url = "https://gitlab.gnome.org/GNOME/gjs/commit/1a81f40e8783fe97dd00f009eb0d9ad45297e831.patch"; 89 + sha256 = "+k4Xv3sJ//iDqkVTkO51IA7FPtWsS0P9YUVTWnIym4I="; 90 + }) 91 + (fetchpatch { 92 + url = "https://gitlab.gnome.org/GNOME/gjs/commit/361a319789310292787d9c62665cef9e386a9b20.patch"; 93 + sha256 = "ofOP1OFs9q5nW9rE/2ovbwZR6gTrDDh8cczdYipoWNE="; 94 + }) 95 + 96 + # Allow installing installed tests to a separate output. 97 + ./installed-tests-path.patch 98 + ]; 99 + 100 + # Gio test is failing 101 + # https://github.com/NixOS/nixpkgs/pull/81626#issuecomment-599325843 102 + doCheck = false; 103 + 104 postPatch = '' 105 + substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console 106 ''; 107 108 + preCheck = '' 109 + # Our gobject-introspection patches make the shared library paths absolute 110 + # in the GIR files. When running tests, the library is not yet installed, 111 + # though, so we need to replace the absolute path with a local one during build. 112 + # We are using a symlink that will be overridden during installation. 113 + mkdir -p $out/lib $installedTests/libexec/gjs/installed-tests 114 + ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0 115 + ln -s $PWD/installed-tests/js/libgimarshallingtests.so $installedTests/libexec/gjs/installed-tests/libgimarshallingtests.so 116 + ln -s $PWD/installed-tests/js/libregress.so $installedTests/libexec/gjs/installed-tests/libregress.so 117 + ln -s $PWD/installed-tests/js/libwarnlib.so $installedTests/libexec/gjs/installed-tests/libwarnlib.so 118 + ''; 119 120 + postInstall = '' 121 wrapProgram "$installedTests/libexec/gjs/installed-tests/minijasmine" \ 122 + --prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" testDeps}" 123 + ''; 124 + 125 + checkPhase = '' 126 + runHook preCheck 127 + xvfb-run -s '-screen 0 800x600x24' \ 128 + meson test --print-errorlogs 129 + runHook postCheck 130 ''; 131 132 separateDebugInfo = stdenv.isLinux;
+13
pkgs/development/libraries/gjs/fix-paths.patch
···
··· 1 + diff --git a/installed-tests/debugger-test.sh b/installed-tests/debugger-test.sh 2 + index 0d118490..54c5507e 100755 3 + --- a/installed-tests/debugger-test.sh 4 + +++ b/installed-tests/debugger-test.sh 5 + @@ -3,7 +3,7 @@ 6 + if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then 7 + gjs="$TOP_BUILDDIR/gjs-console" 8 + else 9 + - gjs=gjs-console 10 + + gjs=@gjsConsole@ 11 + fi 12 + 13 + echo 1..1
+24
pkgs/development/libraries/gjs/installed-tests-path.patch
···
··· 1 + diff --git a/installed-tests/meson.build b/installed-tests/meson.build 2 + index 294d20c6..1e5029e0 100644 3 + --- a/installed-tests/meson.build 4 + +++ b/installed-tests/meson.build 5 + @@ -1,7 +1,7 @@ 6 + ### Installed tests ############################################################ 7 + 8 + -installed_tests_execdir = get_option('prefix') / pkglibexecdir / 'installed-tests' 9 + -installed_tests_metadir = abs_datadir / 'installed-tests' / meson.project_name() 10 + +installed_tests_execdir = get_option('installed_test_prefix') / 'libexec' / meson.project_name() / 'installed-tests' 11 + +installed_tests_metadir = get_option('installed_test_prefix') / 'share' / 'installed-tests' / meson.project_name() 12 + 13 + # Simple shell script tests # 14 + 15 + diff --git a/meson_options.txt b/meson_options.txt 16 + index 66f66024..008687cb 100644 17 + --- a/meson_options.txt 18 + +++ b/meson_options.txt 19 + @@ -25,3 +25,5 @@ option('skip_gtk_tests', type: 'boolean', value: false, 20 + description: 'Skip tests that need a display connection') 21 + option('verbose_logs', type: 'boolean', value: false, 22 + description: 'Enable extra log messages that may decrease performance (not allowed in release builds)') 23 + +option('installed_test_prefix', type: 'string', value: '', 24 + + description: 'Prefix for installed tests')