acl.scm 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
  3. ;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
  5. ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  7. ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
  8. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  9. ;;; Copyright © 2021 Lars-Dominik Braun <ldb@leibniz-psychology.org>
  10. ;;;
  11. ;;; This file is part of GNU Guix.
  12. ;;;
  13. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  14. ;;; under the terms of the GNU General Public License as published by
  15. ;;; the Free Software Foundation; either version 3 of the License, or (at
  16. ;;; your option) any later version.
  17. ;;;
  18. ;;; GNU Guix is distributed in the hope that it will be useful, but
  19. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  20. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. ;;; GNU General Public License for more details.
  22. ;;;
  23. ;;; You should have received a copy of the GNU General Public License
  24. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  25. (define-module (gnu packages acl)
  26. #:use-module (guix licenses)
  27. #:use-module (gnu packages attr)
  28. #:use-module (gnu packages base)
  29. #:use-module (gnu packages check)
  30. #:use-module (gnu packages hurd)
  31. #:use-module (gnu packages gettext)
  32. #:use-module (gnu packages perl)
  33. #:use-module (guix packages)
  34. #:use-module (guix download)
  35. #:use-module (gnu packages)
  36. #:use-module (guix build-system gnu)
  37. #:use-module (guix build-system python))
  38. (define-public acl
  39. (package
  40. (name "acl")
  41. (version "2.3.1")
  42. (source
  43. (origin
  44. (method url-fetch)
  45. (uri (string-append "mirror://savannah/acl/acl-"
  46. version ".tar.gz"))
  47. (sha256
  48. (base32
  49. "1bqi7hj0xkpivwg7lx5cv3yvs9ks1i6azvpgbvfpzcq1i736233n"))))
  50. (build-system gnu-build-system)
  51. (arguments
  52. `(#:modules ((ice-9 ftw)
  53. ,@%gnu-build-system-modules)
  54. #:configure-flags '("--disable-static")
  55. #:tests? ,(not (or (%current-target-system)
  56. (hurd-target?)))
  57. #:phases
  58. (modify-phases %standard-phases
  59. ;; XXX After repacking the sources the timestamps are reset to the
  60. ;; epoch, which leads to a failure in gzipping the CHANGES file.
  61. (add-after 'unpack 'ensure-no-mtimes-pre-1980
  62. (lambda _
  63. (let ((early-1980 315619200)) ; 1980-01-02 UTC
  64. (ftw "." (lambda (file stat flag)
  65. (unless (<= early-1980 (stat:mtime stat))
  66. (utime file early-1980 early-1980))
  67. #t))
  68. #t)))
  69. (add-after 'build 'patch-exec-bin-sh
  70. (lambda _
  71. (substitute* "test/run"
  72. (("/bin/sh") (which "sh")))
  73. #t))
  74. (add-before 'check 'patch-tests
  75. (lambda _
  76. ;; The coreutils do not have an ACL bit to remove from their
  77. ;; output, so the sed expression that removes the bit is disabled.
  78. (substitute* "test/sbits-restore.test"
  79. (("\\| sed.*'") ""))
  80. ;; These tests require the existence of a user named "bin", but
  81. ;; this user does not exist within Guix's build environment.
  82. (substitute* "Makefile.in"
  83. ((".*test/misc\\.test.*") "")
  84. ((".*test/cp\\.test.*") "")
  85. ((".*test/setfacl-X\\.test.*") ""))
  86. #t)))))
  87. (inputs `(("attr" ,attr)))
  88. (native-inputs
  89. `(("gettext" ,gettext-minimal)
  90. ("perl" ,perl)))
  91. (home-page "https://savannah.nongnu.org/projects/acl")
  92. (synopsis
  93. "Library and tools for manipulating access control lists")
  94. (description
  95. "Library and tools for manipulating access control lists.")
  96. (license (list gpl2+ lgpl2.1+))))
  97. (define-public python-pylibacl
  98. (package
  99. (name "python-pylibacl")
  100. (version "0.6.0")
  101. (source
  102. (origin
  103. (method url-fetch)
  104. (uri (pypi-uri "pylibacl" version))
  105. (sha256
  106. (base32
  107. "1zyrk2m20p5b6bdwxhrwib273i6i71zyr5hzssbxfqis5qra9848"))))
  108. (build-system python-build-system)
  109. (arguments
  110. `(#:phases
  111. (modify-phases %standard-phases
  112. (add-after 'unpack 'disable-tests
  113. (lambda* (#:key outputs inputs #:allow-other-keys)
  114. ;; These tests operate on real files, but our tempfs does not support
  115. ;; ACLs
  116. (substitute* "tests/test_acls.py"
  117. (("( *)def test_applyto(_extended(_mixed)?)?" match indent)
  118. (string-append indent "@pytest.mark.skip(reason=\"guix\")\n" match)))
  119. #t))
  120. (replace 'check
  121. (lambda* (#:key inputs outputs tests? #:allow-other-keys)
  122. (when tests?
  123. (add-installed-pythonpath inputs outputs)
  124. (invoke "pytest" "tests"))
  125. #t)))))
  126. (inputs `(("acl" ,acl)))
  127. (native-inputs `(("python-pytest" ,python-pytest)))
  128. (home-page "https://pylibacl.k1024.org/")
  129. (synopsis "POSIX.1e ACLs for python")
  130. (description "Python 3.4+ extension module that allows you to manipulate
  131. the POSIX.1e Access Control Lists present in some OS/file-systems
  132. combinations.")
  133. (license lgpl2.1+)))