2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, dbus
|
|
|
|
, libgcrypt
|
|
|
|
, pam
|
2022-03-30 09:31:56 +00:00
|
|
|
, python3
|
2021-05-20 23:08:51 +00:00
|
|
|
, glib
|
|
|
|
, libxslt
|
|
|
|
, gettext
|
|
|
|
, gcr
|
|
|
|
, libcap_ng
|
|
|
|
, libselinux
|
|
|
|
, p11-kit
|
|
|
|
, openssh
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2021-05-20 23:08:51 +00:00
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, gnome
|
2023-03-04 12:14:45 +00:00
|
|
|
, useWrappedDaemon ? true
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gnome-keyring";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "46.2";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-05-20 23:08:51 +00:00
|
|
|
url = "mirror://gnome/sources/gnome-keyring/${lib.versions.major version}/${pname}-${version}.tar.xz";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-vybJZriot/MoXsyLs+RnucIPlTW5TcRRycVZ3c/2GSU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
gettext
|
|
|
|
libxslt
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_43
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
glib
|
|
|
|
libgcrypt
|
|
|
|
pam
|
|
|
|
openssh
|
|
|
|
libcap_ng
|
|
|
|
libselinux
|
|
|
|
gcr
|
|
|
|
p11-kit
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ dbus python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-pkcs11-config=${placeholder "out"}/etc/pkcs11/" # installation directories
|
|
|
|
"--with-pkcs11-modules=${placeholder "out"}/lib/pkcs11/"
|
2024-05-15 15:35:15 +00:00
|
|
|
# gnome-keyring doesn't build with ssh-agent by default anymore, we need to
|
|
|
|
# switch to using gcr https://github.com/NixOS/nixpkgs/issues/140824
|
|
|
|
"--enable-ssh-agent"
|
2024-06-05 15:53:02 +00:00
|
|
|
# cross compilation requires these paths to be explicitly declared:
|
|
|
|
"LIBGCRYPT_CONFIG=${lib.getExe' (lib.getDev libgcrypt) "libgcrypt-config"}"
|
|
|
|
"SSH_ADD=${lib.getExe' openssh "ssh-add"}"
|
|
|
|
"SSH_AGENT=${lib.getExe' openssh "ssh-agent"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Tends to fail non-deterministically.
|
|
|
|
# - https://github.com/NixOS/nixpkgs/issues/55293
|
|
|
|
# - https://github.com/NixOS/nixpkgs/issues/51121
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs build
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
dbus-run-session \
|
2022-12-02 08:20:57 +00:00
|
|
|
--config-file=${dbus}/share/dbus-1/session.conf \
|
2020-04-24 23:36:52 +00:00
|
|
|
make check
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Use wrapped gnome-keyring-daemon with cap_ipc_lock=ep
|
2023-03-04 12:14:45 +00:00
|
|
|
postFixup = lib.optionalString useWrappedDaemon ''
|
2020-04-24 23:36:52 +00:00
|
|
|
files=($out/etc/xdg/autostart/* $out/share/dbus-1/services/*)
|
|
|
|
|
|
|
|
for file in ''${files[*]}; do
|
|
|
|
substituteInPlace $file \
|
|
|
|
--replace "$out/bin/gnome-keyring-daemon" "/run/wrappers/bin/gnome-keyring-daemon"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
2021-05-20 23:08:51 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2020-04-24 23:36:52 +00:00
|
|
|
packageName = "gnome-keyring";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Collection of components in GNOME that store secrets, passwords, keys, certificates and make them available to applications";
|
2024-05-15 15:35:15 +00:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/gnome-keyring";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = teams.gnome.members;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|