| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
| 3 | ;;; Copyright © 2012, 2013, 2016 Ludovic Courtès <ludo@gnu.org> |
| 4 | ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org> |
| 5 | ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com> |
| 6 | ;;; |
| 7 | ;;; This file is part of GNU Guix. |
| 8 | ;;; |
| 9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 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 | ;;; |
| 14 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 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 |
| 20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 21 | |
| 22 | (define-module (gnu packages attr) |
| 23 | #:use-module (guix licenses) |
| 24 | #:use-module (gnu packages perl) |
| 25 | #:use-module (gnu packages gettext) |
| 26 | #:use-module (guix packages) |
| 27 | #:use-module (guix download) |
| 28 | #:use-module (guix build-system gnu)) |
| 29 | |
| 30 | (define-public attr |
| 31 | (package |
| 32 | (name "attr") |
| 33 | (version "2.4.48") |
| 34 | (source (origin |
| 35 | (method url-fetch) |
| 36 | (uri (string-append "mirror://savannah/attr/attr-" |
| 37 | version ".tar.gz")) |
| 38 | (sha256 |
| 39 | (base32 |
| 40 | "1rr4adzwax4bzr2c00f06zcsljv5y6p9wymz1g89ww7cb2rp5bay")))) |
| 41 | (build-system gnu-build-system) |
| 42 | (arguments |
| 43 | `(#:phases |
| 44 | (modify-phases %standard-phases |
| 45 | (replace 'check |
| 46 | (lambda* (#:key target #:allow-other-keys) |
| 47 | ;; Use the right shell. |
| 48 | (substitute* "test/run" |
| 49 | (("/bin/sh") |
| 50 | (which "sh"))) |
| 51 | |
| 52 | ;; When building natively, run the tests. |
| 53 | ;; |
| 54 | ;; Note that we use system* and unconditionally return #t here |
| 55 | ;; to ignore the test result, because the tests will fail when |
| 56 | ;; the build is performed on a file system without support for |
| 57 | ;; extended attributes, and we wish to allow Guix to be built |
| 58 | ;; on such systems. |
| 59 | (unless target |
| 60 | (system* "make" "tests" "-C" "test")) |
| 61 | #t))))) |
| 62 | (inputs |
| 63 | ;; Perl is needed to run tests; remove it from cross builds. |
| 64 | (if (%current-target-system) |
| 65 | '() |
| 66 | `(("perl" ,perl)))) |
| 67 | (native-inputs |
| 68 | `(("gettext" ,gettext-minimal))) |
| 69 | |
| 70 | (home-page "https://savannah.nongnu.org/projects/attr/") |
| 71 | (synopsis "Library and tools for manipulating extended attributes") |
| 72 | (description |
| 73 | "Portable library and tools for manipulating extended attributes.") |
| 74 | (license lgpl2.1+))) |