fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv
2, lib
3, fetchurl
4, fetchpatch2
5, glib
6, meson
7, ninja
8, pkg-config
9, gettext
10, libxslt
11, python3
12, docbook-xsl-nons
13, docbook_xml_dtd_42
14, libgcrypt
15, gobject-introspection
16, buildPackages
17, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
18, vala
19, gi-docgen
20, gnome
21, gjs
22, libintl
23, dbus
24}:
25
26stdenv.mkDerivation rec {
27 pname = "libsecret";
28 version = "0.21.4";
29
30 outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc";
31
32 src = fetchurl {
33 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
34 hash = "sha256-Fj0I14O+bUq5qXnOtaT+y8HZZg08NBaMWBMBzVORKyA=";
35 };
36
37 patches = [
38 # https://gitlab.gnome.org/GNOME/libsecret/-/merge_requests/141
39 (fetchpatch2 {
40 url = "https://gitlab.gnome.org/GNOME/libsecret/-/commit/208989323211c756dff690115e5cbde5ef7491ce.patch";
41 hash = "sha256-DtRbqyyoMttEYf6B16m9O72Yjurv6rpbnqH7AlrAU4k=";
42 })
43 ];
44
45 depsBuildBuild = [
46 pkg-config
47 ];
48
49 nativeBuildInputs = [
50 meson
51 ninja
52 pkg-config
53 gettext
54 libxslt # for xsltproc for building man pages
55 docbook-xsl-nons
56 docbook_xml_dtd_42
57 libintl
58 vala
59 glib
60 ] ++ lib.optionals withIntrospection [
61 gi-docgen
62 gobject-introspection
63 ];
64
65 buildInputs = [
66 libgcrypt
67 ];
68
69 propagatedBuildInputs = [
70 glib
71 ];
72
73 nativeCheckInputs = [
74 python3
75 python3.pkgs.dbus-python
76 python3.pkgs.pygobject3
77 dbus
78 gjs
79 ];
80
81 mesonFlags = [
82 (lib.mesonBool "introspection" withIntrospection)
83 (lib.mesonBool "gtk_doc" withIntrospection)
84 ];
85
86 doCheck = stdenv.isLinux && withIntrospection;
87 separateDebugInfo = true;
88
89 postPatch = ''
90 patchShebangs ./tool/test-*.sh
91 '';
92
93 preCheck = ''
94 # Our gobject-introspection patches make the shared library paths absolute
95 # in the GIR files. When running tests, the library is not yet installed,
96 # though, so we need to replace the absolute path with a local one during build.
97 # We are using a symlink that will be overwitten during installation.
98 mkdir -p $out/lib $out/lib
99 ln -s "$PWD/libsecret/libmock-service.so" "$out/lib/libmock-service.so"
100 ln -s "$PWD/libsecret/libsecret-1.so.0" "$out/lib/libsecret-1.so.0"
101 '';
102
103 checkPhase = ''
104 runHook preCheck
105
106 dbus-run-session \
107 --config-file=${dbus}/share/dbus-1/session.conf \
108 meson test --print-errorlogs --timeout-multiplier 0
109
110 runHook postCheck
111 '';
112
113 postCheck = ''
114 # This is test-only so it won’t be overwritten during installation.
115 rm "$out/lib/libmock-service.so"
116 '';
117
118 postFixup = ''
119 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
120 moveToOutput "share/doc" "$devdoc"
121 '';
122
123 passthru = {
124 updateScript = gnome.updateScript {
125 packageName = pname;
126 # Does not seem to use the odd-unstable policy: https://gitlab.gnome.org/GNOME/libsecret/issues/30
127 versionPolicy = "none";
128 };
129 };
130
131 meta = {
132 description = "A library for storing and retrieving passwords and other secrets";
133 homepage = "https://gitlab.gnome.org/GNOME/libsecret";
134 license = lib.licenses.lgpl21Plus;
135 mainProgram = "secret-tool";
136 inherit (glib.meta) platforms maintainers;
137 };
138}