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