Skip to content

Commit 32dad5c

Browse files
authored
Merge pull request #6944 from phadej/spdx-license-list-3.9
Fix #6879: Use SPDX License list 3.9 for cabal-version: 3.4
2 parents 1b562e3 + da87bf0 commit 32dad5c

File tree

14 files changed

+765
-496
lines changed

14 files changed

+765
-496
lines changed

Cabal/Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,13 @@ instance Arbitrary RepoKind where
335335
-------------------------------------------------------------------------------
336336

337337
instance Arbitrary LicenseId where
338-
arbitrary = elements $ licenseIdList LicenseListVersion_3_6
338+
arbitrary = elements $ licenseIdList currentLicenseListVersion
339339

340340
instance Arbitrary LicenseExceptionId where
341-
arbitrary = elements $ licenseExceptionIdList LicenseListVersion_3_6
341+
arbitrary = elements $ licenseExceptionIdList currentLicenseListVersion
342+
343+
currentLicenseListVersion :: LicenseListVersion
344+
currentLicenseListVersion = cabalSpecVersionToSPDXListVersion cabalSpecLatest
342345

343346
instance Arbitrary LicenseRef where
344347
arbitrary = mkLicenseRef' <$> ids' <*> ids

Cabal/Distribution/SPDX/LicenseExceptionId.hs

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,30 @@ data LicenseExceptionId
4747
| GCC_exception_2_0 -- ^ @GCC-exception-2.0@, GCC Runtime Library exception 2.0
4848
| GCC_exception_3_1 -- ^ @GCC-exception-3.1@, GCC Runtime Library exception 3.1
4949
| Gnu_javamail_exception -- ^ @gnu-javamail-exception@, GNU JavaMail exception
50-
| GPL_3_0_linking_exception -- ^ @GPL-3.0-linking-exception@, GPL-3.0 Linking Exception, SPDX License List 3.8
51-
| GPL_3_0_linking_source_exception -- ^ @GPL-3.0-linking-source-exception@, GPL-3.0 Linking Exception (with Corresponding Source), SPDX License List 3.8
52-
| GPL_CC_1_0 -- ^ @GPL-CC-1.0@, GPL Cooperation Commitment 1.0, SPDX License List 3.6, SPDX License List 3.8
50+
| GPL_3_0_linking_exception -- ^ @GPL-3.0-linking-exception@, GPL-3.0 Linking Exception, SPDX License List 3.9
51+
| GPL_3_0_linking_source_exception -- ^ @GPL-3.0-linking-source-exception@, GPL-3.0 Linking Exception (with Corresponding Source), SPDX License List 3.9
52+
| GPL_CC_1_0 -- ^ @GPL-CC-1.0@, GPL Cooperation Commitment 1.0, SPDX License List 3.6, SPDX License List 3.9
5353
| I2p_gpl_java_exception -- ^ @i2p-gpl-java-exception@, i2p GPL+Java Exception
54+
| LGPL_3_0_linking_exception -- ^ @LGPL-3.0-linking-exception@, LGPL-3.0 Linking Exception, SPDX License List 3.9
5455
| Libtool_exception -- ^ @Libtool-exception@, Libtool Exception
5556
| Linux_syscall_note -- ^ @Linux-syscall-note@, Linux Syscall Note
56-
| LLVM_exception -- ^ @LLVM-exception@, LLVM Exception, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.8
57+
| LLVM_exception -- ^ @LLVM-exception@, LLVM Exception, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9
5758
| LZMA_exception -- ^ @LZMA-exception@, LZMA exception
5859
| Mif_exception -- ^ @mif-exception@, Macros and Inline Functions Exception
5960
| Nokia_Qt_exception_1_1 -- ^ @Nokia-Qt-exception-1.1@, Nokia Qt LGPL exception 1.1, SPDX License List 3.0, SPDX License List 3.2
60-
| OCaml_LGPL_linking_exception -- ^ @OCaml-LGPL-linking-exception@, OCaml LGPL Linking Exception, SPDX License List 3.6, SPDX License List 3.8
61+
| OCaml_LGPL_linking_exception -- ^ @OCaml-LGPL-linking-exception@, OCaml LGPL Linking Exception, SPDX License List 3.6, SPDX License List 3.9
6162
| OCCT_exception_1_0 -- ^ @OCCT-exception-1.0@, Open CASCADE Exception 1.0
62-
| OpenJDK_assembly_exception_1_0 -- ^ @OpenJDK-assembly-exception-1.0@, OpenJDK Assembly exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.8
63+
| OpenJDK_assembly_exception_1_0 -- ^ @OpenJDK-assembly-exception-1.0@, OpenJDK Assembly exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9
6364
| Openvpn_openssl_exception -- ^ @openvpn-openssl-exception@, OpenVPN OpenSSL Exception
64-
| PS_or_PDF_font_exception_20170817 -- ^ @PS-or-PDF-font-exception-20170817@, PS/PDF font exception (2017-08-17), SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.8
65-
| Qt_GPL_exception_1_0 -- ^ @Qt-GPL-exception-1.0@, Qt GPL exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.8
66-
| Qt_LGPL_exception_1_1 -- ^ @Qt-LGPL-exception-1.1@, Qt LGPL exception 1.1, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.8
65+
| PS_or_PDF_font_exception_20170817 -- ^ @PS-or-PDF-font-exception-20170817@, PS/PDF font exception (2017-08-17), SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9
66+
| Qt_GPL_exception_1_0 -- ^ @Qt-GPL-exception-1.0@, Qt GPL exception 1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9
67+
| Qt_LGPL_exception_1_1 -- ^ @Qt-LGPL-exception-1.1@, Qt LGPL exception 1.1, SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9
6768
| Qwt_exception_1_0 -- ^ @Qwt-exception-1.0@, Qwt exception 1.0
68-
| Swift_exception -- ^ @Swift-exception@, Swift Exception, SPDX License List 3.6, SPDX License List 3.8
69+
| SHL_2_0 -- ^ @SHL-2.0@, Solderpad Hardware License v2.0, SPDX License List 3.9
70+
| SHL_2_1 -- ^ @SHL-2.1@, Solderpad Hardware License v2.1, SPDX License List 3.9
71+
| Swift_exception -- ^ @Swift-exception@, Swift Exception, SPDX License List 3.6, SPDX License List 3.9
6972
| U_boot_exception_2_0 -- ^ @u-boot-exception-2.0@, U-Boot exception 2.0
70-
| Universal_FOSS_exception_1_0 -- ^ @Universal-FOSS-exception-1.0@, Universal FOSS Exception, Version 1.0, SPDX License List 3.6, SPDX License List 3.8
73+
| Universal_FOSS_exception_1_0 -- ^ @Universal-FOSS-exception-1.0@, Universal FOSS Exception, Version 1.0, SPDX License List 3.6, SPDX License List 3.9
7174
| WxWindows_exception_3_1 -- ^ @WxWindows-exception-3.1@, WxWindows Library Exception 3.1
7275
deriving (Eq, Ord, Enum, Bounded, Show, Read, Typeable, Data, Generic)
7376

