| 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> |
| 6 | ;;; |
| 7 | ;;; This file is part of GNU Guix. |
| 8 | ;;; |
| 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. |
| 13 | ;;; |
| 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. |
| 18 | ;;; |
| 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/>. |
| 21 | |
| 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)) |
| 35 | |
| 36 | ;;; |
| 37 | ;;; Please: Try to add new module packages in alphabetic order. |
| 38 | ;;; |
| 39 | |
| 40 | (define-public perl-regexp-pattern-license |
| 41 | (package |
| 42 | (name "perl-regexp-pattern-license") |
| 43 | (version "3.1.94") |
| 44 | (source |
| 45 | (origin |
| 46 | (method url-fetch) |
| 47 | (uri (string-append |
| 48 | "mirror://cpan/authors/id/J/JO/JONASS/Regexp-Pattern-License-" |
| 49 | "v" version ".tar.gz")) |
| 50 | (sha256 |
| 51 | (base32 "0kznpv628jrndn4nw646f6pl7yqvmacwljlygvsjfdkyh0i4sr2k")))) |
| 52 | (build-system perl-build-system) |
| 53 | (native-inputs |
| 54 | `(("perl-regexp-pattern" ,perl-regexp-pattern) |
| 55 | ("perl-test-exception" ,perl-test-exception))) |
| 56 | (propagated-inputs |
| 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. |
| 63 | |
| 64 | Regexp::Pattern is a convention for organizing reusable regex patterns.") |
| 65 | (license gpl3+))) |
| 66 | |
| 67 | (define-public perl-string-copyright |
| 68 | (package |
| 69 | (name "perl-string-copyright") |
| 70 | (version "0.003006") |
| 71 | (source |
| 72 | (origin |
| 73 | (method url-fetch) |
| 74 | (uri (string-append |
| 75 | "mirror://cpan/authors/id/J/JO/JONASS/String-Copyright-" |
| 76 | version ".tar.gz")) |
| 77 | (sha256 |
| 78 | (base32 |
| 79 | "0fzymv065nn3glwnw34nkyadzw2dh4rcz8avmki4zrnk4k45m01a")))) |
| 80 | (build-system perl-build-system) |
| 81 | (native-inputs |
| 82 | `(("perl-number-range" ,perl-number-range))) |
| 83 | (propagated-inputs |
| 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.") |
| 89 | (license gpl3+))) |
| 90 | |
| 91 | (define-public perl-software-license |
| 92 | (package |
| 93 | (name "perl-software-license") |
| 94 | (version "0.103014") |
| 95 | (source |
| 96 | (origin |
| 97 | (method url-fetch) |
| 98 | (uri (string-append |
| 99 | "mirror://cpan/authors/id/L/LE/LEONT/Software-License-" |
| 100 | version ".tar.gz")) |
| 101 | (sha256 |
| 102 | (base32 |
| 103 | "128pbm9pf5drakm9bpkifc1zg8f005xabfwzg21nc03m5mhfligb")))) |
| 104 | (build-system perl-build-system) |
| 105 | (native-inputs |
| 106 | `(("perl-try-tiny" ,perl-try-tiny))) |
| 107 | (propagated-inputs |
| 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)))) |
| 114 | |
| 115 | (define-public licensecheck |
| 116 | (package |
| 117 | (name "licensecheck") |
| 118 | (version "3.0.37") |
| 119 | (source (origin |
| 120 | (method url-fetch) |
| 121 | (uri (string-append |
| 122 | "mirror://cpan/authors/id/J/JO/JONASS/App-Licensecheck-" |
| 123 | "v" version ".tar.gz")) |
| 124 | (sha256 |
| 125 | (base32 |
| 126 | "12l83zf85zagpagizmzy3bwkc659sbzqf18cycx8g4h6d3mc5kqw")))) |
| 127 | (build-system perl-build-system) |
| 128 | (native-inputs |
| 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))) |
| 137 | (propagated-inputs |
| 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))) |
| 151 | (arguments |
| 152 | `(#:phases |
| 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") |
| 160 | `("PERL5LIB" ":" |
| 161 | prefix (,(string-append perllib ":" (getenv "PERL5LIB"))))) |
| 162 | #t)))))) |
| 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)))) |
| 169 | |
| 170 | (define-public reuse |
| 171 | (package |
| 172 | (name "reuse") |
| 173 | (version "0.12.1") |
| 174 | (source |
| 175 | (origin |
| 176 | (method url-fetch) |
| 177 | (uri (pypi-uri "reuse" version)) |
| 178 | (sha256 |
| 179 | (base32 "11i1xjbwbqjipzpbrbnp110zx1m49khn6dl5z3mjkjaz9kr6bl2f")))) |
| 180 | (build-system python-build-system) |
| 181 | (native-inputs |
| 182 | `(("python-pytest" ,python-pytest) |
| 183 | ("python-setuptools-scm" ,python-setuptools-scm))) |
| 184 | (inputs |
| 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") |
| 193 | (description |
| 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\" |
| 201 | for software. |
| 202 | |
| 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+)))) |
| 209 | |
| 210 | (define-public licenseheaders |
| 211 | (package |
| 212 | (name "licenseheaders") |
| 213 | (version "0.8.6") |
| 214 | (source |
| 215 | (origin |
| 216 | (method url-fetch) |
| 217 | (uri (pypi-uri "licenseheaders" version)) |
| 218 | (sha256 |
| 219 | (base32 "073xcm10gyg5kcxqmbsyaz9sr0slbdwgr0r9qanch0zl8i0z9259")))) |
| 220 | (build-system python-build-system) |
| 221 | (arguments |
| 222 | `(#:phases |
| 223 | (modify-phases %standard-phases |
| 224 | ;; Reported upstream: |
| 225 | ;; <https://github.com/johann-petrak/licenseheaders/issues/47>. |
| 226 | (add-after 'unpack 'patch-code |
| 227 | (lambda _ |
| 228 | (substitute* "licenseheaders.py" |
| 229 | (("\\\"filenames\\\": \\[\\\"CMakeLists.txt\\\"\\],") |
| 230 | "\"filenames\": [\"CMakeLists.txt\"], \n \"extensions\": [],")) |
| 231 | #t))))) |
| 232 | (propagated-inputs |
| 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") |
| 236 | (description |
| 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 |
| 239 | directory.") |
| 240 | (license expat))) |