1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
3 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
5 ;;; Copyright © 2021 Tanguy Le Carrour <tanguy@bioneland.org>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
22 (define-module (gnu packages license)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages check)
25 #:use-module (gnu packages perl)
26 #:use-module (gnu packages perl-check)
27 #:use-module (gnu packages python-web)
28 #:use-module (gnu packages python-xyz)
29 #:use-module (guix build-system perl)
30 #:use-module (guix build-system python)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix licenses)
34 #:use-module (guix packages))
37 ;;; Please: Try to add new module packages in alphabetic order.
40 (define-public perl-regexp-pattern-license
42 (name "perl-regexp-pattern-license")
48 "mirror://cpan/authors/id/J/JO/JONASS/Regexp-Pattern-License-"
49 "v" version ".tar.gz"))
51 (base32 "0kznpv628jrndn4nw646f6pl7yqvmacwljlygvsjfdkyh0i4sr2k"))))
52 (build-system perl-build-system)
54 `(("perl-regexp-pattern" ,perl-regexp-pattern)
55 ("perl-test-exception" ,perl-test-exception)))
57 `(("perl-strictures" ,perl-strictures-2)
58 ("perl-try-tiny" ,perl-try-tiny)))
59 (home-page "https://metacpan.org/release/Regexp-Pattern-License")
60 (synopsis "Regular expressions for legal licenses")
61 (description "Regexp::Pattern::License provides a hash of regular
62 expression patterns related to legal software licenses.
64 Regexp::Pattern is a convention for organizing reusable regex patterns.")
67 (define-public perl-string-copyright
69 (name "perl-string-copyright")
75 "mirror://cpan/authors/id/J/JO/JONASS/String-Copyright-"
79 "0fzymv065nn3glwnw34nkyadzw2dh4rcz8avmki4zrnk4k45m01a"))))
80 (build-system perl-build-system)
82 `(("perl-number-range" ,perl-number-range)))
84 `(("perl-exporter-tiny" ,perl-exporter-tiny)))
85 (home-page "https://metacpan.org/release/String-Copyright")
86 (synopsis "Representation of text-based copyright statements")
87 (description "String::Copyright Parses common styles of copyright
88 statements and serializes in normalized format.")
91 (define-public perl-software-license
93 (name "perl-software-license")
99 "mirror://cpan/authors/id/L/LE/LEONT/Software-License-"
103 "128pbm9pf5drakm9bpkifc1zg8f005xabfwzg21nc03m5mhfligb"))))
104 (build-system perl-build-system)
106 `(("perl-try-tiny" ,perl-try-tiny)))
108 `(("perl-data-section" ,perl-data-section)
109 ("perl-text-template" ,perl-text-template)))
110 (home-page "https://metacpan.org/release/Software-License")
111 (synopsis "Templated software licenses")
112 (description "This package provides templated software licenses.")
113 (license (package-license perl))))
115 (define-public licensecheck
117 (name "licensecheck")
122 "mirror://cpan/authors/id/J/JO/JONASS/App-Licensecheck-"
123 "v" version ".tar.gz"))
126 "12l83zf85zagpagizmzy3bwkc659sbzqf18cycx8g4h6d3mc5kqw"))))
127 (build-system perl-build-system)
129 `(("perl-regexp-pattern" ,perl-regexp-pattern)
130 ("perl-software-license" ,perl-software-license)
131 ("perl-test-requires" ,perl-test-requires)
132 ("perl-test-roo" ,perl-test-roo)
133 ("perl-test-script" ,perl-test-script)
134 ("perl-universal-require" ,perl-universal-require)
135 ("perl-number-range" ,perl-number-range)
136 ("perl-sub-quote" ,perl-sub-quote)))
138 `(("perl-getopt-long-descriptive" ,perl-getopt-long-descriptive)
139 ("perl-moo" ,perl-moo-2)
140 ("perl-namespace-clean" ,perl-namespace-clean)
141 ("perl-path-iterator-rule" ,perl-path-iterator-rule)
142 ("perl-path-tiny" ,perl-path-tiny)
143 ("perl-pod-constants" ,perl-pod-constants)
144 ("perl-regexp-pattern-license" ,perl-regexp-pattern-license)
145 ("perl-sort-key" ,perl-sort-key)
146 ("perl-strictures" ,perl-strictures-2)
147 ("perl-string-copyright" ,perl-string-copyright)
148 ("perl-string-escape" ,perl-string-escape)
149 ("perl-try-tiny" ,perl-try-tiny)
150 ("perl-module-runtime" ,perl-module-runtime)))
153 (modify-phases %standard-phases
154 (add-after 'install 'wrap-program
155 (lambda* (#:key inputs outputs #:allow-other-keys)
156 (let* ((out (assoc-ref outputs "out"))
157 (perllib (string-append out "/lib/perl5/site_perl/"
158 ,(package-version perl))))
159 (wrap-program (string-append out "/bin/licensecheck")
161 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
163 (home-page "https://metacpan.org/release/App-Licensecheck")
164 (synopsis "License checker for source files")
165 (description "Licensecheck attempts to determine the license that applies
166 to each file passed to it, by searching the start of the file for text
167 belonging to various licenses.")
168 (license (package-license perl))))
177 (uri (pypi-uri "reuse" version))
179 (base32 "11i1xjbwbqjipzpbrbnp110zx1m49khn6dl5z3mjkjaz9kr6bl2f"))))
180 (build-system python-build-system)
182 `(("python-pytest" ,python-pytest)
183 ("python-setuptools-scm" ,python-setuptools-scm)))
185 `(("python-binaryornot" ,python-binaryornot)
186 ("python-boolean.py" ,python-boolean.py)
187 ("python-debian" ,python-debian)
188 ("python-jinja2" ,python-jinja2)
189 ("python-license-expression" ,python-license-expression)
190 ("python-requests" ,python-requests)))
191 (home-page "https://reuse.software/")
192 (synopsis "Provide and verify copyright and licensing information")
194 "The REUSE tool helps you achieve and confirm license compliance with the
195 @uref{https://reuse.software, REUSE specification}, a set of recommendations
196 for licensing Free Software projects. REUSE makes it easy to declare the
197 licenses under which your works are released, especially when reusing software
198 from different projects released under different licenses. It avoids reliance
199 on fuzzy heuristicts and allows both legal experts and computers to understand
200 how your project is licensed. This allows generating a \"bill of materials\"
203 This tool downloads full license texts, adds copyright and license information
204 to file headers, and contains a linter to identify problems. There are other
205 tools that have a lot more features and functionality surrounding the analysis
206 and inspection of copyright and licenses in software projects. This one is
207 designed to be simple.")
208 (license (list asl2.0 gpl3+))))
210 (define-public licenseheaders
212 (name "licenseheaders")
217 (uri (pypi-uri "licenseheaders" version))
219 (base32 "073xcm10gyg5kcxqmbsyaz9sr0slbdwgr0r9qanch0zl8i0z9259"))))
220 (build-system python-build-system)
223 (modify-phases %standard-phases
224 ;; Reported upstream:
225 ;; <https://github.com/johann-petrak/licenseheaders/issues/47>.
226 (add-after 'unpack 'patch-code
228 (substitute* "licenseheaders.py"
229 (("\\\"filenames\\\": \\[\\\"CMakeLists.txt\\\"\\],")
230 "\"filenames\": [\"CMakeLists.txt\"], \n \"extensions\": [],"))
233 `(("python-regex" ,python-regex)))
234 (home-page "https://github.com/johann-petrak/licenseheaders")
235 (synopsis "Add or change license headers for all files in a directory")
237 "Licenseheaders is a Python 3 tool to update, change or add license
238 headers to all files of any of the supported types in or below some