projects/guix·blob python-team · refs

278 lines · 12.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Sou Bunnbu <[email protected]>
3;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2019 Andrew Miloradovsky <[email protected]>
5;;; Copyright © 2020, 2022 Marius Bakke <[email protected]>
6;;; Copyright © 2021 Dion Mendel <[email protected]>
7;;; Copyright © 2023 Efraim Flashner <[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 cluster)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix gexp)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix packages)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages check)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages docbook)
35 #:use-module (gnu packages compiler-tools)
36 #:use-module (gnu packages gettext)
37 #:use-module (gnu packages libevent)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages ruby-xyz)
41 #:use-module (gnu packages sphinx)
42 #:use-module (gnu packages sqlite)
43 #:use-module (gnu packages texinfo)
44 #:use-module (gnu packages tls)
45 #:use-module (gnu packages xml))
46
47(define-public drbd-utils
48 (package
49 (name "drbd-utils")
50 (version "9.31.0")
51 (source (origin
52 (method url-fetch)
53 (uri (list (string-append "https://pkg.linbit.com/downloads/drbd"
54 "/utils/drbd-utils-" version ".tar.gz")))
55 (sha256
56 (base32
57 "0z6iqc18r5y65c0zk9xr0nzr1cjy3d4zzklfs4158k0zh3ga0y3r"))
58 (modules '((guix build utils)))
59 (snippet
60 '(begin
61 (substitute* "scripts/global_common.conf"
62 ;; Do not participate in usage count survey by default.
63 (("usage-count yes")
64 "usage-count no"))
65 (substitute* "scripts/Makefile.in"
66 ;; Install the Pacemaker resource agents to the libdir,
67 ;; regardless of what the OCF specification says...
68 (("\\$\\(DESTDIR\\)/usr/lib")
69 "$(DESTDIR)$(LIBDIR)"))
70 (substitute* "configure"
71 ;; Use a sensible default udev rules directory.
72 (("default_udevdir=/lib/udev")
73 "default_udevdir='${prefix}/lib/udev'"))))))
74 (build-system gnu-build-system)
75 (arguments
76 (list
77 #:configure-flags
78 #~(append
79 (list "--sysconfdir=/etc"
80 "--localstatedir=/var"
81 ;; Do not install sysv or systemd init scripts.
82 "--with-initscripttype=none"
83 ;; Disable support for DRBD 8.3 as it is only for
84 ;; Linux-Libre versions < 3.8. 8.4 is the latest
85 ;; kernel driver as of Linux 5.18.
86 "--without-83support")
87 #$(if (this-package-native-input "ruby-asciidoctor")
88 #~'()
89 #~(list "--without-manual")))
90 #:test-target "test"
91 #:make-flags #~(list "WANT_DRBD_REPRODUCIBLE_BUILD=yesplease")
92 #:phases
93 #~(modify-phases %standard-phases
94 (add-after 'unpack 'disable-ja-translation
95 (lambda _
96 ;; XXX: The japanese documentation cannot be created due to
97 ;; several "Invalid po file" and "use of uninitialized variable"
98 ;; in po4a.
99 (substitute* "Makefile.in"
100 (("(DOC_DIRS.*)documentation/ja/v[[:digit:]]+" _ match)
101 match)
102 (("[[:blank:]]+\\$\\(MAKE\\) -C documentation/ja/v[[:digit:]]+.*")
103 ""))))
104 (add-after 'patch-generated-file-shebangs 'patch-documentation
105 (lambda _
106 ;; The preceding phase misses some Makefiles with unusual file
107 ;; names, so we handle those here.
108 (for-each patch-makefile-SHELL (find-files "documentation/common"
109 "^Makefile"))))
110 (add-before 'configure 'use-absolute-/lib/drbd
111 (lambda _
112 ;; Look for auxiliary executables below exec_prefix instead
113 ;; of assuming /lib/drbd (see TODO comment in the file).
114 (substitute* "user/v9/drbdtool_common.c"
115 (("\"/lib/drbd\"")
116 (string-append "\"" #$output "/lib/drbd\"")))))
117 (add-after 'configure 'adjust-installation-directories
118 (lambda _
119 ;; Do not attempt to create /etc or /var.
120 (substitute* "scripts/Makefile"
121 (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
122 "$(DESTDIR)$(prefix)$(sysconfdir)"))
123 (substitute* "user/v84/Makefile"
124 (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
125 "$(DESTDIR)$(prefix)$(localstatedir)")
126 (("\\$\\(DESTDIR\\)/lib/drbd")
127 "$(DESTDIR)$(prefix)/lib/drbd"))
128 (substitute* "user/v9/Makefile"
129 (("\\$\\(DESTDIR\\)\\$\\(localstatedir\\)")
130 "$(DESTDIR)$(prefix)$(localstatedir)")
131 (("\\$\\(DESTDIR\\)\\$\\(DRBD_LIB_DIR\\)")
132 "$(DESTDIR)$(prefix)$(DRBD_LIB_DIR)")))))))
133 (native-inputs
134 (append (list clitest
135 eudev ;just to satisfy a configure check
136 flex)
137 ;; For the documentation.
138 (if (supported-package? ruby-asciidoctor/minimal)
139 (list docbook-xml
140 docbook-xml-4.4 ;used by documentation/ra2refentry.xsl
141 docbook-xsl
142 libxslt ;for xsltproc
143 ruby-asciidoctor/minimal)
144 '())))
145 (home-page "https://www.linbit.com/drbd/")
146 (synopsis "Replicate block devices between machines")
147 (description
148 "@acronym{DRBD, Distributed Replicated Block Device} is a software-based,
149shared-nothing, replicated storage solution mirroring the content of block
150devices (hard disks, partitions, logical volumes etc.) over any network
151connection. This package contains the userland utilities.")
152 (properties
153 '((release-monitoring-url
154 . "https://www.linbit.com/en/drbd-community/drbd-download/")))
155 (license license:gpl2+)))
156
157(define-public keepalived
158 (package
159 (name "keepalived")
160 (version "2.3.1")
161 (source (origin
162 (method git-fetch)
163 (uri (git-reference
164 (url "https://github.com/acassen/keepalived")
165 (commit (string-append "v" version))))
166 (file-name (git-file-name name version))
167 (sha256
168 (base32
169 "0mxpx5azx0m2zp757yqcavvvzg3p9nj93bczfhv6wich3wpvbwzx"))))
170 (build-system gnu-build-system)
171 (arguments
172 (list
173 #:phases
174 #~(modify-phases %standard-phases
175 (add-after 'build 'build-info
176 (lambda _
177 (invoke "make" "-C" "doc" "texinfo")
178 ;; Put images in a subdirectory as recommended by 'texinfo'.
179 (install-file "doc/source/images/software_design.png"
180 "doc/build/texinfo/keepalived-figures")
181 (substitute* "doc/build/texinfo/keepalived.texi"
182 (("@image\\{software_design,")
183 "@image{keepalived-figures/software_design,"))
184 (invoke "make" "-C" "doc/build/texinfo")))
185 (add-after 'install 'install-info
186 (lambda _
187 (let ((infodir (string-append #$output "/share/info")))
188 (install-file "doc/build/texinfo/keepalived.info" infodir)
189 (install-file "doc/source/images/software_design.png"
190 (string-append
191 infodir "/keepalived-figures"))))))))
192 (native-inputs
193 (list autoconf automake pkg-config python-sphinx texinfo))
194 (inputs
195 (list openssl libnfnetlink libnl))
196 (home-page "https://www.keepalived.org")
197 (synopsis "Load balancing and high-availability frameworks")
198 (description
199 "Keepalived provides frameworks for both load balancing and high
200availability. The load balancing framework relies on the Linux Virtual
201Server (@dfn{IPVS}) kernel module. High availability is achieved by the Virtual
202Redundancy Routing Protocol (@dfn{VRRP}). Each Keepalived framework can be used
203independently or together to provide resilient infrastructures.")
204 (license license:gpl2+)))
205
206(define-public libraft
207 (package
208 (name "libraft")
209 (version "0.11.2")
210 (home-page "https://github.com/canonical/raft")
211 (source (origin
212 (method git-fetch)
213 (uri (git-reference (url home-page)
214 (commit (string-append "v" version))))
215 (file-name (git-file-name name version))
216 (sha256
217 (base32
218 "050dwy34jh8dihfwfm0r1by2i3sy9crapipp9idw32idm79y4izb"))))
219 (arguments '(#:configure-flags '("--enable-uv")
220 #:phases
221 (modify-phases %standard-phases
222 (add-after 'unpack 'disable-failing-tests
223 (lambda _
224 (substitute* "Makefile.am"
225 ((".*test_uv_append.c.*") "")
226 ((".*test_uv_tcp_connect.c.*") ""))
227 #t)))))
228 (inputs
229 (list libuv lz4))
230 (native-inputs
231 `(("autoconf" ,autoconf)
232 ("automake" ,automake)
233 ("gettext" ,gettext-minimal)
234 ("libtool" ,libtool)
235 ("pkg-config" ,pkg-config)))
236 (build-system gnu-build-system)
237 (synopsis "C implementation of the Raft consensus protocol")
238 (description "The library has modular design: its core part implements only
239the core Raft algorithm logic, in a fully platform independent way. On top of
240that, a pluggable interface defines the I/O implementation for networking
241(send/receive RPC messages) and disk persistence (store log entries and
242snapshots).")
243 (license license:asl2.0)))
244
245(define-public libdqlite
246 (package
247 (name "libdqlite")
248 (version "1.9.0")
249 (home-page "https://github.com/canonical/dqlite")
250 (source (origin
251 (method git-fetch)
252 (uri (git-reference (url home-page)
253 (commit (string-append "v" version))))
254 (file-name (git-file-name name version))
255 (sha256
256 (base32
257 "0zalsvr0vy7632nhm96a29lrfy18iqsmbxpyz2lvq80mrjlbrzsn"))))
258 (arguments
259 '(#:phases
260 (modify-phases %standard-phases
261 (add-after 'unpack 'disable-failing-tests
262 (lambda _
263 (substitute* "Makefile.am"
264 ;; Test client/query sometimes fails.
265 ;; The actual tested asserts succeed, but there appears to be a
266 ;; race condition when tearing down the test server.
267 ((".*test_client.c.*") "")))))))
268 (native-inputs
269 (list autoconf automake libtool pkg-config))
270 (inputs
271 (list libraft libuv))
272 (propagated-inputs
273 (list sqlite)) ; dqlite.h includes sqlite3.h
274 (build-system gnu-build-system)
275 (synopsis "Distributed SQLite")
276 (description "dqlite is a C library that implements an embeddable and replicated
277SQL database engine with high-availability and automatic failover.")
278 (license license:lgpl3)))