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>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
26 (define-module (gnu packages acl)
27 #:use-module (guix licenses)
28 #:use-module (gnu packages attr)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages hurd)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages perl)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (gnu packages)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system python))
47 (uri (string-append "mirror://savannah/acl/acl-"
51 "1ir6my3w74s6nfbgbqgzj6w570sn0qjf3524zx8xh67lqrjrigh6"))))
52 (build-system gnu-build-system)
54 `(#:modules ((ice-9 ftw)
55 ,@%gnu-build-system-modules)
56 #:configure-flags '("--disable-static")
57 #:tests? ,(not (or (%current-target-system)
60 (modify-phases %standard-phases
61 ;; XXX After repacking the sources the timestamps are reset to the
62 ;; epoch, which leads to a failure in gzipping the CHANGES file.
63 (add-after 'unpack 'ensure-no-mtimes-pre-1980
65 (let ((early-1980 315619200)) ; 1980-01-02 UTC
66 (ftw "." (lambda (file stat flag)
67 (unless (<= early-1980 (stat:mtime stat))
68 (utime file early-1980 early-1980))
71 (add-after 'build 'patch-exec-bin-sh
73 (substitute* "test/run"
74 (("/bin/sh") (which "sh")))
76 (add-before 'check 'patch-tests
78 ;; The coreutils do not have an ACL bit to remove from their
79 ;; output, so the sed expression that removes the bit is disabled.
80 (substitute* "test/sbits-restore.test"
82 ;; These tests require the existence of a user named "bin", but
83 ;; this user does not exist within Guix's build environment.
84 (substitute* "Makefile.in"
85 ((".*test/misc\\.test.*") "")
86 ((".*test/cp\\.test.*") "")
87 ((".*test/setfacl-X\\.test.*") ""))
89 (inputs `(("attr" ,attr)))
91 `(("gettext" ,gettext-minimal)
93 (home-page "https://savannah.nongnu.org/projects/acl")
95 "Library and tools for manipulating access control lists")
97 "Library and tools for manipulating access control lists.")
98 (license (list gpl2+ lgpl2.1+))))
100 (define-public python-pylibacl
102 (name "python-pylibacl")
107 (uri (pypi-uri "pylibacl" version))
110 "1zyrk2m20p5b6bdwxhrwib273i6i71zyr5hzssbxfqis5qra9848"))))
111 (build-system python-build-system)
114 (modify-phases %standard-phases
115 (add-after 'unpack 'disable-tests
116 (lambda* (#:key outputs inputs #:allow-other-keys)
117 ;; These tests operate on real files, but our tempfs does not support
119 (substitute* "tests/test_acls.py"
120 (("( *)def test_applyto(_extended(_mixed)?)?" match indent)
121 (string-append indent "@pytest.mark.skip(reason=\"guix\")\n" match)))
124 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
126 (add-installed-pythonpath inputs outputs)
127 (invoke "pytest" "tests"))
129 (inputs `(("acl" ,acl)))
130 (native-inputs `(("python-pytest" ,python-pytest)))
131 (home-page "https://pylibacl.k1024.org/")
132 (synopsis "POSIX.1e ACLs for python")
133 (description "Python 3.4+ extension module that allows you to manipulate
134 the POSIX.1e Access Control Lists present in some OS/file-systems