Skip to content

Commit

Permalink
Revert "Update SPDX license Ids & exceptions to 3.20" (#9259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleidukos authored Sep 19, 2023
1 parent 720b6b1 commit a1095e3
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 7,868 deletions.
85 changes: 15 additions & 70 deletions Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs

Large diffs are not rendered by default.

564 changes: 116 additions & 448 deletions Cabal-syntax/src/Distribution/SPDX/LicenseId.hs

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Cabal-syntax/src/Distribution/SPDX/LicenseListVersion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ data LicenseListVersion
| LicenseListVersion_3_9
| LicenseListVersion_3_10
| LicenseListVersion_3_16
| LicenseListVersion_3_20
deriving (Eq, Ord, Show, Enum, Bounded)

cabalSpecVersionToSPDXListVersion :: CabalSpecVersion -> LicenseListVersion
cabalSpecVersionToSPDXListVersion CabalSpecV3_8 = LicenseListVersion_3_20
cabalSpecVersionToSPDXListVersion CabalSpecV3_8 = LicenseListVersion_3_16
cabalSpecVersionToSPDXListVersion CabalSpecV3_6 = LicenseListVersion_3_10
cabalSpecVersionToSPDXListVersion CabalSpecV3_4 = LicenseListVersion_3_9
cabalSpecVersionToSPDXListVersion CabalSpecV3_0 = LicenseListVersion_3_6
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ SPDX_EXCEPTION_HS:=Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs

spdx : $(SPDX_LICENSE_HS) $(SPDX_EXCEPTION_HS)

SPDX_LICENSE_VERSIONS:=3.0 3.2 3.6 3.9 3.10 3.16 3.20
SPDX_LICENSE_VERSIONS:=3.0 3.2 3.6 3.9 3.10 3.16

$(SPDX_LICENSE_HS) : templates/SPDX.LicenseId.template.hs cabal-dev-scripts/src/GenUtils.hs cabal-dev-scripts/src/GenSPDX.hs license-list-data/licenses-3.20.json license-list-data/licenses-3.20.json
$(SPDX_LICENSE_HS) : templates/SPDX.LicenseId.template.hs cabal-dev-scripts/src/GenUtils.hs cabal-dev-scripts/src/GenSPDX.hs license-list-data/licenses-3.0.json license-list-data/licenses-3.2.json
cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-spdx -- templates/SPDX.LicenseId.template.hs $(SPDX_LICENSE_VERSIONS:%=license-list-data/licenses-%.json) $(SPDX_LICENSE_HS)

$(SPDX_EXCEPTION_HS) : templates/SPDX.LicenseExceptionId.template.hs cabal-dev-scripts/src/GenUtils.hs cabal-dev-scripts/src/GenSPDXExc.hs license-list-data/exceptions-3.20.json license-list-data/exceptions-3.20.json
$(SPDX_EXCEPTION_HS) : templates/SPDX.LicenseExceptionId.template.hs cabal-dev-scripts/src/GenUtils.hs cabal-dev-scripts/src/GenSPDXExc.hs license-list-data/exceptions-3.0.json license-list-data/exceptions-3.2.json
cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-spdx-exc -- templates/SPDX.LicenseExceptionId.template.hs $(SPDX_LICENSE_VERSIONS:%=license-list-data/exceptions-%.json) $(SPDX_EXCEPTION_HS)

# source generation: templates
Expand Down
4 changes: 2 additions & 2 deletions cabal-dev-scripts/cabal-dev-scripts.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ executable gen-spdx
ghc-options: -Wall
build-depends:
, aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.1.1.0
, base >=4.10 && <4.19
, base >=4.10 && <4.17
, bytestring
, containers
, Diff ^>=0.4
Expand All @@ -35,7 +35,7 @@ executable gen-spdx-exc
ghc-options: -Wall
build-depends:
, aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.1.1.0
, base >=4.10 && <4.19
, base >=4.10 && <4.17
, bytestring
, containers
, Diff ^>=0.4
Expand Down
1 change: 0 additions & 1 deletion cabal-dev-scripts/src/GenSPDX.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ main = generate =<< O.execParser opts where
<*> licenses "3.9"
<*> licenses "3.10"
<*> licenses "3.16"
<*> licenses "3.20"

template = O.strArgument $ mconcat
[ O.metavar "SPDX.LicenseId.template.hs"
Expand Down
1 change: 0 additions & 1 deletion cabal-dev-scripts/src/GenSPDXExc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ main = generate =<< O.execParser opts where
<*> licenses "3.9"
<*> licenses "3.10"
<*> licenses "3.16"
<*> licenses "3.20"

template = O.strArgument $ mconcat
[ O.metavar "SPDX.LicenseExceptionId.template.hs"
Expand Down
19 changes: 7 additions & 12 deletions cabal-dev-scripts/src/GenUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ data SPDXLicenseListVersion
| SPDXLicenseListVersion_3_9
| SPDXLicenseListVersion_3_10
| SPDXLicenseListVersion_3_16
| SPDXLicenseListVersion_3_20
deriving (Eq, Ord, Show, Enum, Bounded)

allVers :: Set.Set SPDXLicenseListVersion
allVers = Set.fromList [minBound .. maxBound]

prettyVer :: SPDXLicenseListVersion -> Text
prettyVer SPDXLicenseListVersion_3_20 = "SPDX License List 3.20"
prettyVer SPDXLicenseListVersion_3_16 = "SPDX License List 3.16"
prettyVer SPDXLicenseListVersion_3_10 = "SPDX License List 3.10"
prettyVer SPDXLicenseListVersion_3_9 = "SPDX License List 3.9"
Expand All @@ -48,7 +46,6 @@ prettyVer SPDXLicenseListVersion_3_2 = "SPDX License List 3.2"
prettyVer SPDXLicenseListVersion_3_0 = "SPDX License List 3.0"

suffixVer :: SPDXLicenseListVersion -> String
suffixVer SPDXLicenseListVersion_3_20 = "_3_20"
suffixVer SPDXLicenseListVersion_3_16 = "_3_16"
suffixVer SPDXLicenseListVersion_3_10 = "_3_10"
suffixVer SPDXLicenseListVersion_3_9 = "_3_9"
Expand All @@ -60,21 +57,20 @@ suffixVer SPDXLicenseListVersion_3_0 = "_3_0"
-- Per version
-------------------------------------------------------------------------------

data PerV a = PerV a a a a a a a
data PerV a = PerV a a a a a a
deriving (Show, Functor, Foldable, Traversable)

class Functor f => Representable i f | f -> i where
index :: i -> f a -> a
tabulate :: (i -> a) -> f a

instance Representable SPDXLicenseListVersion PerV where
index SPDXLicenseListVersion_3_0 (PerV x _ _ _ _ _ _) = x
index SPDXLicenseListVersion_3_2 (PerV _ x _ _ _ _ _) = x
index SPDXLicenseListVersion_3_6 (PerV _ _ x _ _ _ _) = x
index SPDXLicenseListVersion_3_9 (PerV _ _ _ x _ _ _) = x
index SPDXLicenseListVersion_3_10 (PerV _ _ _ _ x _ _) = x
index SPDXLicenseListVersion_3_16 (PerV _ _ _ _ _ x _) = x
index SPDXLicenseListVersion_3_20 (PerV _ _ _ _ _ _ x) = x
index SPDXLicenseListVersion_3_0 (PerV x _ _ _ _ _) = x
index SPDXLicenseListVersion_3_2 (PerV _ x _ _ _ _) = x
index SPDXLicenseListVersion_3_6 (PerV _ _ x _ _ _) = x
index SPDXLicenseListVersion_3_9 (PerV _ _ _ x _ _) = x
index SPDXLicenseListVersion_3_10 (PerV _ _ _ _ x _) = x
index SPDXLicenseListVersion_3_16 (PerV _ _ _ _ _ x) = x

tabulate f = PerV
(f SPDXLicenseListVersion_3_0)
Expand All @@ -83,7 +79,6 @@ instance Representable SPDXLicenseListVersion PerV where
(f SPDXLicenseListVersion_3_9)
(f SPDXLicenseListVersion_3_10)
(f SPDXLicenseListVersion_3_16)
(f SPDXLicenseListVersion_3_20)

-------------------------------------------------------------------------------
-- Sorting
Expand Down
7 changes: 0 additions & 7 deletions changelog.d/pr-9028

This file was deleted.

1 change: 0 additions & 1 deletion fix-whitespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ excluded-dirs:
- .python-sphinx-virtualenv
- .stack-work
- .vscode
- license-list-data

# Every matched filename is included unless it is matched by excluded-files.
included-files:
Expand Down
Loading

0 comments on commit a1095e3

Please sign in to comment.