1{ lib, stdenv
2, fetchurl
3, pkg-config
4, meson
5, ninja
6, gettext
7, gnupg
8, p11-kit
9, glib
10, libgcrypt
11, libtasn1
12, gtk3
13, pango
14, libsecret
15, openssh
16, systemd
17, gobject-introspection
18, makeWrapper
19, libxslt
20, vala
21, gnome
22, python3
23, shared-mime-info
24}:
25
26stdenv.mkDerivation rec {
27 pname = "gcr";
28 version = "3.41.0";
29
30 outputs = [ "out" "dev" ];
31
32 src = fetchurl {
33 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
34 sha256 = "CQn8SeqK1IMtJ1ZP8v0dxmZpbioHxzlBxIgp5gVy2gE=";
35 };
36
37 nativeBuildInputs = [
38 pkg-config
39 meson
40 python3
41 ninja
42 gettext
43 gobject-introspection
44 libxslt
45 makeWrapper
46 vala
47 shared-mime-info
48 ];
49
50 buildInputs = [
51 gnupg
52 libgcrypt
53 libtasn1
54 pango
55 libsecret
56 openssh
57 systemd
58 ];
59
60 propagatedBuildInputs = [
61 glib
62 gtk3
63 p11-kit
64 ];
65
66 checkInputs = [
67 python3
68 ];
69
70 mesonFlags = [
71 "-Dgtk_doc=false"
72 # We are still using ssh-agent from gnome-keyring.
73 # https://github.com/NixOS/nixpkgs/issues/140824
74 "-Dssh_agent=false"
75 ];
76
77 doCheck = false; # fails 21 out of 603 tests, needs dbus daemon
78
79 PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
80
81 postPatch = ''
82 patchShebangs build/ gcr/fixtures/
83
84 chmod +x meson_post_install.py
85 patchShebangs meson_post_install.py
86 '';
87
88 preFixup = ''
89 wrapProgram "$out/bin/gcr-viewer" \
90 --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
91 '';
92
93 passthru = {
94 updateScript = gnome.updateScript {
95 packageName = pname;
96 };
97 };
98
99 meta = with lib; {
100 platforms = platforms.unix;
101 maintainers = teams.gnome.members;
102 description = "GNOME crypto services (daemon and tools)";
103 homepage = "https://gitlab.gnome.org/GNOME/gcr";
104 license = licenses.lgpl2Plus;
105
106 longDescription = ''
107 GCR is a library for displaying certificates, and crypto UI, accessing
108 key stores. It also provides the viewer for crypto files on the GNOME
109 desktop.
110
111 GCK is a library for accessing PKCS#11 modules like smart cards, in a
112 (G)object oriented way.
113 '';
114 };
115}