projects/guix·blob javascript-team · refs

328 lines · 13.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016, 2017, 2022 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2017, 2018, 2022 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2020 Efraim Flashner <[email protected]>
5;;; Copyright © 2021, 2024 Timotej Lazar <[email protected]>
6;;; Copyright © 2021, 2022 Remco van 't Veer <[email protected]>
7;;; Copyright © 2023 Maxim Cournoyer <[email protected]>
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages sssd)
25 #:use-module (gnu packages algebra)
26 #:use-module (gnu packages augeas)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages bash)
29 #:use-module (gnu packages check)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages crypto)
32 #:use-module (gnu packages curl)
33 #:use-module (gnu packages cyrus-sasl)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages dns)
36 #:use-module (gnu packages dns)
37 #:use-module (gnu packages docbook)
38 #:use-module (gnu packages documentation)
39 #:use-module (gnu packages gettext)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages jose)
42 #:use-module (gnu packages kerberos)
43 #:use-module (gnu packages libunistring)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages nss)
46 #:use-module (gnu packages openldap)
47 #:use-module (gnu packages pcre)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages popt)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages python-build)
52 #:use-module (gnu packages samba)
53 #:use-module (gnu packages security-token)
54 #:use-module (gnu packages selinux)
55 #:use-module (gnu packages ssh)
56 #:use-module (gnu packages tls)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages xml)
59 #:use-module (gnu packages)
60 #:use-module (guix build utils)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system pyproject)
63 #:use-module (guix download)
64 #:use-module (guix gexp)
65 #:use-module (guix git-download)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix modules)
68 #:use-module (guix packages)
69 #:use-module (guix utils))
70
71(define-public adcli
72 (package
73 (name "adcli")
74 (version "0.9.2")
75 (source
76 (origin
77 (method git-fetch)
78 (uri (git-reference
79 (url "https://gitlab.freedesktop.org/realmd/adcli.git")
80 (commit version)))
81 (file-name (git-file-name name version))
82 (sha256
83 (base32 "1lg181hpv07zcdybpykjq6h4v6f5sjc60gxqbklm0wqxa8m4sakn"))))
84 (build-system gnu-build-system)
85 (arguments
86 `(#:configure-flags
87 ;; The net tool is used to update the stored machine key for samba.
88 (list (string-append "--with-samba-data-tool="
89 (search-input-file %build-inputs "bin/net")))))
90 (native-inputs
91 (list autoconf
92 automake
93 docbook-xml-4.3
94 docbook-xsl
95 libtool
96 libxslt
97 util-linux ;For `rev` command used in tests.
98 xmlto))
99 (inputs (list cyrus-sasl mit-krb5 samba openldap zlib))
100 (home-page "https://gitlab.freedesktop.org/realmd/adcli/")
101 (synopsis "Helper library and tools for Active Directory client operations")
102 (description "@command{adcli} is a command‐line tool to join a computer to
103an Active Directory domain. It can also update the machine password and
104manage user, group and computer accounts for a domain.")
105 (license license:lgpl2.1+)))
106
107(define-public ding-libs
108 (package
109 (name "ding-libs")
110 (version "0.6.2")
111 (source
112 (origin
113 (method git-fetch)
114 (uri (git-reference
115 (url "https://github.com/SSSD/ding-libs")
116 (commit version)))
117 (file-name (git-file-name name version))
118 (sha256
119 (base32 "17x3gj2yrjb6h7ml97xlim310x8s54n238p3ns2bj3mxifqkx0mf"))))
120 (build-system gnu-build-system)
121 (arguments
122 (list #:configure-flags
123 '(list "--disable-static")))
124 (native-inputs (list autoconf automake gettext-minimal libtool pkg-config))
125 (home-page "https://pagure.io/SSSD/ding-libs/")
126 (synopsis "Libraries for SSSD")
127 (description
128 "DING-LIBS (DING Is Not Glib) are a set of small, useful libraries that
129the @dfn{System Security Services Daemon} (SSSD) uses and makes available to
130other projects. They include: libdhash, an implementation of a dynamic hash
131table which will dynamically resize to achieve optimal storage and access time
132properties; ini_config, a library for parsing and managing @code{INI} files;
133path_utils, a library to manage UNIX paths and subsets of paths; collection, a
134generic, hierarchical grouping mechanism for complex data sets; ref_array, a
135dynamically-growing, reference-counted array; libbasicobjects, a set of
136fundamental object types for C.")
137 (license license:lgpl3+)))
138
139(define-public sssd
140 (package
141 (name "sssd")
142 (version "2.13.0")
143 (source
144 (origin
145 (method git-fetch)
146 (uri (git-reference
147 (url "https://github.com/SSSD/sssd")
148 (commit version)))
149 (file-name (git-file-name name version))
150 (sha256
151 (base32 "1p7zrs1ldkmzc50f3sicmy16vprzw1pjnaxvmf6rahp9xbphaczz"))
152 (patches (search-patches "sssd-system-directories.patch"))))
153 (build-system gnu-build-system)
154 (arguments
155 (list
156 #:modules '((guix build gnu-build-system)
157 (guix build utils)
158 ((guix build pyproject-build-system) #:prefix py:))
159 #:imported-modules (append %default-gnu-imported-modules
160 %pyproject-build-system-modules)
161 #:make-flags
162 #~(list (string-append "CFLAGS=-DRENEWAL_PROG_PATH=\\\""
163 #$(this-package-input "adcli") "/sbin/adcli"
164 "\\\"")
165 (string-append "DOCBOOK_XSLT="
166 #$(this-package-native-input "docbook-xsl")
167 "/xml/xsl/docbook-xsl-"
168 #$(package-version (this-package-native-input "docbook-xsl"))
169 "/manpages/docbook.xsl"))
170 #:configure-flags
171 #~(list "--localstatedir=/var" ; for /var/lib/sss, /var/run/sssd.pid, etc.
172 "--sysconfdir=/etc" ; /etc/sssd
173
174 "--disable-cifs-idmap-plugin"
175 "--without-nfsv4-idmapd-plugin"
176 (string-append "--with-plugin-path="
177 #$output "/lib/sssd")
178 (string-append "--with-krb5-plugin-path="
179 #$output "/lib/krb5/plugins/libkrb5")
180 (string-append "--with-cifs-plugin-path="
181 #$output "/lib/cifs-utils")
182 (string-append "--with-init-dir="
183 #$output "/etc/init.d")
184 (string-append "--with-ldb-lib-dir="
185 #$output "/lib/ldb/modules/ldb")
186 ;; Upstream defaults to /etc/xml/catalog, and despite the "path"
187 ;; name, only expects one file -- so we can't use
188 ;; $XML_CATALOG_FILES, which has docbook-xml and docbook-xsl
189 ;; entries.
190 (string-append "--with-xml-catalog-path="
191 #$(this-package-native-input "docbook-xml")
192 "/xml/docbook/"
193 #$(package-version (this-package-native-input "docbook-xml"))
194 "/catalog.xml"))
195 #:phases
196 #~(modify-phases %standard-phases
197 (add-after 'unpack 'ensure-no-mtimes-pre-1980
198 py:ensure-no-mtimes-pre-1980)
199 ;; sssd looks in lib/samba, but the Guix package puts things in lib/
200 ;; Patch the path before we autoreconf.
201 (add-before 'bootstrap 'patch-samba-pkgconfig
202 (lambda _
203 (substitute* '("src/external/samba.m4")
204 (("(sambalibdir=.*/)samba" _ prefix)
205 prefix))))
206 (add-after 'patch-source-shebangs 'patch-more-shebangs
207 (lambda* (#:key inputs #:allow-other-keys)
208 (substitute* '("src/tools/analyzer/sss_analyze"
209 "src/tools/sss_obfuscate")
210 (("#!/usr/bin/.*python")
211 (string-append "#!" (search-input-file inputs "bin/python3"))))))
212 (add-before 'bootstrap 'fix-configure-macros
213 (lambda* (#:key inputs #:allow-other-keys)
214 ;; A configure test for nsupdate realm support fails without this.
215 (substitute* "src/external/nsupdate.m4"
216 (("\\$NSUPDATE ") "$NSUPDATE -i "))
217 ;; Let tests find softhsm lib.
218 (substitute* "src/external/test_ca.m4"
219 (("/usr/lib/softhsm")
220 (search-input-directory inputs "lib/softhsm")))))
221 (add-before 'configure 'disable-failing-tests
222 (lambda _
223 (substitute* "Makefile.am"
224 ;; Disable tests that need /etc/passwd.
225 (("pam-srv-tests") "")
226 (("test-negcache") "")
227 ;; Disable tests that need the root user.
228 (("src/config/SSSDConfigTest\\.py3\\.sh") ""))
229 ;; This test fails for unknown reason.
230 (substitute* "src/tests/responder_socket_access-tests.c"
231 (("tcase_add_test\\(tc_utils, resp_str_to_array_test\\);") ""))))
232 (add-before 'configure 'disable-active-directory-tests
233 ;; These tests require Active Directory running in a VM.
234 (lambda _
235 (substitute* "Makefile.am"
236 (("ad_gpo_tests") "")
237 (("ad_common_tests") ""))))
238 (add-before 'check 'set-libpython-path
239 (lambda* (#:key inputs #:allow-other-keys)
240 (setenv "LD_LIBRARY_PATH"
241 (string-append
242 (dirname (dirname
243 (search-input-file inputs "bin/python3")))
244 "/lib"))))
245 (add-after 'install 'remove-static-libs
246 (lambda _
247 ;; Remove a static library that produces a (harmless) warning
248 ;; when starting a program that uses sssd’s LDB modules.
249 (delete-file
250 (string-append #$output "/lib/ldb/modules/ldb/memberof.la"))))
251 (add-after 'install 'wrap-binaries
252 (lambda* (#:key inputs outputs #:allow-other-keys)
253 (with-directory-excursion #$output
254 ;; Set path to LDB modules for sssd and utilities.
255 (for-each (lambda (bin)
256 (wrap-program (string-append "sbin/" bin)
257 `("LDB_MODULES_PATH" ":" prefix
258 (,(string-append #$output "/lib/ldb/modules/ldb")))))
259 '("sssd" "sssctl" "sss_cache" "sss_override" "sss_seed"))
260 ;; Set path to sssd’s site-packages for scripts.
261 (for-each (lambda (script)
262 (wrap-program script
263 `("GUIX_PYTHONPATH" ":" prefix
264 (,(py:site-packages inputs outputs)))))
265 '("libexec/sssd/sss_analyze" "sbin/sss_obfuscate"))))))))
266 (inputs
267 (list adcli
268 bash-minimal
269 c-ares
270 curl ; for OpenID Connect support
271 cyrus-sasl
272 dbus
273 ding-libs
274 glib
275 gnutls
276 http-parser
277 `(,isc-bind "utils")
278 jansson
279 jose ; for OpenID Connect support
280 keyutils
281 ldb
282 libcap
283 libnl
284 libselinux
285 libsemanage
286 libunistring
287 linux-pam
288 mit-krb5
289 nss
290 openldap
291 openssl
292 p11-kit ; for PKCS#11 support
293 pcre2
294 popt
295 python ; for wrap-program phase
296 samba/pinned
297 talloc
298 tdb
299 tevent))
300 (native-inputs
301 (list autoconf
302 automake
303 bc ; for tests
304 check ; for tests
305 cmocka ; for tests
306 docbook-xml-4.5
307 docbook-xsl
308 doxygen
309 gettext-minimal
310 libfaketime ; for tests
311 libtool
312 libxml2 ; for xmllint
313 libxslt
314 openssh ; for tests
315 pkg-config
316 po4a
317 python-setuptools
318 softhsm ; for tests
319 `(,util-linux "lib"))) ; for uuid.h, required for KCM
320 (home-page "https://pagure.io/SSSD/sssd/")
321 (synopsis "System security services daemon")
322 (description "SSSD is a system daemon. Its primary function is to provide
323access to identity and authentication remote resource through a common
324framework that can provide caching and offline support to the system. It
325provides PAM and NSS modules, and in the future will support D-BUS based
326interfaces for extended user information. It also provides a better database
327to store local users as well as extended user data.")
328 (license license:gpl3+)))