| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 |
|
| 26 | (define-module (gnu packages license)
|
| 27 | #:use-module (gnu packages)
|
| 28 | #:use-module (gnu packages bash)
|
| 29 | #:use-module (gnu packages check)
|
| 30 | #:use-module (gnu packages freedesktop)
|
| 31 | #:use-module (gnu packages perl)
|
| 32 | #:use-module (gnu packages perl-check)
|
| 33 | #:use-module (gnu packages python-build)
|
| 34 | #:use-module (gnu packages python-web)
|
| 35 | #:use-module (gnu packages python-xyz)
|
| 36 | #:use-module (gnu packages rust-apps)
|
| 37 | #:use-module (gnu packages version-control)
|
| 38 | #:use-module (gnu packages web)
|
| 39 | #:use-module (guix build-system perl)
|
| 40 | #:use-module (guix build-system pyproject)
|
| 41 | #:use-module (guix download)
|
| 42 | #:use-module (guix gexp)
|
| 43 | #:use-module (guix git-download)
|
| 44 | #:use-module (guix licenses)
|
| 45 | #:use-module (guix packages))
|
| 46 |
|
| 47 | |
| 48 | |
| 49 | |
| 50 |
|
| 51 | (define-public perl-regexp-pattern-license
|
| 52 | (package
|
| 53 | (name "perl-regexp-pattern-license")
|
| 54 | (version "3.11.0")
|
| 55 | (source
|
| 56 | (origin
|
| 57 | (method url-fetch)
|
| 58 | (uri (string-append
|
| 59 | "mirror://cpan/authors/id/J/JO/JONASS/Regexp-Pattern-License-"
|
| 60 | "v" version ".tar.gz"))
|
| 61 | (sha256
|
| 62 | (base32 "1blkraliby1696pqici7k1pkwcrf7gbdavfxfffa2mk8lr4a6xw6"))))
|
| 63 | (build-system perl-build-system)
|
| 64 | (native-inputs
|
| 65 | (list perl-regexp-pattern perl-test-regexp-pattern
|
| 66 | perl-test-without-module perl-test2-suite perl-try-tiny))
|
| 67 | (home-page "https://metacpan.org/release/Regexp-Pattern-License")
|
| 68 | (synopsis "Regular expressions for legal licenses")
|
| 69 | (description "Regexp::Pattern::License provides a hash of regular
|
| 70 | expression patterns related to legal software licenses.
|
| 71 |
|
| 72 | Regexp::Pattern is a convention for organizing reusable regex patterns.")
|
| 73 | (license gpl3+)))
|
| 74 |
|
| 75 | (define-public perl-string-copyright
|
| 76 | (package
|
| 77 | (name "perl-string-copyright")
|
| 78 | (version "0.003014")
|
| 79 | (source
|
| 80 | (origin
|
| 81 | (method url-fetch)
|
| 82 | (uri (string-append
|
| 83 | "mirror://cpan/authors/id/J/JO/JONASS/String-Copyright-"
|
| 84 | version ".tar.gz"))
|
| 85 | (sha256
|
| 86 | (base32
|
| 87 | "0xdm0ml65r77sk1pklnq4spbmn9qid4m44rnva8hhh00b9044k9f"))))
|
| 88 | (build-system perl-build-system)
|
| 89 | (native-inputs
|
| 90 | (list perl-test-without-module perl-test2-suite))
|
| 91 | (propagated-inputs
|
| 92 | (list perl-exporter-tiny perl-set-intspan))
|
| 93 | (home-page "https://metacpan.org/release/String-Copyright")
|
| 94 | (synopsis "Representation of text-based copyright statements")
|
| 95 | (description "String::Copyright Parses common styles of copyright
|
| 96 | statements and serializes in normalized format.")
|
| 97 | (license gpl3+)))
|
| 98 |
|
| 99 | (define-public perl-string-license
|
| 100 | (package
|
| 101 | (name "perl-string-license")
|
| 102 | (version "0.0.9")
|
| 103 | (source (origin
|
| 104 | (method url-fetch)
|
| 105 | (uri (string-append
|
| 106 | "mirror://cpan/authors/id/J/JO/JONASS/String-License-v"
|
| 107 | version ".tar.gz"))
|
| 108 | (sha256
|
| 109 | (base32
|
| 110 | "1dbw8rgwdlgnlvscijpb2dnw5irfd6wvca587bprq5kk19mf7jzf"))))
|
| 111 | (build-system perl-build-system)
|
| 112 | (native-inputs (list perl-file-basedir
|
| 113 | perl-regexp-pattern-license
|
| 114 | perl-software-license
|
| 115 | perl-test-without-module
|
| 116 | perl-test2-suite
|
| 117 | perl-yaml-libyaml))
|
| 118 | (propagated-inputs (list perl-array-intspan
|
| 119 | perl-feature-compat-class
|
| 120 | perl-log-any
|
| 121 | perl-namespace-clean
|
| 122 | perl-path-tiny
|
| 123 | perl-regexp-pattern
|
| 124 | perl-regexp-pattern-license))
|
| 125 | (home-page "https://metacpan.org/release/String-License")
|
| 126 | (synopsis "Detect source code license statements in a text string")
|
| 127 | (description "@code{String::License} identifies license statements in a
|
| 128 | string and serializes them in a normalized format.")
|
| 129 | (license agpl3+)))
|
| 130 |
|
| 131 | (define-public perl-software-license
|
| 132 | (package
|
| 133 | (name "perl-software-license")
|
| 134 | (version "0.103014")
|
| 135 | (source
|
| 136 | (origin
|
| 137 | (method url-fetch)
|
| 138 | (uri (string-append
|
| 139 | "mirror://cpan/authors/id/L/LE/LEONT/Software-License-"
|
| 140 | version ".tar.gz"))
|
| 141 | (sha256
|
| 142 | (base32
|
| 143 | "128pbm9pf5drakm9bpkifc1zg8f005xabfwzg21nc03m5mhfligb"))))
|
| 144 | (build-system perl-build-system)
|
| 145 | (native-inputs
|
| 146 | (list perl-try-tiny))
|
| 147 | (propagated-inputs
|
| 148 | (list perl-data-section perl-text-template))
|
| 149 | (home-page "https://metacpan.org/release/Software-License")
|
| 150 | (synopsis "Templated software licenses")
|
| 151 | (description "This package provides templated software licenses.")
|
| 152 | (license (package-license perl))))
|
| 153 |
|
| 154 | (define-public licensecheck
|
| 155 | (package
|
| 156 | (name "licensecheck")
|
| 157 | (version "3.3.9")
|
| 158 | (source (origin
|
| 159 | (method url-fetch)
|
| 160 | (uri (string-append
|
| 161 | "mirror://cpan/authors/id/J/JO/JONASS/App-Licensecheck-"
|
| 162 | "v" version ".tar.gz"))
|
| 163 | (sha256
|
| 164 | (base32
|
| 165 | "17sfw2cz5x339zq6xc2nfjps2vwpj3d307v90gva498fvnlk1y4y"))))
|
| 166 | (build-system perl-build-system)
|
| 167 | (native-inputs
|
| 168 | (list perl-encode-locale
|
| 169 | perl-regexp-pattern-license
|
| 170 | perl-string-copyright
|
| 171 | perl-test-without-module
|
| 172 | perl-test2-suite
|
| 173 | perl-test2-tools-command))
|
| 174 | (propagated-inputs
|
| 175 | (list perl-feature-compat-class
|
| 176 | perl-feature-compat-try
|
| 177 | perl-io-interactive
|
| 178 | perl-log-any
|
| 179 | perl-log-any-adapter-screen
|
| 180 | perl-namespace-clean
|
| 181 | perl-path-iterator-rule
|
| 182 | perl-path-tiny
|
| 183 | perl-pod-constants
|
| 184 | perl-string-copyright
|
| 185 | perl-string-escape
|
| 186 | perl-string-license))
|
| 187 | (inputs (list bash-minimal)) |
| 188 | (arguments
|
| 189 | (list
|
| 190 | #:phases
|
| 191 | #~(modify-phases %standard-phases
|
| 192 | (add-after 'install 'wrap-licensecheck
|
| 193 | (lambda _
|
| 194 | (let ((licensecheck (string-append #$output "/bin/licensecheck"))
|
| 195 | (perl5lib (string-append #$output "/lib/perl5/site_perl/"
|
| 196 | #$(package-version perl))))
|
| 197 | (wrap-program licensecheck
|
| 198 | `("PERL5LIB" ":" prefix
|
| 199 | ,(list perl5lib (getenv "PERL5LIB")))))))
|
| 200 | (add-after 'wrap-licensecheck 'check-wrap
|
| 201 | (lambda* (#:key tests? #:allow-other-keys)
|
| 202 | (when tests?
|
| 203 | (unsetenv "PERL5LIB")
|
| 204 | (invoke/quiet (string-append #$output "/bin/licensecheck")
|
| 205 | "--version")))))))
|
| 206 | (home-page "https://metacpan.org/release/App-Licensecheck")
|
| 207 | (synopsis "License checker for source files")
|
| 208 | (description "Licensecheck attempts to determine the license that applies
|
| 209 | to each file passed to it, by searching the start of the file for text
|
| 210 | belonging to various licenses.")
|
| 211 | (license agpl3+)))
|
| 212 |
|
| 213 | (define-public reuse
|
| 214 | (package
|
| 215 | (name "reuse")
|
| 216 | (version "6.2.0")
|
| 217 | (source
|
| 218 | (origin
|
| 219 | (method git-fetch)
|
| 220 | (uri (git-reference
|
| 221 | (url "https://codeberg.org/fsfe/reuse-tool.git")
|
| 222 | (commit (string-append "v" version))))
|
| 223 | (file-name (git-file-name name version))
|
| 224 | (sha256
|
| 225 | (base32 "1m76vrjqbr3a6bmzgxqkf0qdfk41v1mnhh524q67pincvqi533r7"))))
|
| 226 | (build-system pyproject-build-system)
|
| 227 | (arguments
|
| 228 | (list
|
| 229 | |
| 230 | #:test-flags #~(list "--ignore=src/reuse")))
|
| 231 | (native-inputs
|
| 232 | (list python-freezegun
|
| 233 | python-poetry-core
|
| 234 | python-pytest))
|
| 235 | (inputs
|
| 236 | (list git
|
| 237 | jujutsu
|
| 238 | mercurial
|
| 239 | python-attrs
|
| 240 | python-binaryornot
|
| 241 | python-charset-normalizer
|
| 242 | python-click
|
| 243 | python-debian
|
| 244 | python-jinja2
|
| 245 | python-license-expression
|
| 246 | python-magic
|
| 247 | python-tomlkit))
|
| 248 | (home-page "https://reuse.software/")
|
| 249 | (synopsis "Provide and verify copyright and licensing information")
|
| 250 | (description
|
| 251 | "The REUSE tool helps you achieve and confirm license compliance with the
|
| 252 | @uref{https://reuse.software, REUSE specification}, a set of recommendations
|
| 253 | for licensing Free Software projects. REUSE makes it easy to declare the
|
| 254 | licenses under which your works are released, especially when reusing software
|
| 255 | from different projects released under different licenses. It avoids reliance
|
| 256 | on fuzzy heuristicts and allows both legal experts and computers to understand
|
| 257 | how your project is licensed. This allows generating a \"bill of materials\"
|
| 258 | for software.
|
| 259 |
|
| 260 | This tool downloads full license texts, adds copyright and license information
|
| 261 | to file headers, and contains a linter to identify problems. There are other
|
| 262 | tools that have a lot more features and functionality surrounding the analysis
|
| 263 | and inspection of copyright and licenses in software projects. This one is
|
| 264 | designed to be simple.")
|
| 265 | (license (list asl2.0 cc0 cc-by-sa4.0 gpl3+))))
|
| 266 |
|
| 267 | (define-public licenseheaders
|
| 268 | (package
|
| 269 | (name "licenseheaders")
|
| 270 | (version "0.8.8")
|
| 271 | (source
|
| 272 | (origin
|
| 273 | (method git-fetch)
|
| 274 | (uri (git-reference
|
| 275 | (url "https://github.com/johann-petrak/licenseheaders")
|
| 276 | (commit (string-append "v" version))))
|
| 277 | (file-name (git-file-name name version))
|
| 278 | (sha256
|
| 279 | (base32 "1k2naf8vgi8l5h5nxc927x8b10kr4gkraxkim72p71flm8gqhrr4"))))
|
| 280 | (build-system pyproject-build-system)
|
| 281 | (arguments
|
| 282 | (list
|
| 283 | #:test-backend #~'custom
|
| 284 | #:test-flags #~(list "driver.py")
|
| 285 | #:phases
|
| 286 | #~(modify-phases %standard-phases
|
| 287 | |
| 288 | |
| 289 | (add-after 'unpack 'patch-code
|
| 290 | (lambda _
|
| 291 | (substitute* "licenseheaders.py"
|
| 292 | (("\\\"filenames\\\": \\[\\\"CMakeLists.txt\\\"\\]," all)
|
| 293 | (string-append all " \n \"extensions\": [],")))))
|
| 294 | (replace 'check
|
| 295 | (lambda args
|
| 296 | (with-directory-excursion "tests"
|
| 297 | (apply (assoc-ref %standard-phases 'check) args)))))))
|
| 298 | (native-inputs (list python-setuptools))
|
| 299 | (propagated-inputs (list python-regex))
|
| 300 | (home-page "https://github.com/johann-petrak/licenseheaders")
|
| 301 | (synopsis "Add or change license headers for all files in a directory")
|
| 302 | (description
|
| 303 | "Licenseheaders is a Python 3 tool to update, change or add license
|
| 304 | headers to all files of any of the supported types in or below some
|
| 305 | directory.")
|
| 306 | (license expat)))
|