projects/guix·blob python-team · refs

86 lines · 3.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2012, 2013, 2016, 2021 Ludovic Courtès <[email protected]>
4;;; Copyright © 2018 Mark H Weaver <[email protected]>
5;;; Copyright © 2019 Marius Bakke <[email protected]>
6;;; Copyright © 2023 Janneke Nieuwenhuizen <[email protected]>
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages attr)
24 #:use-module (guix licenses)
25 #:use-module (gnu packages perl)
26 #:use-module (gnu packages gettext)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix utils))
31
32(define-public attr
33 (package
34 (name "attr")
35 (version "2.5.1")
36 (source (origin
37 (method url-fetch)
38 (uri (string-append "mirror://savannah/attr/attr-"
39 version ".tar.gz"))
40 (sha256
41 (base32
42 "1y6sibbkrcjygv8naadnsg6xmsqwfh6cwrqk01l0v2i5kfacdqds"))))
43 (build-system gnu-build-system)
44 (arguments
45 `(#:phases
46 (modify-phases %standard-phases
47 ,@(if (target-hurd?)
48 `((add-before 'configure 'skip-linux-syscalls
49 (lambda _
50 ;; Starting from 2.5.1, libattr includes Linux-specific
51 ;; calls to syscall(2). Comment them out for GNU/Hurd
52 ;; and instead use the glibc-provided wrappers.
53 (substitute* "Makefile.in"
54 (("libattr/syscalls\\.c") "")
55 (("\tlibattr/la-syscalls\\.lo") "")
56 (("-Wl,[[:graph:]]+/libattr\\.lds") "")))))
57 '())
58 (replace 'check
59 (lambda* (#:key target #:allow-other-keys)
60 ;; Use the right shell.
61 (substitute* "test/run"
62 (("/bin/sh")
63 (which "sh")))
64
65 ;; When building natively, run the tests.
66 ;;
67 ;; Note that we use system* and unconditionally return #t here
68 ;; to ignore the test result, because the tests will fail when
69 ;; the build is performed on a file system without support for
70 ;; extended attributes, and we wish to allow Guix to be built
71 ;; on such systems.
72 (unless target
73 (system* "make" "tests" "-C" "test")))))))
74 (inputs
75 ;; Perl is needed to run tests; remove it from cross builds.
76 (if (%current-target-system)
77 '()
78 `(("perl" ,perl))))
79 (native-inputs
80 `(("gettext" ,gettext-minimal)))
81
82 (home-page "https://savannah.nongnu.org/projects/attr/")
83 (synopsis "Library and tools for manipulating extended attributes")
84 (description
85 "Portable library and tools for manipulating extended attributes.")
86 (license lgpl2.1+)))