licenses: Add 'agpl3' and 'agpl3+'.
[jackhill/guix/guix.git] / guix / licenses.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (guix licenses)
22 #:use-module (srfi srfi-9)
23 #:export (license? license-name license-uri license-comment
24 agpl3 agpl3+
25 asl2.0
26 boost1.0
27 bsd-2 bsd-3 bsd-4 bsd-style
28 cddl1.0
29 cpl1.0
30 epl1.0
31 expat
32 freetype
33 gpl1 gpl1+ gpl2 gpl2+ gpl3 gpl3+
34 isc
35 ijg
36 ibmpl1.0
37 lgpl2.0 lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3 lgpl3+
38 mpl2.0
39 openldap2.8 openssl
40 psfl public-domain
41 qpl
42 vim
43 x11 x11-style
44 zlib
45 fsf-free))
46
47 (define-record-type <license>
48 (license name uri comment)
49 license?
50 (name license-name)
51 (uri license-uri)
52 (comment license-comment))
53
54 ;;; Commentary:
55 ;;;
56 ;;; Available licenses.
57 ;;;
58 ;;; This list is based on these links:
59 ;;; https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/licenses.nix
60 ;;; https://www.gnu.org/licenses/license-list
61 ;;;
62 ;;; Code:
63
64 (define agpl3
65 (license "AGPL 3"
66 "https://gnu.org/licenses/agpl.html"
67 "https://gnu.org/licenses/why-affero-gpl.html"))
68
69 (define agpl3+
70 (license "AGPL 3+"
71 "https://gnu.org/licenses/agpl.html"
72 "https://gnu.org/licenses/why-affero-gpl.html"))
73
74 (define asl2.0
75 (license "ASL 2.0"
76 "http://directory.fsf.org/wiki/License:Apache2.0"
77 "https://www.gnu.org/licenses/license-list#apache2"))
78
79 (define boost1.0
80 (license "Boost 1.0"
81 "http://directory.fsf.org/wiki/License:Boost1.0"
82 "https://www.gnu.org/licenses/license-list#boost"))
83
84 (define bsd-2
85 (license "FreeBSD"
86 "http://directory.fsf.org/wiki/License:FreeBSD"
87 "https://www.gnu.org/licenses/license-list#FreeBSD"))
88
89 (define bsd-3
90 (license "Modified BSD"
91 "http://directory.fsf.org/wiki/License:BSD_3Clause"
92 "https://www.gnu.org/licenses/license-list#ModifiedBSD"))
93
94 (define bsd-4
95 (license "Original BSD"
96 "http://directory.fsf.org/wiki/License:BSD_4Clause"
97 "https://www.gnu.org/licenses/license-list#OriginalBSD"))
98
99 (define* (bsd-style uri #:optional (comment ""))
100 "Return a BSD-style license, whose full text can be found at URI,
101 which may be a file:// URI pointing the package's tree."
102 (license "BSD-style"
103 uri
104 (string-append
105 "This is a BSD-style, non-copyleft free software license. "
106 "Check the URI for details. "
107 comment)))
108
109 (define cddl1.0
110 (license "CDDL 1.0"
111 "http://directory.fsf.org/wiki/License:CDDLv1.0"
112 "https://www.gnu.org/licenses/license-list#CDDL"))
113
114 (define cpl1.0
115 (license "CPL 1.0"
116 "http://directory.fsf.org/wiki/License:CPLv1.0"
117 "https://www.gnu.org/licenses/license-list#CommonPublicLicense10"))
118
119 (define epl1.0
120 (license "EPL 1.0"
121 "http://directory.fsf.org/wiki/License:EPLv1.0"
122 "https://www.gnu.org/licenses/license-list#EPL"))
123
124 (define expat
125 (license "Expat"
126 "http://directory.fsf.org/wiki/License:Expat"
127 "https://www.gnu.org/licenses/license-list.html#Expat"))
128
129 (define freetype
130 (license "Freetype"
131 "http://directory.fsf.org/wiki/License:Freetype"
132 "https://www.gnu.org/licenses/license-list.html#freetype"))
133
134 (define gpl1
135 (license "GPL 1"
136 "https://www.gnu.org/licenses/old-licenses/gpl-1.0.html"
137 #f))
138
139 (define gpl1+
140 (license "GPL 1+"
141 "https://www.gnu.org/licenses/old-licenses/gpl-1.0.html"
142 #f))
143
144 (define gpl2
145 (license "GPL 2"
146 "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
147 "https://www.gnu.org/licenses/license-list#GPLv2"))
148
149 (define gpl2+
150 (license "GPL 2+"
151 "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
152 "https://www.gnu.org/licenses/license-list#GPLv2"))
153
154 (define gpl3
155 (license "GPL 3"
156 "https://www.gnu.org/licenses/gpl.html"
157 "https://www.gnu.org/licenses/license-list#GNUGPLv3"))
158
159 (define gpl3+
160 (license "GPL 3+"
161 "https://www.gnu.org/licenses/gpl.html"
162 "https://www.gnu.org/licenses/license-list#GNUGPLv3"))
163
164 (define isc
165 (license "ISC"
166 "http://directory.fsf.org/wiki/License:ISC"
167 "https://www.gnu.org/licenses/license-list.html#ISC"))
168
169 (define ijg
170 (license "IJG"
171 "http://directory.fsf.org/wiki/License:JPEG"
172 "https://www.gnu.org/licenses/license-list#ijg"))
173
174 (define ibmpl1.0
175 (license "IBMPL 1.0"
176 "http://directory.fsf.org/wiki/License:IBMPLv1.0"
177 "https://www.gnu.org/licenses/license-list#IBMPL"))
178
179 (define lgpl2.0
180 (license "LGPL 2.0"
181 "https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html"
182 "https://www.gnu.org/licenses/why-not-lgpl.html"))
183
184 (define lgpl2.0+
185 (license "LGPL 2.0+"
186 "https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html"
187 "https://www.gnu.org/licenses/why-not-lgpl.html"))
188
189 (define lgpl2.1
190 (license "LGPL 2.1"
191 "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html"
192 "https://www.gnu.org/licenses/license-list#LGPLv2.1"))
193
194 (define lgpl2.1+
195 (license "LGPL 2.1+"
196 "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html"
197 "https://www.gnu.org/licenses/license-list#LGPLv2.1"))
198
199 (define lgpl3
200 (license "LGPL 3"
201 "https://www.gnu.org/licenses/lgpl.html"
202 "https://www.gnu.org/licenses/license-list#LGPLv3"))
203
204 (define lgpl3+
205 (license "LGPL 3+"
206 "https://www.gnu.org/licenses/lgpl.html"
207 "https://www.gnu.org/licenses/license-list#LGPLv3"))
208
209 (define mpl2.0
210 (license "MPL 2.0"
211 "http://directory.fsf.org/wiki/License:MPLv2.0"
212 "https://www.gnu.org/licenses/license-list#MPL-2.0"))
213
214 (define openssl
215 (license "OpenSSL"
216 "http://directory.fsf.org/wiki/License:OpenSSL"
217 "https://www.gnu.org/licenses/license-list#OpenSSL"))
218
219 (define openldap2.8
220 (license "OpenLDAPv2.8"
221 "http://directory.fsf.org/wiki/License:OpenLDAPv2.8"
222 "https://www.gnu.org/licenses/license-list#newOpenLDAP"))
223 ;; lists OpenLDAPv2.7, which is virtually identical
224
225 (define psfl
226 (license "Python Software Foundation License"
227 "http://docs.python.org/license.html"
228 #f))
229
230 (define public-domain
231 (license "Public Domain"
232 "http://directory.fsf.org/wiki/License:PublicDomain"
233 "https://www.gnu.org/licenses/license-list#PublicDomain"))
234
235 (define qpl
236 (license "QPL"
237 "http://directory.fsf.org/wiki/License:QPLv1.0"
238 "http://www.gnu.org/licenses/license-list.html#QPL"))
239
240 (define vim
241 (license "Vim"
242 "http://directory.fsf.org/wiki/License:Vim7.2"
243 "http://www.gnu.org/licenses/license-list.html#Vim"))
244
245 (define x11
246 (license "X11"
247 "http://directory.fsf.org/wiki/License:X11"
248 "https://www.gnu.org/licenses/license-list#X11License"))
249
250 (define* (x11-style uri #:optional (comment ""))
251 "Return an X11-style license, whose full text can be found at URI,
252 which may be a file:// URI pointing the package's tree."
253 (license "X11-style"
254 uri
255 (string-append
256 "This is an X11-style, non-copyleft free software license. "
257 "Check the URI for details. "
258 comment)))
259
260 (define zlib
261 (license "Zlib"
262 "http://www.gzip.org/zlib/zlib_license.html"
263 "https://www.gnu.org/licenses/license-list#ZLib"))
264
265 (define* (fsf-free uri #:optional (comment ""))
266 "Return a license that does not fit any of the ones above or a collection
267 of licenses, approved as free by the FSF. More details can be found at URI."
268 (license "FSF-free"
269 uri
270 comment))
271
272 ;;; licenses.scm ends here