import: utils: Add spdx-string->license.
[jackhill/guix/guix.git] / guix / licenses.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
8 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
9 ;;; Copyright © 2016 Fabian Harfert <fhmgufs@web.de>
10 ;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (guix licenses)
28 #:use-module (srfi srfi-9)
29 #:export (license? license-name license-uri license-comment
30 agpl1 agpl3 agpl3+
31 asl1.1 asl2.0
32 boost1.0
33 bsd-2 bsd-3 bsd-4
34 non-copyleft
35 bsd-style ;deprecated!
36 cc0
37 cc-by2.0 cc-by3.0 cc-by-sa2.0 cc-by-sa3.0 cc-by-sa4.0
38 cddl1.0
39 cecill-c
40 artistic2.0 clarified-artistic
41 copyleft-next
42 cpl1.0
43 epl1.0
44 expat
45 freetype
46 giftware
47 gpl1 gpl1+ gpl2 gpl2+ gpl3 gpl3+
48 gfl1.0
49 fdl1.1+ fdl1.3+
50 opl1.0+
51 isc
52 ijg
53 ibmpl1.0
54 imlib2
55 ipa
56 lgpl2.0 lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3 lgpl3+
57 mpl1.0 mpl1.1 mpl2.0
58 ms-pl
59 ncsa
60 nmap
61 openldap2.8 openssl
62 psfl public-domain
63 qpl
64 repoze
65 ruby
66 sgifreeb2.0
67 silofl1.1
68 sleepycat
69 tcl/tk
70 unlicense
71 vim
72 x11 x11-style
73 zpl2.1
74 zlib
75 fsf-free))
76
77 (define-record-type <license>
78 (license name uri comment)
79 license?
80 (name license-name)
81 (uri license-uri)
82 (comment license-comment))
83
84 ;;; Commentary:
85 ;;;
86 ;;; Available licenses.
87 ;;;
88 ;;; This list is based on these links:
89 ;;; https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix
90 ;;; https://www.gnu.org/licenses/license-list
91 ;;;
92 ;;; Code:
93
94 (define agpl1
95 (license "AGPL 1"
96 "https://gnu.org/licenses/agpl.html"
97 "https://gnu.org/licenses/why-affero-gpl.html"))
98
99 (define agpl3
100 (license "AGPL 3"
101 "https://gnu.org/licenses/agpl.html"
102 "https://gnu.org/licenses/why-affero-gpl.html"))
103
104 (define agpl3+
105 (license "AGPL 3+"
106 "https://gnu.org/licenses/agpl.html"
107 "https://gnu.org/licenses/why-affero-gpl.html"))
108
109 (define asl1.1
110 (license "ASL 1.1"
111 "http://directory.fsf.org/wiki/License:Apache1.1"
112 "https://www.gnu.org/licenses/license-list#apache1"))
113
114 (define asl2.0
115 (license "ASL 2.0"
116 "http://directory.fsf.org/wiki/License:Apache2.0"
117 "https://www.gnu.org/licenses/license-list#apache2"))
118
119 (define boost1.0
120 (license "Boost 1.0"
121 "http://directory.fsf.org/wiki/License:Boost1.0"
122 "https://www.gnu.org/licenses/license-list#boost"))
123
124 (define bsd-2
125 (license "FreeBSD"
126 "http://directory.fsf.org/wiki/License:FreeBSD"
127 "https://www.gnu.org/licenses/license-list#FreeBSD"))
128
129 (define bsd-3
130 (license "Modified BSD"
131 "http://directory.fsf.org/wiki/License:BSD_3Clause"
132 "https://www.gnu.org/licenses/license-list#ModifiedBSD"))
133
134 (define bsd-4
135 (license "Original BSD"
136 "http://directory.fsf.org/wiki/License:BSD_4Clause"
137 "https://www.gnu.org/licenses/license-list#OriginalBSD"))
138
139 (define* (non-copyleft uri #:optional (comment ""))
140 "Return a lax, permissive, non-copyleft license (for example a variant of
141 the 3-clause BSD license or the Expat license), whose full text can be found
142 at URI, which may be a file:// URI pointing the package's tree."
143 (license "non-copyleft"
144 uri
145 (string-append
146 "This is a lax, non-copyleft free software license. "
147 "Check the URI for details. "
148 comment)))
149
150 (define bsd-style
151 ;; This alias is kept for backward-compatibility. Do not use it for new
152 ;; packages: it is ambiguous, as rightfully explained at
153 ;; <http://www.gnu.org/philosophy/words-to-avoid.html#BSD-style>.
154 non-copyleft)
155
156 (define cc0
157 (license "CC0"
158 "http://directory.fsf.org/wiki/License:CC0"
159 "http://www.gnu.org/licenses/license-list.html#CC0"))
160
161 (define cc-by-sa4.0
162 (license "CC-BY-SA 4.0"
163 "http://creativecommons.org/licenses/by-sa/4.0/"
164 "Creative Commons Attribution-ShareAlike 4.0 International"))
165
166 (define cc-by-sa3.0
167 (license "CC-BY-SA 3.0"
168 "http://creativecommons.org/licenses/by-sa/3.0/"
169 "Creative Commons Attribution-ShareAlike 3.0 Unported"))
170
171 (define cc-by-sa2.0
172 (license "CC-BY-SA 2.0"
173 "http://creativecommons.org/licenses/by-sa/2.0/"
174 "Creative Commons Attribution-ShareAlike 2.0 Generic"))
175
176 (define cc-by3.0
177 (license "CC-BY 3.0"
178 "http://creativecommons.org/licenses/by/3.0/"
179 "Creative Commons Attribution 3.0 Unported"))
180
181 (define cc-by2.0
182 (license "CC-BY 2.0"
183 "http://creativecommons.org/licenses/by/2.0/"
184 "Creative Commons Attribution 2.0 Generic"))
185
186 (define cddl1.0
187 (license "CDDL 1.0"
188 "http://directory.fsf.org/wiki/License:CDDLv1.0"
189 "https://www.gnu.org/licenses/license-list#CDDL"))
190
191 (define cecill-c
192 (license "CeCILL-C"
193 "http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html"
194 "https://www.gnu.org/licenses/license-list.html#CeCILL"))
195
196 (define artistic2.0
197 (license "Artistic License 2.0"
198 "http://www.perlfoundation.org/artistic_license_2_0"
199 "http://www.gnu.org/licenses/license-list.html#ArtisticLicense2"))
200
201 (define clarified-artistic
202 (license "Clarified Artistic"
203 ;; http://directory.fsf.org/wiki/User:Jgay/license-categorization#Clarified_Artistic_License
204 "http://gianluca.dellavedova.org/2011/01/03/clarified-artistic-license/"
205 "https://www.gnu.org/licenses/license-list.html#ArtisticLicense2"))
206
207 (define copyleft-next
208 (license "copyleft-next"
209 "https://raw.github.com/richardfontana/copyleft-next/master/Releases/copyleft-next-0.3.0"
210 "GPL-compatible copyleft license"))
211
212 (define cpl1.0
213 (license "CPL 1.0"
214 "http://directory.fsf.org/wiki/License:CPLv1.0"
215 "https://www.gnu.org/licenses/license-list#CommonPublicLicense10"))
216
217 (define epl1.0
218 (license "EPL 1.0"
219 "http://directory.fsf.org/wiki/License:EPLv1.0"
220 "https://www.gnu.org/licenses/license-list#EPL"))
221
222 (define expat
223 (license "Expat"
224 "http://directory.fsf.org/wiki/License:Expat"
225 "https://www.gnu.org/licenses/license-list.html#Expat"))
226
227 (define freetype
228 (license "Freetype"
229 "http://directory.fsf.org/wiki/License:Freetype"
230 "https://www.gnu.org/licenses/license-list.html#freetype"))
231
232 (define giftware
233 (license "Giftware"
234 "http://liballeg.org/license.html"
235 "The Allegro 4 license"))
236
237 (define gpl1
238 (license "GPL 1"
239 "https://www.gnu.org/licenses/old-licenses/gpl-1.0.html"
240 #f))
241
242 (define gpl1+
243 (license "GPL 1+"
244 "https://www.gnu.org/licenses/old-licenses/gpl-1.0.html"
245 #f))
246
247 (define gpl2
248 (license "GPL 2"
249 "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
250 "https://www.gnu.org/licenses/license-list#GPLv2"))
251
252 (define gpl2+
253 (license "GPL 2+"
254 "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
255 "https://www.gnu.org/licenses/license-list#GPLv2"))
256
257 (define gpl3
258 (license "GPL 3"
259 "https://www.gnu.org/licenses/gpl.html"
260 "https://www.gnu.org/licenses/license-list#GNUGPLv3"))
261
262 (define gpl3+
263 (license "GPL 3+"
264 "https://www.gnu.org/licenses/gpl.html"
265 "https://www.gnu.org/licenses/license-list#GNUGPLv3"))
266
267 ;; The “GUST font license” is legally equivalent to LPPL v1.3c as it only
268 ;; extends the LPPL with an optional request.
269 (define gfl1.0
270 (license "GUST font license 1.0"
271 "http://www.gust.org.pl/projects/e-foundry/licenses/GUST-FONT-LICENSE.txt"
272 "https://www.gnu.org/licenses/license-list#LPPL-1.3a"))
273
274 (define fdl1.1+
275 (license "FDL 1.1+"
276 "https://www.gnu.org/licenses/fdl-1.1"
277 "https://www.gnu.org/licenses/license-list#FDL"))
278
279 (define fdl1.2+
280 (license "FDL 1.2+"
281 "https://www.gnu.org/licenses/fdl-1.2"
282 "https://www.gnu.org/licenses/license-list#FDL"))
283
284 (define fdl1.3+
285 (license "FDL 1.3+"
286 "https://www.gnu.org/licenses/fdl.html"
287 "https://www.gnu.org/licenses/license-list#FDL"))
288
289 (define opl1.0+
290 (license "Open Publication License 1.0 or later"
291 "http://opencontent.org/openpub/"
292 "https://www.gnu.org/licenses/license-list#OpenPublicationL"))
293
294 (define isc
295 (license "ISC"
296 "http://directory.fsf.org/wiki/License:ISC"
297 "https://www.gnu.org/licenses/license-list.html#ISC"))
298
299 (define ijg
300 (license "IJG"
301 "http://directory.fsf.org/wiki/License:JPEG"
302 "https://www.gnu.org/licenses/license-list#ijg"))
303
304 (define ibmpl1.0
305 (license "IBMPL 1.0"
306 "http://directory.fsf.org/wiki/License:IBMPLv1.0"
307 "https://www.gnu.org/licenses/license-list#IBMPL"))
308
309 (define imlib2
310 (license "Imlib2"
311 "http://directory.fsf.org/wiki/License:Imlib2"
312 "https://www.gnu.org/licenses/license-list#imlib"))
313
314 (define ipa
315 (license "IPA Font License"
316 "http://directory.fsf.org/wiki/License:IPA_Font_License"
317 "https://www.gnu.org/licenses/license-list#IPAFONT"))
318
319 (define lgpl2.0
320 (license "LGPL 2.0"
321 "https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html"
322 "https://www.gnu.org/licenses/why-not-lgpl.html"))
323
324 (define lgpl2.0+
325 (license "LGPL 2.0+"
326 "https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html"
327 "https://www.gnu.org/licenses/why-not-lgpl.html"))
328
329 (define lgpl2.1
330 (license "LGPL 2.1"
331 "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html"
332 "https://www.gnu.org/licenses/license-list#LGPLv2.1"))
333
334 (define lgpl2.1+
335 (license "LGPL 2.1+"
336 "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html"
337 "https://www.gnu.org/licenses/license-list#LGPLv2.1"))
338
339 (define lgpl3
340 (license "LGPL 3"
341 "https://www.gnu.org/licenses/lgpl.html"
342 "https://www.gnu.org/licenses/license-list#LGPLv3"))
343
344 (define lgpl3+
345 (license "LGPL 3+"
346 "https://www.gnu.org/licenses/lgpl.html"
347 "https://www.gnu.org/licenses/license-list#LGPLv3"))
348
349 (define mpl1.0
350 (license "MPL 1.0"
351 "http://www.mozilla.org/MPL/1.0/"
352 "https://www.gnu.org/licenses/license-list.html#MPL"))
353
354 (define mpl1.1
355 (license "MPL 1.1"
356 "http://directory.fsf.org/wiki/License:MPLv1.1"
357 "https://www.gnu.org/licenses/license-list#MPL"))
358
359 (define mpl2.0
360 (license "MPL 2.0"
361 "http://directory.fsf.org/wiki/License:MPLv2.0"
362 "https://www.gnu.org/licenses/license-list#MPL-2.0"))
363
364 (define ms-pl
365 (license "Ms-PL" ;Microsoft Public License
366 "http://directory.fsf.org/wiki/License:MsPL"
367 "http://www.gnu.org/licenses/license-list.html#ms-pl"))
368
369 (define ncsa
370 (license "NCSA/University of Illinois Open Source License"
371 "http://directory.fsf.org/wiki/License:IllinoisNCSA"
372 "https://www.gnu.org/licenses/license-list#NCSA"))
373
374 (define nmap
375 (license "Nmap license"
376 "https://svn.nmap.org/nmap/COPYING"
377 "https://fedoraproject.org/wiki/Licensing/Nmap"))
378
379 (define openssl
380 (license "OpenSSL"
381 "http://directory.fsf.org/wiki/License:OpenSSL"
382 "https://www.gnu.org/licenses/license-list#OpenSSL"))
383
384 (define openldap2.8
385 (license "OpenLDAPv2.8"
386 "http://directory.fsf.org/wiki/License:OpenLDAPv2.8"
387 "https://www.gnu.org/licenses/license-list#newOpenLDAP"))
388 ;; lists OpenLDAPv2.7, which is virtually identical
389
390 (define psfl
391 (license "Python Software Foundation License"
392 "http://docs.python.org/license.html"
393 #f))
394
395 (define public-domain
396 (license "Public Domain"
397 "http://directory.fsf.org/wiki/License:PublicDomain"
398 "https://www.gnu.org/licenses/license-list#PublicDomain"))
399
400 (define qpl
401 (license "QPL"
402 "http://directory.fsf.org/wiki/License:QPLv1.0"
403 "http://www.gnu.org/licenses/license-list.html#QPL"))
404
405 (define repoze
406 (license "Repoze"
407 "http://repoze.org/LICENSE.txt"
408 "A BSD-like license with a clause requiring all changes to be
409 attributed by author and date."))
410
411 (define ruby
412 (license "Ruby License"
413 "http://directory.fsf.org/wiki/License:Ruby"
414 "https://www.ruby-lang.org/en/about/license.txt"))
415
416 (define sgifreeb2.0
417 (license "SGI Free Software License B, version 2.0"
418 "http://directory.fsf.org/wiki/License:SGIFreeBv2"
419 "https://www.gnu.org/licenses/license-list.html#SGIFreeB"))
420
421 (define silofl1.1
422 (license "SIL OFL 1.1"
423 "http://scripts.sil.org/OFL_web"
424 "https://www.gnu.org/licenses/license-list#SILOFL"))
425
426 (define sleepycat
427 (license "Sleepycat"
428 "http://directory.fsf.org/wiki/License:Sleepycat"
429 "https://www.gnu.org/licenses/license-list#BerkeleyDB"))
430
431 (define tcl/tk
432 (license "Tcl/Tk"
433 "http://www.tcl.tk/software/tcltk/license.html"
434 "A non-copyleft free software license from the Tcl/Tk project"))
435
436 (define vim
437 (license "Vim"
438 "http://directory.fsf.org/wiki/License:Vim7.2"
439 "http://www.gnu.org/licenses/license-list.html#Vim"))
440
441 (define unlicense
442 (license "Unlicense"
443 "https://unlicense.org/"
444 "https://www.gnu.org/licenses/license-list.html#Unlicense"))
445
446 (define x11
447 (license "X11"
448 "http://directory.fsf.org/wiki/License:X11"
449 "https://www.gnu.org/licenses/license-list#X11License"))
450
451 (define* (x11-style uri #:optional (comment ""))
452 "Return an X11-style license, whose full text can be found at URI,
453 which may be a file:// URI pointing the package's tree."
454 (license "X11-style"
455 uri
456 (string-append
457 "This is an X11-style, non-copyleft free software license. "
458 "Check the URI for details. "
459 comment)))
460
461 (define zpl2.1
462 (license "Zope Public License 2.1"
463 "http://directory.fsf.org/wiki?title=License:ZopePLv2.1"
464 "https://www.gnu.org/licenses/license-list.html#Zope2.0"))
465
466 (define zlib
467 (license "Zlib"
468 "http://www.gzip.org/zlib/zlib_license.html"
469 "https://www.gnu.org/licenses/license-list#ZLib"))
470
471 (define* (fsf-free uri #:optional (comment ""))
472 "Return a license that does not fit any of the ones above or a collection
473 of licenses, approved as free by the FSF. More details can be found at URI."
474 (license "FSF-free"
475 uri
476 comment))
477
478 ;;; licenses.scm ends here