projects/guix·blob python-team · refs

128 lines · 5.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2014, 2018 Mark H Weaver <[email protected]>
4;;; Copyright © 2014 Andreas Enge <[email protected]>
5;;; Copyright © 2017 Efraim Flashner <[email protected]>
6;;; Copyright © 2018 Ricardo Wurmus <[email protected]>
7;;; Copyright © 2019 Marius Bakke <[email protected]>
8;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <[email protected]>
9;;; Copyright © 2021 Lars-Dominik Braun <[email protected]>
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 gettext)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages python-build)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix gexp)
37 #:use-module (gnu packages)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system pyproject)
40 #:use-module (guix utils))
41
42(define-public acl
43 (package
44 (name "acl")
45 (version "2.3.1")
46 (source
47 (origin
48 (method url-fetch)
49 (uri (string-append "mirror://savannah/acl/acl-"
50 version ".tar.gz"))
51 (sha256
52 (base32
53 "1bqi7hj0xkpivwg7lx5cv3yvs9ks1i6azvpgbvfpzcq1i736233n"))))
54 (build-system gnu-build-system)
55 (arguments
56 `(#:modules ((ice-9 ftw)
57 ,@%default-gnu-modules)
58 #:configure-flags '("--disable-static")
59 #:tests? ,(not (or (%current-target-system)
60 (target-hurd?)))
61 #:phases
62 (modify-phases %standard-phases
63 ;; XXX After repacking the sources the timestamps are reset to the
64 ;; epoch, which leads to a failure in gzipping the CHANGES file.
65 (add-after 'unpack 'ensure-no-mtimes-pre-1980
66 (lambda _
67 (let ((early-1980 315619200)) ; 1980-01-02 UTC
68 (ftw "." (lambda (file stat flag)
69 (unless (<= early-1980 (stat:mtime stat))
70 (utime file early-1980 early-1980))
71 #t)))))
72 (add-after 'build 'patch-exec-bin-sh
73 (lambda _
74 (substitute* "test/run"
75 (("/bin/sh") (which "sh")))))
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 (inputs (list attr))
89 (native-inputs (list gettext-minimal perl))
90 (home-page "https://savannah.nongnu.org/projects/acl")
91 (synopsis
92 "Library and tools for manipulating access control lists")
93 (description
94 "Library and tools for manipulating access control lists.")
95 (license (list gpl2+ lgpl2.1+))))
96
97(define-public python-pylibacl
98 (package
99 (name "python-pylibacl")
100 (version "0.7.3")
101 (source
102 (origin
103 (method url-fetch)
104 (uri (pypi-uri "pylibacl" version))
105 (sha256
106 (base32 "08pr5cbipij3j591bihh72r5h14lyrspy24qwmfjsn0c1rcgp7wx"))))
107 (build-system pyproject-build-system)
108 (arguments
109 (list
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 tmpfs 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"
119 match))))))))
120 (inputs (list acl))
121 (native-inputs (list python-pytest python-setuptools))
122 (home-page "https://pylibacl.k1024.org/")
123 (synopsis "POSIX.1e @acronym{ACLs, access control lists} for Python")
124 (description
125 "This Python extension module manipulates the POSIX.1e @acronym{ACLs,
126Access Control Lists} available on many file systems. These allow more
127fine-grained access control than traditional user/group permissions.")
128 (license lgpl2.1+)))