about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libsecret
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/libraries/libsecret
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libsecret')
-rw-r--r--nixpkgs/pkgs/development/libraries/libsecret/default.nix41
1 files changed, 31 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libsecret/default.nix b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
index 9e8be02aa63a..24a34a92f3c1 100644
--- a/nixpkgs/pkgs/development/libraries/libsecret/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
@@ -18,7 +18,6 @@
 , gjs
 , libintl
 , dbus
-, xvfb-run
 }:
 
 stdenv.mkDerivation rec {
@@ -32,6 +31,10 @@ stdenv.mkDerivation rec {
     sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00=";
   };
 
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -49,33 +52,50 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     libgcrypt
+    gobject-introspection
   ];
 
   propagatedBuildInputs = [
     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 = stdenv.isLinux;
 
   postPatch = ''
-    patchShebangs .
+    patchShebangs ./tool/test-*.sh
+  '';
+
+  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"
   '';
 
-  installCheckPhase = ''
-    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 \
-      make check
+      meson test --print-errorlogs
+
+    runHook postCheck
+  '';
+
+  postCheck = ''
+    # This is test-only so it won’t be overwritten during installation.
+    rm "$out/lib/libmock-service.so"
   '';
 
   postFixup = ''
@@ -95,6 +115,7 @@ stdenv.mkDerivation rec {
     description = "A library for storing and retrieving passwords and other secrets";
     homepage = "https://wiki.gnome.org/Projects/Libsecret";
     license = lib.licenses.lgpl21Plus;
+    mainProgram = "secret-tool";
     inherit (glib.meta) platforms maintainers;
   };
 }