Merge pull request #10546 from cabalism/fix/dedup-using-config-from
[cabal.git] / Cabal-syntax / src / Distribution / SPDX / LicenseListVersion.hs
blobcf12323d2757fe8d9851234eb18321eeb6358b0c
1 module Distribution.SPDX.LicenseListVersion
2 ( LicenseListVersion (..)
3 , cabalSpecVersionToSPDXListVersion
4 ) where
6 import Distribution.CabalSpecVersion
8 -- | SPDX License List version @Cabal@ is aware of.
9 data LicenseListVersion
10 = LicenseListVersion_3_0
11 | LicenseListVersion_3_2
12 | LicenseListVersion_3_6
13 | LicenseListVersion_3_9
14 | LicenseListVersion_3_10
15 | LicenseListVersion_3_16
16 | LicenseListVersion_3_23
17 | LicenseListVersion_3_25
18 deriving (Eq, Ord, Show, Enum, Bounded)
20 cabalSpecVersionToSPDXListVersion :: CabalSpecVersion -> LicenseListVersion
21 cabalSpecVersionToSPDXListVersion CabalSpecV3_14 = LicenseListVersion_3_25
22 cabalSpecVersionToSPDXListVersion CabalSpecV3_12 = LicenseListVersion_3_23
23 cabalSpecVersionToSPDXListVersion CabalSpecV3_8 = LicenseListVersion_3_16
24 cabalSpecVersionToSPDXListVersion CabalSpecV3_6 = LicenseListVersion_3_10
25 cabalSpecVersionToSPDXListVersion CabalSpecV3_4 = LicenseListVersion_3_9
26 cabalSpecVersionToSPDXListVersion CabalSpecV3_0 = LicenseListVersion_3_6
27 cabalSpecVersionToSPDXListVersion CabalSpecV2_4 = LicenseListVersion_3_2
28 cabalSpecVersionToSPDXListVersion _ = LicenseListVersion_3_0