2022-03-30 09:31:56 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, lib
|
|
|
|
|
, fetchurl
|
|
|
|
|
, glib
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
|
|
|
|
, pkg-config
|
|
|
|
|
, gettext
|
|
|
|
|
, libxslt
|
|
|
|
|
, python3
|
|
|
|
|
, docbook-xsl-nons
|
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
|
, libgcrypt
|
|
|
|
|
, gobject-introspection
|
2023-03-15 16:39:30 +00:00
|
|
|
|
, buildPackages
|
|
|
|
|
, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages
|
2022-03-30 09:31:56 +00:00
|
|
|
|
, vala
|
|
|
|
|
, gi-docgen
|
|
|
|
|
, gnome
|
|
|
|
|
, gjs
|
|
|
|
|
, libintl
|
|
|
|
|
, dbus
|
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "libsecret";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
version = "0.20.5";
|
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
|
outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
|
depsBuildBuild = [
|
|
|
|
|
pkg-config
|
|
|
|
|
];
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
nativeBuildInputs = [
|
2022-03-30 09:31:56 +00:00
|
|
|
|
meson
|
|
|
|
|
ninja
|
|
|
|
|
pkg-config
|
|
|
|
|
gettext
|
|
|
|
|
libxslt # for xsltproc for building man pages
|
|
|
|
|
docbook-xsl-nons
|
|
|
|
|
docbook_xml_dtd_42
|
|
|
|
|
libintl
|
|
|
|
|
vala
|
|
|
|
|
glib
|
2023-03-15 16:39:30 +00:00
|
|
|
|
] ++ lib.optionals withIntrospection [
|
|
|
|
|
gi-docgen
|
|
|
|
|
gobject-introspection
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
libgcrypt
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
glib
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
|
nativeCheckInputs = [
|
2022-03-30 09:31:56 +00:00
|
|
|
|
python3
|
|
|
|
|
python3.pkgs.dbus-python
|
|
|
|
|
python3.pkgs.pygobject3
|
|
|
|
|
dbus
|
|
|
|
|
gjs
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
|
mesonFlags = [
|
|
|
|
|
(lib.mesonBool "introspection" withIntrospection)
|
|
|
|
|
(lib.mesonBool "gtk_doc" withIntrospection)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
doCheck = stdenv.isLinux && withIntrospection;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
separateDebugInfo = true;
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-04-15 01:41:22 +00:00
|
|
|
|
patchShebangs ./tool/test-*.sh
|
2022-03-30 09:31:56 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2022-04-15 01:41:22 +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
|
|
|
|
|
|
|
|
|
|
dbus-run-session \
|
2022-12-02 08:20:57 +00:00
|
|
|
|
--config-file=${dbus}/share/dbus-1/session.conf \
|
2023-03-04 12:14:45 +00:00
|
|
|
|
meson test --print-errorlogs --timeout-multiplier 0
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
|
# This is test-only so it won’t be overwritten during installation.
|
|
|
|
|
rm "$out/lib/libmock-service.so"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
|
postFixup = ''
|
|
|
|
|
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
|
|
|
|
|
moveToOutput "share/doc" "$devdoc"
|
|
|
|
|
'';
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
passthru = {
|
2021-05-20 23:08:51 +00:00
|
|
|
|
updateScript = gnome.updateScript {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
license = lib.licenses.lgpl21Plus;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
mainProgram = "secret-tool";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
inherit (glib.meta) platforms maintainers;
|
|
|
|
|
};
|
|
|
|
|
}
|