@@ -122,6 +125,7 @@ licenseExceptionId GPL_3_0_linking_exception = "GPL-3.0-linking-exception"
122125
licenseExceptionId GPL_3_0_linking_source_exception = "GPL-3.0-linking-source-exception"
123126
licenseExceptionId GPL_CC_1_0 = "GPL-CC-1.0"
124127
licenseExceptionId I2p_gpl_java_exception = "i2p-gpl-java-exception"
128+
licenseExceptionId LGPL_3_0_linking_exception = "LGPL-3.0-linking-exception"
125129
licenseExceptionId Libtool_exception = "Libtool-exception"
126130
licenseExceptionId Linux_syscall_note = "Linux-syscall-note"
127131
licenseExceptionId LLVM_exception = "LLVM-exception"
@@ -136,6 +140,8 @@ licenseExceptionId PS_or_PDF_font_exception_20170817 = "PS-or-PDF-font-exception
136140
licenseExceptionId Qt_GPL_exception_1_0 = "Qt-GPL-exception-1.0"
137141
licenseExceptionId Qt_LGPL_exception_1_1 = "Qt-LGPL-exception-1.1"
138142
licenseExceptionId Qwt_exception_1_0 = "Qwt-exception-1.0"
143+
licenseExceptionId SHL_2_0 = "SHL-2.0"
144+
licenseExceptionId SHL_2_1 = "SHL-2.1"
139145
licenseExceptionId Swift_exception = "Swift-exception"
140146
licenseExceptionId U_boot_exception_2_0 = "u-boot-exception-2.0"
141147
licenseExceptionId Universal_FOSS_exception_1_0 = "Universal-FOSS-exception-1.0"
@@ -163,6 +169,7 @@ licenseExceptionName GPL_3_0_linking_exception = "GPL-3.0 Linking Exception"
163169
licenseExceptionName GPL_3_0_linking_source_exception = "GPL-3.0 Linking Exception (with Corresponding Source)"
164170
licenseExceptionName GPL_CC_1_0 = "GPL Cooperation Commitment 1.0"
165171
licenseExceptionName I2p_gpl_java_exception = "i2p GPL+Java Exception"
172+
licenseExceptionName LGPL_3_0_linking_exception = "LGPL-3.0 Linking Exception"
166173
licenseExceptionName Libtool_exception = "Libtool Exception"
167174
licenseExceptionName Linux_syscall_note = "Linux Syscall Note"
168175
licenseExceptionName LLVM_exception = "LLVM Exception"
@@ -177,6 +184,8 @@ licenseExceptionName PS_or_PDF_font_exception_20170817 = "PS/PDF font exception
177184
licenseExceptionName Qt_GPL_exception_1_0 = "Qt GPL exception 1.0"
178185
licenseExceptionName Qt_LGPL_exception_1_1 = "Qt LGPL exception 1.1"
179186
licenseExceptionName Qwt_exception_1_0 = "Qwt exception 1.0"
187+
licenseExceptionName SHL_2_0 = "Solderpad Hardware License v2.0"
188+
licenseExceptionName SHL_2_1 = "Solderpad Hardware License v2.1"
180189
licenseExceptionName Swift_exception = "Swift Exception"
181190
licenseExceptionName U_boot_exception_2_0 = "U-Boot exception 2.0"
182191
licenseExceptionName Universal_FOSS_exception_1_0 = "Universal FOSS Exception, Version 1.0"
@@ -212,16 +221,19 @@ licenseExceptionIdList LicenseListVersion_3_6 =
212221
, Universal_FOSS_exception_1_0
213222
]
214223
++ bulkOfLicenses
215-
licenseExceptionIdList LicenseListVersion_3_8 =
224+
licenseExceptionIdList LicenseListVersion_3_9 =
216225
[ GPL_3_0_linking_exception
217226
, GPL_3_0_linking_source_exception
218227
, GPL_CC_1_0
228+
, LGPL_3_0_linking_exception
219229
, LLVM_exception
220230
, OCaml_LGPL_linking_exception
221231
, OpenJDK_assembly_exception_1_0
222232
, PS_or_PDF_font_exception_20170817
223233
, Qt_GPL_exception_1_0
224234
, Qt_LGPL_exception_1_1
235+
, SHL_2_0
236+
, SHL_2_1
225237
, Swift_exception
226238
, Universal_FOSS_exception_1_0
227239
]
@@ -232,7 +244,7 @@ mkLicenseExceptionId :: LicenseListVersion -> String -> Maybe LicenseExceptionId
232244
mkLicenseExceptionId LicenseListVersion_3_0 s = Map.lookup s stringLookup_3_0
233245
mkLicenseExceptionId LicenseListVersion_3_2 s = Map.lookup s stringLookup_3_2
234246
mkLicenseExceptionId LicenseListVersion_3_6 s = Map.lookup s stringLookup_3_6
235-
mkLicenseExceptionId LicenseListVersion_3_8 s = Map.lookup s stringLookup_3_8
247+
mkLicenseExceptionId LicenseListVersion_3_9 s = Map.lookup s stringLookup_3_9
236248

237249
stringLookup_3_0 :: Map String LicenseExceptionId
238250
stringLookup_3_0 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $
@@ -246,9 +258,9 @@ stringLookup_3_6 :: Map String LicenseExceptionId
246258
stringLookup_3_6 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $
247259
licenseExceptionIdList LicenseListVersion_3_6
248260

249-
stringLookup_3_8 :: Map String LicenseExceptionId
250-
stringLookup_3_8 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $
251-
licenseExceptionIdList LicenseListVersion_3_8
261+
stringLookup_3_9 :: Map String LicenseExceptionId
262+
stringLookup_3_9 = Map.fromList $ map (\i -> (licenseExceptionId i, i)) $
263+
licenseExceptionIdList LicenseListVersion_3_9
252264

253265
-- | License exceptions in all SPDX License lists
254266
bulkOfLicenses :: [LicenseExceptionId]

0 commit comments

Comments
 (0)