gjs: fix installed test paths
libgimarshallingtests references gobject-introspection.dev bloating the closure.
This commit is contained in:
parent
943c870092
commit
2e4e77cef7
@ -1,4 +1,5 @@
|
|||||||
{ fetchurl
|
{ fetchurl
|
||||||
|
, fetchpatch
|
||||||
, stdenv
|
, stdenv
|
||||||
, meson
|
, meson
|
||||||
, ninja
|
, ninja
|
||||||
@ -16,10 +17,16 @@
|
|||||||
, dbus
|
, dbus
|
||||||
, gdk-pixbuf
|
, gdk-pixbuf
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
|
, xvfb_run
|
||||||
, nixosTests
|
, nixosTests
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
testDeps = [
|
||||||
|
gobject-introspection # for Gio and cairo typelibs
|
||||||
|
gtk3 atk pango.out gdk-pixbuf
|
||||||
|
];
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
pname = "gjs";
|
pname = "gjs";
|
||||||
version = "1.64.0";
|
version = "1.64.0";
|
||||||
|
|
||||||
@ -46,26 +53,80 @@ stdenv.mkDerivation rec {
|
|||||||
dbus # for dbus-run-session
|
dbus # for dbus-run-session
|
||||||
];
|
];
|
||||||
|
|
||||||
|
checkInputs = [
|
||||||
|
xvfb_run
|
||||||
|
] ++ testDeps;
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
glib
|
glib
|
||||||
];
|
];
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
"-Dprofiler=disabled"
|
"-Dprofiler=disabled"
|
||||||
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# Hard-code various paths
|
||||||
|
./fix-paths.patch
|
||||||
|
|
||||||
|
# Clean-ups to make installing installed tests separately easier.
|
||||||
|
# https://gitlab.gnome.org/GNOME/gjs/merge_requests/403
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.gnome.org/GNOME/gjs/commit/14bae0e2bc7e817f53f0dcd8ecd032f554d12e6f.patch";
|
||||||
|
sha256 = "4eaNl2ddRMlUfBoOUnRy10+RlQR4f/mDMhjQ2txmRcg=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.gnome.org/GNOME/gjs/commit/075f015d7980dc94fff48a1c4021cb50691dddb1.patch";
|
||||||
|
sha256 = "Iw0XfGiOUazDbpT5SqFx3UVvBRtNm3Fds1gCsdxKucw=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.gnome.org/GNOME/gjs/commit/5cfd2c2ffd2d8c002d40f658e1c54027dc5d8506.patch";
|
||||||
|
sha256 = "rJ5Je1zcfthIl7+hRoWw3cwzz/ZkS2rtjvFOQ8znBi8=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.gnome.org/GNOME/gjs/commit/1a81f40e8783fe97dd00f009eb0d9ad45297e831.patch";
|
||||||
|
sha256 = "+k4Xv3sJ//iDqkVTkO51IA7FPtWsS0P9YUVTWnIym4I=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.gnome.org/GNOME/gjs/commit/361a319789310292787d9c62665cef9e386a9b20.patch";
|
||||||
|
sha256 = "ofOP1OFs9q5nW9rE/2ovbwZR6gTrDDh8cczdYipoWNE=";
|
||||||
|
})
|
||||||
|
|
||||||
|
# Allow installing installed tests to a separate output.
|
||||||
|
./installed-tests-path.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
# Gio test is failing
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/81626#issuecomment-599325843
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
for f in installed-tests/*.test.in; do
|
substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console
|
||||||
substituteInPlace "$f" --subst-var-by pkglibexecdir "$installedTests/libexec/gjs"
|
'';
|
||||||
done
|
|
||||||
|
preCheck = ''
|
||||||
|
# Our gobject-introspection patches make the shared library paths absolute
|
||||||
|
# in the GIR files. When running tests, the library is not yet installed,
|
||||||
|
# though, so we need to replace the absolute path with a local one during build.
|
||||||
|
# We are using a symlink that will be overridden during installation.
|
||||||
|
mkdir -p $out/lib $installedTests/libexec/gjs/installed-tests
|
||||||
|
ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0
|
||||||
|
ln -s $PWD/installed-tests/js/libgimarshallingtests.so $installedTests/libexec/gjs/installed-tests/libgimarshallingtests.so
|
||||||
|
ln -s $PWD/installed-tests/js/libregress.so $installedTests/libexec/gjs/installed-tests/libregress.so
|
||||||
|
ln -s $PWD/installed-tests/js/libwarnlib.so $installedTests/libexec/gjs/installed-tests/libwarnlib.so
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
moveToOutput "share/installed-tests" "$installedTests"
|
|
||||||
moveToOutput "libexec/gjs/installed-tests" "$installedTests"
|
|
||||||
|
|
||||||
wrapProgram "$installedTests/libexec/gjs/installed-tests/minijasmine" \
|
wrapProgram "$installedTests/libexec/gjs/installed-tests/minijasmine" \
|
||||||
--prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" [ gtk3 atk pango.out gdk-pixbuf ]}:$installedTests/libexec/gjs/installed-tests"
|
--prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" testDeps}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
checkPhase = ''
|
||||||
|
runHook preCheck
|
||||||
|
xvfb-run -s '-screen 0 800x600x24' \
|
||||||
|
meson test --print-errorlogs
|
||||||
|
runHook postCheck
|
||||||
'';
|
'';
|
||||||
|
|
||||||
separateDebugInfo = stdenv.isLinux;
|
separateDebugInfo = stdenv.isLinux;
|
||||||
|
13
pkgs/development/libraries/gjs/fix-paths.patch
Normal file
13
pkgs/development/libraries/gjs/fix-paths.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/installed-tests/debugger-test.sh b/installed-tests/debugger-test.sh
|
||||||
|
index 0d118490..54c5507e 100755
|
||||||
|
--- a/installed-tests/debugger-test.sh
|
||||||
|
+++ b/installed-tests/debugger-test.sh
|
||||||
|
@@ -3,7 +3,7 @@
|
||||||
|
if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then
|
||||||
|
gjs="$TOP_BUILDDIR/gjs-console"
|
||||||
|
else
|
||||||
|
- gjs=gjs-console
|
||||||
|
+ gjs=@gjsConsole@
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1..1
|
24
pkgs/development/libraries/gjs/installed-tests-path.patch
Normal file
24
pkgs/development/libraries/gjs/installed-tests-path.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
diff --git a/installed-tests/meson.build b/installed-tests/meson.build
|
||||||
|
index 294d20c6..1e5029e0 100644
|
||||||
|
--- a/installed-tests/meson.build
|
||||||
|
+++ b/installed-tests/meson.build
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
### Installed tests ############################################################
|
||||||
|
|
||||||
|
-installed_tests_execdir = get_option('prefix') / pkglibexecdir / 'installed-tests'
|
||||||
|
-installed_tests_metadir = abs_datadir / 'installed-tests' / meson.project_name()
|
||||||
|
+installed_tests_execdir = get_option('installed_test_prefix') / 'libexec' / meson.project_name() / 'installed-tests'
|
||||||
|
+installed_tests_metadir = get_option('installed_test_prefix') / 'share' / 'installed-tests' / meson.project_name()
|
||||||
|
|
||||||
|
# Simple shell script tests #
|
||||||
|
|
||||||
|
diff --git a/meson_options.txt b/meson_options.txt
|
||||||
|
index 66f66024..008687cb 100644
|
||||||
|
--- a/meson_options.txt
|
||||||
|
+++ b/meson_options.txt
|
||||||
|
@@ -25,3 +25,5 @@ option('skip_gtk_tests', type: 'boolean', value: false,
|
||||||
|
description: 'Skip tests that need a display connection')
|
||||||
|
option('verbose_logs', type: 'boolean', value: false,
|
||||||
|
description: 'Enable extra log messages that may decrease performance (not allowed in release builds)')
|
||||||
|
+option('installed_test_prefix', type: 'string', value: '',
|
||||||
|
+ description: 'Prefix for installed tests')
|
Loading…
x
Reference in New Issue
Block a user