gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / acl.scm
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
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))
39
40 (define-public acl
41 (package
42 (name "acl")
43 (version "2.2.53")
44 (source
45 (origin
46 (method url-fetch)
47 (uri (string-append "mirror://savannah/acl/acl-"
48 version ".tar.gz"))
49 (sha256
50 (base32
51 "1ir6my3w74s6nfbgbqgzj6w570sn0qjf3524zx8xh67lqrjrigh6"))))
52 (build-system gnu-build-system)
53 (arguments
54 `(#:modules ((ice-9 ftw)
55 ,@%gnu-build-system-modules)
56 #:configure-flags '("--disable-static")
57 #:tests? ,(not (or (%current-target-system)
58 (hurd-target?)))
59 #:phases
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
64 (lambda _
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))
69 #t))
70 #t)))
71 (add-after 'build 'patch-exec-bin-sh
72 (lambda _
73 (substitute* "test/run"
74 (("/bin/sh") (which "sh")))
75 #t))
76 (add-before 'check 'patch-tests
77 (lambda _
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"
81 (("\\| sed.*'") ""))
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.*") ""))
88 #t)))))
89 (inputs `(("attr" ,attr)))
90 (native-inputs
91 `(("gettext" ,gettext-minimal)
92 ("perl" ,perl)))
93 (home-page "https://savannah.nongnu.org/projects/acl")
94 (synopsis
95 "Library and tools for manipulating access control lists")
96 (description
97 "Library and tools for manipulating access control lists.")
98 (license (list gpl2+ lgpl2.1+))))
99
100 (define-public python-pylibacl
101 (package
102 (name "python-pylibacl")
103 (version "0.6.0")
104 (source
105 (origin
106 (method url-fetch)
107 (uri (pypi-uri "pylibacl" version))
108 (sha256
109 (base32
110 "1zyrk2m20p5b6bdwxhrwib273i6i71zyr5hzssbxfqis5qra9848"))))
111 (build-system python-build-system)
112 (arguments
113 `(#:phases
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
118 ;; ACLs
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)))
122 #t))
123 (replace 'check
124 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
125 (when tests?
126 (add-installed-pythonpath inputs outputs)
127 (invoke "pytest" "tests"))
128 #t)))))
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
135 combinations.")
136 (license lgpl2.1+)))