1{
2 pkgs,
3 stdenv,
4 lib,
5 fetchurl,
6 pkg-config,
7 meson,
8 ninja,
9 gettext,
10 gnupg,
11 p11-kit,
12 glib,
13 libgcrypt,
14 libtasn1,
15 gtk4,
16 pango,
17 libsecret,
18 openssh,
19 systemd,
20 gobject-introspection,
21 wrapGAppsHook4,
22 vala,
23 gi-docgen,
24 gnome,
25 python3,
26 shared-mime-info,
27 systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd,
28}:
29let
30 ini = pkgs.formats.ini { };
31in
32stdenv.mkDerivation (finalAttrs: {
33 pname = "gcr";
34 version = "4.4.0.1";
35
36 outputs = [
37 "out"
38 "bin"
39 "dev"
40 "devdoc"
41 ];
42
43 src = fetchurl {
44 url = "mirror://gnome/sources/gcr/${lib.versions.majorMinor finalAttrs.version}/gcr-${finalAttrs.version}.tar.xz";
45 hash = "sha256-DDw0Hkn59PJTKkiEUJgEGQoMJmPmEgNguymMXRdKgJg=";
46 };
47
48 strictDeps = true;
49
50 nativeBuildInputs = [
51 pkg-config
52 meson
53 ninja
54 gettext
55 gobject-introspection
56 gi-docgen
57 wrapGAppsHook4
58 vala
59 gi-docgen
60 shared-mime-info
61 ];
62
63 buildInputs = [
64 libgcrypt
65 libtasn1
66 pango
67 libsecret
68 openssh
69 gtk4
70 ]
71 ++ lib.optionals systemdSupport [
72 systemd
73 ];
74
75 propagatedBuildInputs = [
76 glib
77 p11-kit
78 ];
79
80 nativeCheckInputs = [
81 python3
82 ];
83
84 mesonFlags = [
85 "-Dgpg_path=${lib.getBin gnupg}/bin/gpg"
86 (lib.mesonEnable "systemd" systemdSupport)
87 "--cross-file=${
88 ini.generate "cross-file.conf" {
89 binaries = {
90 ssh-add = "'${lib.getExe' openssh "ssh-add"}'";
91 ssh-agent = "'${lib.getExe' openssh "ssh-agent"}'";
92 }
93 // lib.optionalAttrs systemdSupport {
94 systemctl = "'${lib.getExe' systemd "systemctl"}'";
95 };
96 }
97 }"
98 ];
99
100 doCheck = false; # fails 21 out of 603 tests, needs dbus daemon
101
102 PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
103
104 postPatch = ''
105 patchShebangs gcr/fixtures/
106 '';
107
108 postFixup = ''
109 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
110 moveToOutput "share/doc" "$devdoc"
111 '';
112
113 passthru = {
114 updateScript = gnome.updateScript {
115 attrPath = "gcr_4";
116 packageName = "gcr";
117 versionPolicy = "ninety-micro-unstable";
118 };
119 };
120
121 meta = with lib; {
122 platforms = platforms.unix;
123 teams = [ teams.gnome ];
124 description = "GNOME crypto services (daemon and tools)";
125 mainProgram = "gcr-viewer-gtk4";
126 homepage = "https://gitlab.gnome.org/GNOME/gcr";
127 license = licenses.lgpl2Plus;
128
129 longDescription = ''
130 GCR is a library for displaying certificates, and crypto UI, accessing
131 key stores. It also provides the viewer for crypto files on the GNOME
132 desktop.
133
134 GCK is a library for accessing PKCS#11 modules like smart cards, in a
135 (G)object oriented way.
136 '';
137 };
138})