attr.scm 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
  3. ;;; Copyright © 2012, 2013, 2016, 2021 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. (define-module (gnu packages attr)
  22. #:use-module (guix licenses)
  23. #:use-module (gnu packages perl)
  24. #:use-module (gnu packages gettext)
  25. #:use-module (gnu packages hurd)
  26. #:use-module (guix packages)
  27. #:use-module (guix download)
  28. #:use-module (guix build-system gnu))
  29. (define-public attr
  30. (package
  31. (name "attr")
  32. (version "2.5.1")
  33. (source (origin
  34. (method url-fetch)
  35. (uri (string-append "mirror://savannah/attr/attr-"
  36. version ".tar.gz"))
  37. (sha256
  38. (base32
  39. "1y6sibbkrcjygv8naadnsg6xmsqwfh6cwrqk01l0v2i5kfacdqds"))))
  40. (build-system gnu-build-system)
  41. (arguments
  42. `(#:phases
  43. (modify-phases %standard-phases
  44. ,@(if (hurd-target?)
  45. `((add-before 'configure 'skip-linux-syscalls
  46. (lambda _
  47. ;; Starting from 2.5.1, libattr includes Linux-specific
  48. ;; calls to syscall(2). Comment them out for GNU/Hurd
  49. ;; and instead use the glibc-provided wrappers.
  50. (substitute* "Makefile.in"
  51. (("libattr/syscalls\\.c") "")
  52. (("\tlibattr/la-syscalls\\.lo") "")
  53. (("-Wl,[[:graph:]]+/libattr\\.lds") "")))))
  54. '())
  55. (replace 'check
  56. (lambda* (#:key target #:allow-other-keys)
  57. ;; Use the right shell.
  58. (substitute* "test/run"
  59. (("/bin/sh")
  60. (which "sh")))
  61. ;; When building natively, run the tests.
  62. ;;
  63. ;; Note that we use system* and unconditionally return #t here
  64. ;; to ignore the test result, because the tests will fail when
  65. ;; the build is performed on a file system without support for
  66. ;; extended attributes, and we wish to allow Guix to be built
  67. ;; on such systems.
  68. (unless target
  69. (system* "make" "tests" "-C" "test")))))))
  70. (inputs
  71. ;; Perl is needed to run tests; remove it from cross builds.
  72. (if (%current-target-system)
  73. '()
  74. `(("perl" ,perl))))
  75. (native-inputs
  76. `(("gettext" ,gettext-minimal)))
  77. (home-page "https://savannah.nongnu.org/projects/attr/")
  78. (synopsis "Library and tools for manipulating extended attributes")
  79. (description
  80. "Portable library and tools for manipulating extended attributes.")
  81. (license lgpl2.1+)))