libsecret: fix tests

This commit is contained in:
Jan Tojnar
2022-02-28 15:10:40 +01:00
parent d56a0b9d72
commit 821703c0d2
@@ -18,7 +18,6 @@
, gjs
, libintl
, dbus
, xvfb-run
}:
stdenv.mkDerivation rec {
@@ -55,32 +54,44 @@ stdenv.mkDerivation rec {
glib
];
installCheckInputs = [
checkInputs = [
python3
python3.pkgs.dbus-python
python3.pkgs.pygobject3
xvfb-run
dbus
gjs
];
# needs to run after install because typelibs point to absolute paths
doInstallCheck = false; # Failed to load shared library '/force/shared/libmock_service.so.0' referenced by the typelib
doCheck = true;
postPatch = ''
patchShebangs \
./tool/test-*.sh
'';
installCheckPhase = ''
runHook preInstallCheck
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 overwitten during installation.
mkdir -p $out/lib $out/lib
ln -s "$PWD/libsecret/libmock-service.so" "$out/lib/libmock-service.so"
ln -s "$PWD/libsecret/libsecret-1.so.0" "$out/lib/libsecret-1.so.0"
'';
export NO_AT_BRIDGE=1
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
checkPhase = ''
runHook preCheck
dbus-run-session \
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
meson test --print-errorlogs
runHook postInstallCheck
runHook postCheck
'';
postCheck = ''
# This is test-only so it wont be overwritten during installation.
rm "$out/lib/libmock-service.so"
'';
postFixup = ''