projects/guix·blob python-team · refs

90 lines · 4.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Leo Famulari <[email protected]>
3;;; Copyright © 2022 Marius Bakke <[email protected]>
4;;; Copyright © 2023 Janneke Nieuwenhuizen <[email protected]>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages libbsd)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix download)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix gexp)
27 #:use-module (guix utils)
28 #:use-module (gnu packages crypto))
29
30(define-public libbsd
31 (package
32 (name "libbsd")
33 (version "0.11.7")
34 (source (origin
35 (method url-fetch)
36 (uri (string-append "https://libbsd.freedesktop.org/releases/"
37 "libbsd-" version ".tar.xz"))
38 (sha256
39 (base32
40 "0q82iaynmal3dn132jgjq21p27x3zn8zks88cg02bgzbb5h1ialv"))))
41 (build-system gnu-build-system)
42 (arguments
43 (list #:configure-flags #~'("--disable-static")
44 #:phases #~(modify-phases %standard-phases
45 (add-after 'install 'embed-absolute-libmd-references
46 (lambda* (#:key inputs #:allow-other-keys)
47 (let ((libmd (search-input-file inputs
48 "lib/libmd.so")))
49 ;; Add absolute references to libmd so it
50 ;; does not need to be propagated.
51 (with-directory-excursion #$output
52 (substitute* "lib/libbsd.so"
53 (("^GROUP")
54 (string-append "SEARCH_DIR("
55 (dirname libmd)
56 ")\nGROUP")))
57 (substitute* (find-files "lib/pkgconfig"
58 "\\.pc$")
59 (("-lmd")
60 (string-append "-L" (dirname libmd)
61 " -lmd")))))))
62 (add-before 'check 'disable-pwcache-test
63 (lambda _
64 ;; This test expects the presence of a root
65 ;; user and group, which do not exist in the
66 ;; build container.
67 (substitute* "test/Makefile"
68 (("pwcache\\$\\(EXEEXT\\) ")
69 ""))))
70 #$@(if (system-hurd?)
71 #~((add-after 'unpack 'skip-tests
72 (lambda _
73 (substitute* "test/explicit_bzero.c"
74 (("(^| )main *\\(.*" all)
75 (string-append all
76 "{\n exit (77);//"))))))
77 #~()))))
78 (inputs
79 (list libmd))
80 (synopsis "Utility functions from BSD systems")
81 (description "This library provides useful functions commonly found on BSD
82systems, and lacking on others like GNU systems, thus making it easier to port
83projects with strong BSD origins, without needing to embed the same code over
84and over again on each project.")
85 (home-page "https://libbsd.freedesktop.org/wiki/")
86 ;; This package is a collection of third-party functions that were
87 ;; originally released under various non-copyleft licenses.
88 (license (list bsd-2 bsd-3 bsd-4 expat isc public-domain
89 (non-copyleft "file://COPYING"
90 "See COPYING in the distribution.")))))