nixpkgs-suyu/pkgs/development/libraries/libsecret/default.nix
Jan Tojnar e15ae73b7a libsecret: fix build on darwin
Remove unnecessary xvfb-run, accidentally re-introduced in
a42ca0678b

And only run tests on Linux, since gjs dependency is not supported on Darwin.
2022-04-06 03:34:36 +02:00

115 lines
2.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ stdenv
, lib
, fetchurl
, glib
, meson
, ninja
, pkg-config
, gettext
, libxslt
, python3
, docbook-xsl-nons
, docbook_xml_dtd_42
, libgcrypt
, gobject-introspection
, vala
, gi-docgen
, gnome
, gjs
, libintl
, dbus
}:
stdenv.mkDerivation rec {
pname = "libsecret";
version = "0.20.5";
outputs = [ "out" "dev" "devdoc" ];
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
libxslt # for xsltproc for building man pages
docbook-xsl-nons
docbook_xml_dtd_42
libintl
gobject-introspection
vala
gi-docgen
glib
];
buildInputs = [
libgcrypt
];
propagatedBuildInputs = [
glib
];
checkInputs = [
python3
python3.pkgs.dbus-python
python3.pkgs.pygobject3
dbus
gjs
];
doCheck = stdenv.isLinux;
postPatch = ''
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"
'';
checkPhase = ''
runHook preCheck
dbus-run-session \
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
meson test --print-errorlogs
runHook postCheck
'';
postCheck = ''
# This is test-only so it wont be overwritten during installation.
rm "$out/lib/libmock-service.so"
'';
postFixup = ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
moveToOutput "share/doc" "$devdoc"
'';
passthru = {
updateScript = gnome.updateScript {
packageName = pname;
# Does not seem to use the odd-unstable policy: https://gitlab.gnome.org/GNOME/libsecret/issues/30
versionPolicy = "none";
};
};
meta = {
description = "A library for storing and retrieving passwords and other secrets";
homepage = "https://wiki.gnome.org/Projects/Libsecret";
license = lib.licenses.lgpl21Plus;
inherit (glib.meta) platforms maintainers;
};
}