license.scm 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
  3. ;;; Copyright © 2018–2021 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. ;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
  7. ;;;
  8. ;;; This file is part of GNU Guix.
  9. ;;;
  10. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  11. ;;; under the terms of the GNU General Public License as published by
  12. ;;; the Free Software Foundation; either version 3 of the License, or (at
  13. ;;; your option) any later version.
  14. ;;;
  15. ;;; GNU Guix is distributed in the hope that it will be useful, but
  16. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;;; GNU General Public License for more details.
  19. ;;;
  20. ;;; You should have received a copy of the GNU General Public License
  21. ;;; 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-build)
  28. #:use-module (gnu packages python-web)
  29. #:use-module (gnu packages python-xyz)
  30. #:use-module (guix build-system perl)
  31. #:use-module (guix build-system python)
  32. #:use-module (guix build-system pyproject)
  33. #:use-module (guix download)
  34. #:use-module (guix git-download)
  35. #:use-module (guix licenses)
  36. #:use-module (guix packages))
  37. ;;;
  38. ;;; Please: Try to add new module packages in alphabetic order.
  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. (list perl-regexp-pattern perl-test-exception))
  55. (propagated-inputs
  56. (list perl-strictures-2 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.
  61. Regexp::Pattern is a convention for organizing reusable regex patterns.")
  62. (license gpl3+)))
  63. (define-public perl-string-copyright
  64. (package
  65. (name "perl-string-copyright")
  66. (version "0.003006")
  67. (source
  68. (origin
  69. (method url-fetch)
  70. (uri (string-append
  71. "mirror://cpan/authors/id/J/JO/JONASS/String-Copyright-"
  72. version ".tar.gz"))
  73. (sha256
  74. (base32
  75. "0fzymv065nn3glwnw34nkyadzw2dh4rcz8avmki4zrnk4k45m01a"))))
  76. (build-system perl-build-system)
  77. (native-inputs
  78. (list perl-number-range))
  79. (propagated-inputs
  80. (list perl-exporter-tiny))
  81. (home-page "https://metacpan.org/release/String-Copyright")
  82. (synopsis "Representation of text-based copyright statements")
  83. (description "String::Copyright Parses common styles of copyright
  84. statements and serializes in normalized format.")
  85. (license gpl3+)))
  86. (define-public perl-software-license
  87. (package
  88. (name "perl-software-license")
  89. (version "0.103014")
  90. (source
  91. (origin
  92. (method url-fetch)
  93. (uri (string-append
  94. "mirror://cpan/authors/id/L/LE/LEONT/Software-License-"
  95. version ".tar.gz"))
  96. (sha256
  97. (base32
  98. "128pbm9pf5drakm9bpkifc1zg8f005xabfwzg21nc03m5mhfligb"))))
  99. (build-system perl-build-system)
  100. (native-inputs
  101. (list perl-try-tiny))
  102. (propagated-inputs
  103. (list perl-data-section perl-text-template))
  104. (home-page "https://metacpan.org/release/Software-License")
  105. (synopsis "Templated software licenses")
  106. (description "This package provides templated software licenses.")
  107. (license (package-license perl))))
  108. (define-public licensecheck
  109. (package
  110. (name "licensecheck")
  111. (version "3.0.37")
  112. (source (origin
  113. (method url-fetch)
  114. (uri (string-append
  115. "mirror://cpan/authors/id/J/JO/JONASS/App-Licensecheck-"
  116. "v" version ".tar.gz"))
  117. (sha256
  118. (base32
  119. "12l83zf85zagpagizmzy3bwkc659sbzqf18cycx8g4h6d3mc5kqw"))))
  120. (build-system perl-build-system)
  121. (native-inputs
  122. (list perl-regexp-pattern
  123. perl-software-license
  124. perl-test-requires
  125. perl-test-roo
  126. perl-test-script
  127. perl-universal-require
  128. perl-number-range
  129. perl-sub-quote))
  130. (propagated-inputs
  131. `(("perl-getopt-long-descriptive" ,perl-getopt-long-descriptive)
  132. ("perl-moo" ,perl-moo-2)
  133. ("perl-namespace-clean" ,perl-namespace-clean)
  134. ("perl-path-iterator-rule" ,perl-path-iterator-rule)
  135. ("perl-path-tiny" ,perl-path-tiny)
  136. ("perl-pod-constants" ,perl-pod-constants)
  137. ("perl-regexp-pattern-license" ,perl-regexp-pattern-license)
  138. ("perl-sort-key" ,perl-sort-key)
  139. ("perl-strictures" ,perl-strictures-2)
  140. ("perl-string-copyright" ,perl-string-copyright)
  141. ("perl-string-escape" ,perl-string-escape)
  142. ("perl-try-tiny" ,perl-try-tiny)
  143. ("perl-module-runtime" ,perl-module-runtime)))
  144. (arguments
  145. `(#:phases
  146. (modify-phases %standard-phases
  147. (add-after 'install 'wrap-program
  148. (lambda* (#:key inputs outputs #:allow-other-keys)
  149. (let* ((out (assoc-ref outputs "out"))
  150. (perllib (string-append out "/lib/perl5/site_perl/"
  151. ,(package-version perl))))
  152. (wrap-program (string-append out "/bin/licensecheck")
  153. `("PERL5LIB" ":"
  154. prefix (,(string-append perllib ":" (getenv "PERL5LIB")))))
  155. #t))))))
  156. (home-page "https://metacpan.org/release/App-Licensecheck")
  157. (synopsis "License checker for source files")
  158. (description "Licensecheck attempts to determine the license that applies
  159. to each file passed to it, by searching the start of the file for text
  160. belonging to various licenses.")
  161. (license (package-license perl))))
  162. (define-public reuse
  163. (package
  164. (name "reuse")
  165. (version "1.1.2")
  166. (source
  167. (origin
  168. (method url-fetch)
  169. (uri (pypi-uri "reuse" version))
  170. (sha256
  171. (base32 "0ij2mpdnawjabnsy291157wzci9050dfclwib95phg7pnmd6xsw0"))))
  172. (build-system pyproject-build-system)
  173. (native-inputs
  174. (list python-poetry-core python-pytest))
  175. (inputs
  176. (list python-binaryornot
  177. python-boolean.py
  178. python-debian
  179. python-jinja2
  180. python-license-expression))
  181. (home-page "https://reuse.software/")
  182. (synopsis "Provide and verify copyright and licensing information")
  183. (description
  184. "The REUSE tool helps you achieve and confirm license compliance with the
  185. @uref{https://reuse.software, REUSE specification}, a set of recommendations
  186. for licensing Free Software projects. REUSE makes it easy to declare the
  187. licenses under which your works are released, especially when reusing software
  188. from different projects released under different licenses. It avoids reliance
  189. on fuzzy heuristicts and allows both legal experts and computers to understand
  190. how your project is licensed. This allows generating a \"bill of materials\"
  191. for software.
  192. This tool downloads full license texts, adds copyright and license information
  193. to file headers, and contains a linter to identify problems. There are other
  194. tools that have a lot more features and functionality surrounding the analysis
  195. and inspection of copyright and licenses in software projects. This one is
  196. designed to be simple.")
  197. (license (list asl2.0 gpl3+))))
  198. (define-public licenseheaders
  199. (package
  200. (name "licenseheaders")
  201. (version "0.8.6")
  202. (source
  203. (origin
  204. (method url-fetch)
  205. (uri (pypi-uri "licenseheaders" version))
  206. (sha256
  207. (base32 "073xcm10gyg5kcxqmbsyaz9sr0slbdwgr0r9qanch0zl8i0z9259"))))
  208. (build-system python-build-system)
  209. (arguments
  210. `(#:phases
  211. (modify-phases %standard-phases
  212. ;; Reported upstream:
  213. ;; <https://github.com/johann-petrak/licenseheaders/issues/47>.
  214. (add-after 'unpack 'patch-code
  215. (lambda _
  216. (substitute* "licenseheaders.py"
  217. (("\\\"filenames\\\": \\[\\\"CMakeLists.txt\\\"\\],")
  218. "\"filenames\": [\"CMakeLists.txt\"], \n \"extensions\": [],"))
  219. #t)))))
  220. (propagated-inputs
  221. (list python-regex))
  222. (home-page "https://github.com/johann-petrak/licenseheaders")
  223. (synopsis "Add or change license headers for all files in a directory")
  224. (description
  225. "Licenseheaders is a Python 3 tool to update, change or add license
  226. headers to all files of any of the supported types in or below some
  227. directory.")
  228. (license expat)))