1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
3 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages license)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages check)
23 #:use-module (gnu packages perl)
24 #:use-module (gnu packages perl-check)
25 #:use-module (gnu packages python-web)
26 #:use-module (gnu packages python-xyz)
27 #:use-module (guix build-system perl)
28 #:use-module (guix build-system python)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix licenses)
32 #:use-module (guix packages))
35 ;;; Please: Try to add new module packages in alphabetic order.
38 (define-public perl-regexp-pattern-license
40 (name "perl-regexp-pattern-license")
46 "mirror://cpan/authors/id/J/JO/JONASS/Regexp-Pattern-License-"
47 "v" version ".tar.gz"))
49 (base32 "0kznpv628jrndn4nw646f6pl7yqvmacwljlygvsjfdkyh0i4sr2k"))))
50 (build-system perl-build-system)
52 `(("perl-regexp-pattern" ,perl-regexp-pattern)
53 ("perl-test-exception" ,perl-test-exception)))
55 `(("perl-strictures" ,perl-strictures-2)
56 ("perl-try-tiny" ,perl-try-tiny)))
57 (home-page "https://metacpan.org/release/Regexp-Pattern-License")
58 (synopsis "Regular expressions for legal licenses")
59 (description "Regexp::Pattern::License provides a hash of regular
60 expression patterns related to legal software licenses.
62 Regexp::Pattern is a convention for organizing reusable regex patterns.")
65 (define-public perl-string-copyright
67 (name "perl-string-copyright")
73 "mirror://cpan/authors/id/J/JO/JONASS/String-Copyright-"
77 "0fzymv065nn3glwnw34nkyadzw2dh4rcz8avmki4zrnk4k45m01a"))))
78 (build-system perl-build-system)
80 `(("perl-number-range" ,perl-number-range)))
82 `(("perl-exporter-tiny" ,perl-exporter-tiny)))
83 (home-page "https://metacpan.org/release/String-Copyright")
84 (synopsis "Representation of text-based copyright statements")
85 (description "String::Copyright Parses common styles of copyright
86 statements and serializes in normalized format.")
89 (define-public perl-software-license
91 (name "perl-software-license")
97 "mirror://cpan/authors/id/L/LE/LEONT/Software-License-"
101 "128pbm9pf5drakm9bpkifc1zg8f005xabfwzg21nc03m5mhfligb"))))
102 (build-system perl-build-system)
104 `(("perl-try-tiny" ,perl-try-tiny)))
106 `(("perl-data-section" ,perl-data-section)
107 ("perl-text-template" ,perl-text-template)))
108 (home-page "https://metacpan.org/release/Software-License")
109 (synopsis "Templated software licenses")
110 (description "This package provides templated software licenses.")
111 (license (package-license perl))))
113 (define-public licensecheck
115 (name "licensecheck")
120 "mirror://cpan/authors/id/J/JO/JONASS/App-Licensecheck-"
121 "v" version ".tar.gz"))
124 "12l83zf85zagpagizmzy3bwkc659sbzqf18cycx8g4h6d3mc5kqw"))))
125 (build-system perl-build-system)
127 `(("perl-regexp-pattern" ,perl-regexp-pattern)
128 ("perl-software-license" ,perl-software-license)
129 ("perl-test-requires" ,perl-test-requires)
130 ("perl-test-roo" ,perl-test-roo)
131 ("perl-test-script" ,perl-test-script)
132 ("perl-universal-require" ,perl-universal-require)
133 ("perl-number-range" ,perl-number-range)
134 ("perl-sub-quote" ,perl-sub-quote)))
136 `(("perl-getopt-long-descriptive" ,perl-getopt-long-descriptive)
137 ("perl-moo" ,perl-moo-2)
138 ("perl-namespace-clean" ,perl-namespace-clean)
139 ("perl-path-iterator-rule" ,perl-path-iterator-rule)
140 ("perl-path-tiny" ,perl-path-tiny)
141 ("perl-pod-constants" ,perl-pod-constants)
142 ("perl-regexp-pattern-license" ,perl-regexp-pattern-license)
143 ("perl-sort-key" ,perl-sort-key)
144 ("perl-strictures" ,perl-strictures-2)
145 ("perl-string-copyright" ,perl-string-copyright)
146 ("perl-string-escape" ,perl-string-escape)
147 ("perl-try-tiny" ,perl-try-tiny)
148 ("perl-module-runtime" ,perl-module-runtime)))
151 (modify-phases %standard-phases
152 (add-after 'install 'wrap-program
153 (lambda* (#:key inputs outputs #:allow-other-keys)
154 (let* ((out (assoc-ref outputs "out"))
155 (perllib (string-append out "/lib/perl5/site_perl/"
156 ,(package-version perl))))
157 (wrap-program (string-append out "/bin/licensecheck")
159 prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
161 (home-page "https://metacpan.org/release/App-Licensecheck")
162 (synopsis "License checker for source files")
163 (description "Licensecheck attempts to determine the license that applies
164 to each file passed to it, by searching the start of the file for text
165 belonging to various licenses.")
166 (license (package-license perl))))
176 (url "https://git.fsfe.org/reuse/tool.git")
177 (commit (string-append "v" version))))
178 (file-name (git-file-name name version))
180 (base32 "1w17g6jvs715rjc93nnnqnfdphijq4ymj9jjkr3ccc286ywvn3ih"))))
181 (build-system python-build-system)
183 `(("python-pytest" ,python-pytest)))
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+))))