Skip to content

Updating the license list

ffaf1 edited this page Mar 22, 2024 · 13 revisions

Cabal uses the SPDX License list, and automatically generates the appropriate data types from the official JSON data provided by the Linux Foundation.

Do this on master, then backport to release branch.

Here is the procedure to follow when updating the list:

  1. Download the licenses.json and exceptions.json files from the SPDX licenses repository, under a git tag (not the master branch). eg: https://github.com/spdx/license-list-data/blob/v3.17/json/exceptions.json, not https://github.com/spdx/license-list-data/blob/master/json/exceptions.json.
  2. Put these files under the ./license-list-data directory with an appropriate number (e.g. exceptions-3.23.json).
  3. Change the version in the Haddocks of the LicenseId and LicenseExceptionId in the files ./templates/SPDX.LicenseId.template.hs and ./templates/SPDX.LicenseExceptionId.template.hs.
    • Update the mkLicense(Exception)Id and stringLookup_x_x functions in both files.
  4. Add the new version to the SPDX_LICENSE_VERSIONS rule in the Makefile.
  5. In ./cabal-dev-scripts/src/GenUtils.hs`
    • Add the new version to the SPDXLicenseListVersion ADT, and its Representable instance
    • Add the new version to the prettyVer and suffixVer functions
    • Add a type parameter to the PerV data type
  6. Add the new version in LicenseListVersion, in ./Cabal-syntax/src/Distribution/SPDX/LicenseListVersion.hs
  7. Add the new version to the licensesAll :: PerV value in ./cabal-dev-scripts/src/GenSPDXExc.hs and ./cabal-dev-scripts/src/GenSPDX.hs.
  8. Generate the types from the template and new data
    • Run make Cabal-syntax/src/Distribution/SPDX/LicenseId.hs
    • Run make Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs
  9. Add changelog entries
    • In changelog.d
    • In ./doc/file-format-changelog.rst