2022-02-27 11:21:37 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, lib
|
|
|
|
|
, fetchurl
|
|
|
|
|
, glib
|
2022-02-27 11:11:37 +00:00
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
2022-02-27 11:21:37 +00:00
|
|
|
|
, pkg-config
|
|
|
|
|
, gettext
|
|
|
|
|
, libxslt
|
|
|
|
|
, python3
|
|
|
|
|
, docbook-xsl-nons
|
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
|
, libgcrypt
|
|
|
|
|
, gobject-introspection
|
2023-03-01 16:02:57 +00:00
|
|
|
|
, buildPackages
|
|
|
|
|
, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages
|
2022-02-27 11:21:37 +00:00
|
|
|
|
, vala
|
2022-02-27 11:11:37 +00:00
|
|
|
|
, gi-docgen
|
2022-02-27 11:21:37 +00:00
|
|
|
|
, gnome
|
|
|
|
|
, gjs
|
|
|
|
|
, libintl
|
|
|
|
|
, dbus
|
|
|
|
|
}:
|
2018-08-08 19:53:09 +01:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-03-03 05:24:48 +00:00
|
|
|
|
pname = "libsecret";
|
2022-02-27 11:11:37 +00:00
|
|
|
|
version = "0.20.5";
|
2013-06-21 18:59:20 +01:00
|
|
|
|
|
2023-03-01 16:02:57 +00:00
|
|
|
|
outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc";
|
2022-02-27 11:21:37 +00:00
|
|
|
|
|
2013-06-21 18:59:20 +01:00
|
|
|
|
src = fetchurl {
|
2021-01-21 17:00:13 +00:00
|
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2022-02-27 11:11:37 +00:00
|
|
|
|
sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00=";
|
2013-06-21 18:59:20 +01:00
|
|
|
|
};
|
|
|
|
|
|
2022-07-07 19:34:37 +01:00
|
|
|
|
depsBuildBuild = [
|
|
|
|
|
pkg-config
|
|
|
|
|
];
|
|
|
|
|
|
2022-02-27 11:21:37 +00:00
|
|
|
|
nativeBuildInputs = [
|
2022-02-27 11:11:37 +00:00
|
|
|
|
meson
|
|
|
|
|
ninja
|
2022-02-27 11:21:37 +00:00
|
|
|
|
pkg-config
|
|
|
|
|
gettext
|
2022-02-27 11:11:37 +00:00
|
|
|
|
libxslt # for xsltproc for building man pages
|
2022-02-27 11:21:37 +00:00
|
|
|
|
docbook-xsl-nons
|
|
|
|
|
docbook_xml_dtd_42
|
|
|
|
|
libintl
|
|
|
|
|
vala
|
|
|
|
|
glib
|
2023-03-01 16:02:57 +00:00
|
|
|
|
] ++ lib.optionals withIntrospection [
|
|
|
|
|
gi-docgen
|
|
|
|
|
gobject-introspection
|
2022-02-27 11:21:37 +00:00
|
|
|
|
];
|
2018-08-08 19:53:09 +01:00
|
|
|
|
|
2022-02-27 11:21:37 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
libgcrypt
|
|
|
|
|
];
|
2017-01-10 14:23:16 +00:00
|
|
|
|
|
2022-02-27 11:21:37 +00:00
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
glib
|
|
|
|
|
];
|
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
|
nativeCheckInputs = [
|
2022-02-27 11:21:37 +00:00
|
|
|
|
python3
|
|
|
|
|
python3.pkgs.dbus-python
|
|
|
|
|
python3.pkgs.pygobject3
|
|
|
|
|
dbus
|
|
|
|
|
gjs
|
2020-01-26 22:44:16 +00:00
|
|
|
|
];
|
2013-06-21 18:59:20 +01:00
|
|
|
|
|
2023-03-01 16:02:57 +00:00
|
|
|
|
mesonFlags = [
|
|
|
|
|
(lib.mesonBool "introspection" withIntrospection)
|
|
|
|
|
(lib.mesonBool "gtk_doc" withIntrospection)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
doCheck = stdenv.isLinux && withIntrospection;
|
2022-02-27 11:21:37 +00:00
|
|
|
|
|
2022-02-27 11:21:37 +00:00
|
|
|
|
postPatch = ''
|
2022-04-06 02:34:36 +01:00
|
|
|
|
patchShebangs ./tool/test-*.sh
|
2022-02-27 11:21:37 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2022-02-28 14:10:40 +00:00
|
|
|
|
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
|
2022-02-27 11:21:37 +00:00
|
|
|
|
|
2022-02-28 14:10:40 +00:00
|
|
|
|
dbus-run-session \
|
2022-11-21 02:03:50 +00:00
|
|
|
|
--config-file=${dbus}/share/dbus-1/session.conf \
|
2023-02-09 22:16:52 +00:00
|
|
|
|
meson test --print-errorlogs --timeout-multiplier 0
|
2022-02-27 11:21:37 +00:00
|
|
|
|
|
2022-02-28 14:10:40 +00:00
|
|
|
|
runHook postCheck
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
|
# This is test-only so it won’t be overwritten during installation.
|
|
|
|
|
rm "$out/lib/libmock-service.so"
|
2018-09-05 01:50:56 +01:00
|
|
|
|
'';
|
2018-08-08 19:53:09 +01:00
|
|
|
|
|
2022-02-27 11:11:37 +00:00
|
|
|
|
postFixup = ''
|
|
|
|
|
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
|
|
|
|
|
moveToOutput "share/doc" "$devdoc"
|
|
|
|
|
'';
|
|
|
|
|
|
2018-03-03 05:24:48 +00:00
|
|
|
|
passthru = {
|
2021-05-07 22:18:14 +01:00
|
|
|
|
updateScript = gnome.updateScript {
|
2018-03-03 05:24:48 +00:00
|
|
|
|
packageName = pname;
|
2019-10-07 07:02:36 +01:00
|
|
|
|
# Does not seem to use the odd-unstable policy: https://gitlab.gnome.org/GNOME/libsecret/issues/30
|
|
|
|
|
versionPolicy = "none";
|
2018-03-03 05:24:48 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2013-06-21 18:59:20 +01:00
|
|
|
|
meta = {
|
2015-04-10 09:24:42 +01:00
|
|
|
|
description = "A library for storing and retrieving passwords and other secrets";
|
2020-04-01 02:11:51 +01:00
|
|
|
|
homepage = "https://wiki.gnome.org/Projects/Libsecret";
|
2021-01-21 17:00:13 +00:00
|
|
|
|
license = lib.licenses.lgpl21Plus;
|
2022-05-05 01:52:27 +01:00
|
|
|
|
mainProgram = "secret-tool";
|
2013-06-21 18:59:20 +01:00
|
|
|
|
inherit (glib.meta) platforms maintainers;
|
|
|
|
|
};
|
|
|
|
|
}
|