From 50f197872817112770dbf36be4c209f1df5b8317 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sat, 6 Jun 2020 21:24:38 +0300 Subject: [PATCH] Add licenceIsFsfLibre Also change generator to generate only `= True` equations, for licenseIsFsfLibre and licenseIsOsiApproved. --- Cabal/Distribution/SPDX/LicenseId.hs | 391 +++++++++------------------ boot/SPDX.LicenseId.template.hs | 20 +- cabal-dev-scripts/src/GenSPDX.hs | 5 +- cabal-dev-scripts/src/GenSPDXExc.hs | 1 + cabal-dev-scripts/src/GenUtils.hs | 1 + 5 files changed, 146 insertions(+), 272 deletions(-) diff --git a/Cabal/Distribution/SPDX/LicenseId.hs b/Cabal/Distribution/SPDX/LicenseId.hs index 0d2c633417c..2675ca4dc33 100644 --- a/Cabal/Distribution/SPDX/LicenseId.hs +++ b/Cabal/Distribution/SPDX/LicenseId.hs @@ -6,6 +6,7 @@ module Distribution.SPDX.LicenseId ( licenseId, licenseName, licenseIsOsiApproved, + licenseIsFsfLibre, mkLicenseId, licenseIdList, -- * Helpers @@ -1272,30 +1273,15 @@ licenseName ZPL_2_1 = "Zope Public License 2.1" licenseIsOsiApproved :: LicenseId -> Bool licenseIsOsiApproved NullBSD = True licenseIsOsiApproved AAL = True -licenseIsOsiApproved Abstyles = False -licenseIsOsiApproved Adobe_2006 = False -licenseIsOsiApproved Adobe_Glyph = False -licenseIsOsiApproved ADSL = False licenseIsOsiApproved AFL_1_1 = True licenseIsOsiApproved AFL_1_2 = True licenseIsOsiApproved AFL_2_0 = True licenseIsOsiApproved AFL_2_1 = True licenseIsOsiApproved AFL_3_0 = True -licenseIsOsiApproved Afmparse = False -licenseIsOsiApproved AGPL_1_0 = False -licenseIsOsiApproved AGPL_1_0_only = False -licenseIsOsiApproved AGPL_1_0_or_later = False licenseIsOsiApproved AGPL_3_0_only = True licenseIsOsiApproved AGPL_3_0_or_later = True -licenseIsOsiApproved Aladdin = False -licenseIsOsiApproved AMDPLPA = False -licenseIsOsiApproved AML = False -licenseIsOsiApproved AMPAS = False -licenseIsOsiApproved ANTLR_PD = False -licenseIsOsiApproved Apache_1_0 = False licenseIsOsiApproved Apache_1_1 = True licenseIsOsiApproved Apache_2_0 = True -licenseIsOsiApproved APAFML = False licenseIsOsiApproved APL_1_0 = True licenseIsOsiApproved APSL_1_0 = True licenseIsOsiApproved APSL_1_1 = True @@ -1305,353 +1291,218 @@ licenseIsOsiApproved Artistic_1_0_cl8 = True licenseIsOsiApproved Artistic_1_0_Perl = True licenseIsOsiApproved Artistic_1_0 = True licenseIsOsiApproved Artistic_2_0 = True -licenseIsOsiApproved Bahyph = False -licenseIsOsiApproved Barr = False -licenseIsOsiApproved Beerware = False -licenseIsOsiApproved BitTorrent_1_0 = False -licenseIsOsiApproved BitTorrent_1_1 = False -licenseIsOsiApproved Blessing = False -licenseIsOsiApproved BlueOak_1_0_0 = False -licenseIsOsiApproved Borceux = False -licenseIsOsiApproved BSD_1_Clause = False -licenseIsOsiApproved BSD_2_Clause_FreeBSD = False -licenseIsOsiApproved BSD_2_Clause_NetBSD = False licenseIsOsiApproved BSD_2_Clause_Patent = True licenseIsOsiApproved BSD_2_Clause = True -licenseIsOsiApproved BSD_3_Clause_Attribution = False -licenseIsOsiApproved BSD_3_Clause_Clear = False licenseIsOsiApproved BSD_3_Clause_LBNL = True -licenseIsOsiApproved BSD_3_Clause_No_Nuclear_License_2014 = False -licenseIsOsiApproved BSD_3_Clause_No_Nuclear_License = False -licenseIsOsiApproved BSD_3_Clause_No_Nuclear_Warranty = False -licenseIsOsiApproved BSD_3_Clause_Open_MPI = False licenseIsOsiApproved BSD_3_Clause = True -licenseIsOsiApproved BSD_4_Clause_UC = False -licenseIsOsiApproved BSD_4_Clause = False -licenseIsOsiApproved BSD_Protection = False -licenseIsOsiApproved BSD_Source_Code = False licenseIsOsiApproved BSL_1_0 = True -licenseIsOsiApproved Bzip2_1_0_5 = False -licenseIsOsiApproved Bzip2_1_0_6 = False -licenseIsOsiApproved Caldera = False licenseIsOsiApproved CATOSL_1_1 = True -licenseIsOsiApproved CC_BY_1_0 = False -licenseIsOsiApproved CC_BY_2_0 = False -licenseIsOsiApproved CC_BY_2_5 = False -licenseIsOsiApproved CC_BY_3_0 = False -licenseIsOsiApproved CC_BY_4_0 = False -licenseIsOsiApproved CC_BY_NC_1_0 = False -licenseIsOsiApproved CC_BY_NC_2_0 = False -licenseIsOsiApproved CC_BY_NC_2_5 = False -licenseIsOsiApproved CC_BY_NC_3_0 = False -licenseIsOsiApproved CC_BY_NC_4_0 = False -licenseIsOsiApproved CC_BY_NC_ND_1_0 = False -licenseIsOsiApproved CC_BY_NC_ND_2_0 = False -licenseIsOsiApproved CC_BY_NC_ND_2_5 = False -licenseIsOsiApproved CC_BY_NC_ND_3_0 = False -licenseIsOsiApproved CC_BY_NC_ND_4_0 = False -licenseIsOsiApproved CC_BY_NC_SA_1_0 = False -licenseIsOsiApproved CC_BY_NC_SA_2_0 = False -licenseIsOsiApproved CC_BY_NC_SA_2_5 = False -licenseIsOsiApproved CC_BY_NC_SA_3_0 = False -licenseIsOsiApproved CC_BY_NC_SA_4_0 = False -licenseIsOsiApproved CC_BY_ND_1_0 = False -licenseIsOsiApproved CC_BY_ND_2_0 = False -licenseIsOsiApproved CC_BY_ND_2_5 = False -licenseIsOsiApproved CC_BY_ND_3_0 = False -licenseIsOsiApproved CC_BY_ND_4_0 = False -licenseIsOsiApproved CC_BY_SA_1_0 = False -licenseIsOsiApproved CC_BY_SA_2_0 = False -licenseIsOsiApproved CC_BY_SA_2_5 = False -licenseIsOsiApproved CC_BY_SA_3_0 = False -licenseIsOsiApproved CC_BY_SA_4_0 = False -licenseIsOsiApproved CC_PDDC = False -licenseIsOsiApproved CC0_1_0 = False licenseIsOsiApproved CDDL_1_0 = True -licenseIsOsiApproved CDDL_1_1 = False -licenseIsOsiApproved CDLA_Permissive_1_0 = False -licenseIsOsiApproved CDLA_Sharing_1_0 = False -licenseIsOsiApproved CECILL_1_0 = False -licenseIsOsiApproved CECILL_1_1 = False -licenseIsOsiApproved CECILL_2_0 = False licenseIsOsiApproved CECILL_2_1 = True -licenseIsOsiApproved CECILL_B = False -licenseIsOsiApproved CECILL_C = False -licenseIsOsiApproved CERN_OHL_1_1 = False -licenseIsOsiApproved CERN_OHL_1_2 = False -licenseIsOsiApproved ClArtistic = False -licenseIsOsiApproved CNRI_Jython = False -licenseIsOsiApproved CNRI_Python_GPL_Compatible = False licenseIsOsiApproved CNRI_Python = True -licenseIsOsiApproved Condor_1_1 = False -licenseIsOsiApproved Copyleft_next_0_3_0 = False -licenseIsOsiApproved Copyleft_next_0_3_1 = False licenseIsOsiApproved CPAL_1_0 = True licenseIsOsiApproved CPL_1_0 = True -licenseIsOsiApproved CPOL_1_02 = False -licenseIsOsiApproved Crossword = False -licenseIsOsiApproved CrystalStacker = False licenseIsOsiApproved CUA_OPL_1_0 = True -licenseIsOsiApproved Cube = False -licenseIsOsiApproved Curl = False -licenseIsOsiApproved D_FSL_1_0 = False -licenseIsOsiApproved Diffmark = False -licenseIsOsiApproved DOC = False -licenseIsOsiApproved Dotseqn = False -licenseIsOsiApproved DSDP = False -licenseIsOsiApproved Dvipdfm = False licenseIsOsiApproved ECL_1_0 = True licenseIsOsiApproved ECL_2_0 = True licenseIsOsiApproved EFL_1_0 = True licenseIsOsiApproved EFL_2_0 = True -licenseIsOsiApproved EGenix = False licenseIsOsiApproved Entessa = True licenseIsOsiApproved EPL_1_0 = True licenseIsOsiApproved EPL_2_0 = True -licenseIsOsiApproved ErlPL_1_1 = False -licenseIsOsiApproved Etalab_2_0 = False licenseIsOsiApproved EUDatagrid = True -licenseIsOsiApproved EUPL_1_0 = False licenseIsOsiApproved EUPL_1_1 = True licenseIsOsiApproved EUPL_1_2 = True -licenseIsOsiApproved Eurosym = False licenseIsOsiApproved Fair = True licenseIsOsiApproved Frameworx_1_0 = True -licenseIsOsiApproved FreeImage = False -licenseIsOsiApproved FSFAP = False -licenseIsOsiApproved FSFULLR = False -licenseIsOsiApproved FSFUL = False -licenseIsOsiApproved FTL = False -licenseIsOsiApproved GFDL_1_1_only = False -licenseIsOsiApproved GFDL_1_1_or_later = False -licenseIsOsiApproved GFDL_1_2_only = False -licenseIsOsiApproved GFDL_1_2_or_later = False -licenseIsOsiApproved GFDL_1_3_only = False -licenseIsOsiApproved GFDL_1_3_or_later = False -licenseIsOsiApproved Giftware = False -licenseIsOsiApproved GL2PS = False -licenseIsOsiApproved Glide = False -licenseIsOsiApproved Glulxe = False -licenseIsOsiApproved Gnuplot = False -licenseIsOsiApproved GPL_1_0_only = False -licenseIsOsiApproved GPL_1_0_or_later = False licenseIsOsiApproved GPL_2_0_only = True licenseIsOsiApproved GPL_2_0_or_later = True licenseIsOsiApproved GPL_3_0_only = True licenseIsOsiApproved GPL_3_0_or_later = True -licenseIsOsiApproved GSOAP_1_3b = False -licenseIsOsiApproved HaskellReport = False -licenseIsOsiApproved HPND_sell_variant = False licenseIsOsiApproved HPND = True -licenseIsOsiApproved IBM_pibs = False -licenseIsOsiApproved ICU = False -licenseIsOsiApproved IJG = False -licenseIsOsiApproved ImageMagick = False -licenseIsOsiApproved IMatix = False -licenseIsOsiApproved Imlib2 = False -licenseIsOsiApproved Info_ZIP = False -licenseIsOsiApproved Intel_ACPI = False licenseIsOsiApproved Intel = True -licenseIsOsiApproved Interbase_1_0 = False licenseIsOsiApproved IPA = True licenseIsOsiApproved IPL_1_0 = True licenseIsOsiApproved ISC = True -licenseIsOsiApproved JasPer_2_0 = False -licenseIsOsiApproved JPNIC = False -licenseIsOsiApproved JSON = False -licenseIsOsiApproved LAL_1_2 = False -licenseIsOsiApproved LAL_1_3 = False -licenseIsOsiApproved Latex2e = False -licenseIsOsiApproved Leptonica = False licenseIsOsiApproved LGPL_2_0_only = True licenseIsOsiApproved LGPL_2_0_or_later = True licenseIsOsiApproved LGPL_2_1_only = True licenseIsOsiApproved LGPL_2_1_or_later = True licenseIsOsiApproved LGPL_3_0_only = True licenseIsOsiApproved LGPL_3_0_or_later = True -licenseIsOsiApproved LGPLLR = False -licenseIsOsiApproved Libpng_2_0 = False -licenseIsOsiApproved Libpng = False -licenseIsOsiApproved Libselinux_1_0 = False -licenseIsOsiApproved Libtiff = False licenseIsOsiApproved LiLiQ_P_1_1 = True licenseIsOsiApproved LiLiQ_R_1_1 = True licenseIsOsiApproved LiLiQ_Rplus_1_1 = True -licenseIsOsiApproved Linux_OpenIB = False licenseIsOsiApproved LPL_1_02 = True licenseIsOsiApproved LPL_1_0 = True -licenseIsOsiApproved LPPL_1_0 = False -licenseIsOsiApproved LPPL_1_1 = False -licenseIsOsiApproved LPPL_1_2 = False -licenseIsOsiApproved LPPL_1_3a = False licenseIsOsiApproved LPPL_1_3c = True -licenseIsOsiApproved MakeIndex = False licenseIsOsiApproved MirOS = True -licenseIsOsiApproved MIT_0 = False -licenseIsOsiApproved MIT_advertising = False -licenseIsOsiApproved MIT_CMU = False -licenseIsOsiApproved MIT_enna = False -licenseIsOsiApproved MIT_feh = False -licenseIsOsiApproved MITNFA = False licenseIsOsiApproved MIT = True licenseIsOsiApproved Motosoto = True -licenseIsOsiApproved Mpich2 = False licenseIsOsiApproved MPL_1_0 = True licenseIsOsiApproved MPL_1_1 = True licenseIsOsiApproved MPL_2_0_no_copyleft_exception = True licenseIsOsiApproved MPL_2_0 = True licenseIsOsiApproved MS_PL = True licenseIsOsiApproved MS_RL = True -licenseIsOsiApproved MTLL = False -licenseIsOsiApproved MulanPSL_1_0 = False licenseIsOsiApproved Multics = True -licenseIsOsiApproved Mup = False licenseIsOsiApproved NASA_1_3 = True licenseIsOsiApproved Naumen = True -licenseIsOsiApproved NBPL_1_0 = False licenseIsOsiApproved NCSA = True -licenseIsOsiApproved Net_SNMP = False -licenseIsOsiApproved NetCDF = False -licenseIsOsiApproved Newsletr = False licenseIsOsiApproved NGPL = True -licenseIsOsiApproved NLOD_1_0 = False -licenseIsOsiApproved NLPL = False licenseIsOsiApproved Nokia = True -licenseIsOsiApproved NOSL = False -licenseIsOsiApproved Noweb = False -licenseIsOsiApproved NPL_1_0 = False -licenseIsOsiApproved NPL_1_1 = False licenseIsOsiApproved NPOSL_3_0 = True -licenseIsOsiApproved NRL = False -licenseIsOsiApproved NTP_0 = False licenseIsOsiApproved NTP = True -licenseIsOsiApproved OCCT_PL = False licenseIsOsiApproved OCLC_2_0 = True -licenseIsOsiApproved ODbL_1_0 = False -licenseIsOsiApproved ODC_By_1_0 = False -licenseIsOsiApproved OFL_1_0_no_RFN = False -licenseIsOsiApproved OFL_1_0_RFN = False -licenseIsOsiApproved OFL_1_0 = False licenseIsOsiApproved OFL_1_1_no_RFN = True licenseIsOsiApproved OFL_1_1_RFN = True licenseIsOsiApproved OFL_1_1 = True -licenseIsOsiApproved OGL_Canada_2_0 = False -licenseIsOsiApproved OGL_UK_1_0 = False -licenseIsOsiApproved OGL_UK_2_0 = False -licenseIsOsiApproved OGL_UK_3_0 = False licenseIsOsiApproved OGTSL = True -licenseIsOsiApproved OLDAP_1_1 = False -licenseIsOsiApproved OLDAP_1_2 = False -licenseIsOsiApproved OLDAP_1_3 = False -licenseIsOsiApproved OLDAP_1_4 = False -licenseIsOsiApproved OLDAP_2_0_1 = False -licenseIsOsiApproved OLDAP_2_0 = False -licenseIsOsiApproved OLDAP_2_1 = False -licenseIsOsiApproved OLDAP_2_2_1 = False -licenseIsOsiApproved OLDAP_2_2_2 = False -licenseIsOsiApproved OLDAP_2_2 = False -licenseIsOsiApproved OLDAP_2_3 = False -licenseIsOsiApproved OLDAP_2_4 = False -licenseIsOsiApproved OLDAP_2_5 = False -licenseIsOsiApproved OLDAP_2_6 = False -licenseIsOsiApproved OLDAP_2_7 = False -licenseIsOsiApproved OLDAP_2_8 = False -licenseIsOsiApproved OML = False -licenseIsOsiApproved OpenSSL = False -licenseIsOsiApproved OPL_1_0 = False licenseIsOsiApproved OSET_PL_2_1 = True licenseIsOsiApproved OSL_1_0 = True -licenseIsOsiApproved OSL_1_1 = False licenseIsOsiApproved OSL_2_0 = True licenseIsOsiApproved OSL_2_1 = True licenseIsOsiApproved OSL_3_0 = True -licenseIsOsiApproved Parity_6_0_0 = False -licenseIsOsiApproved PDDL_1_0 = False -licenseIsOsiApproved PHP_3_01 = False licenseIsOsiApproved PHP_3_0 = True -licenseIsOsiApproved Plexus = False licenseIsOsiApproved PostgreSQL = True -licenseIsOsiApproved PSF_2_0 = False -licenseIsOsiApproved Psfrag = False -licenseIsOsiApproved Psutils = False licenseIsOsiApproved Python_2_0 = True -licenseIsOsiApproved Qhull = False licenseIsOsiApproved QPL_1_0 = True -licenseIsOsiApproved Rdisc = False -licenseIsOsiApproved RHeCos_1_1 = False licenseIsOsiApproved RPL_1_1 = True licenseIsOsiApproved RPL_1_5 = True licenseIsOsiApproved RPSL_1_0 = True -licenseIsOsiApproved RSA_MD = False licenseIsOsiApproved RSCPL = True -licenseIsOsiApproved Ruby = False -licenseIsOsiApproved SAX_PD = False -licenseIsOsiApproved Saxpath = False -licenseIsOsiApproved SCEA = False -licenseIsOsiApproved Sendmail_8_23 = False -licenseIsOsiApproved Sendmail = False -licenseIsOsiApproved SGI_B_1_0 = False -licenseIsOsiApproved SGI_B_1_1 = False -licenseIsOsiApproved SGI_B_2_0 = False -licenseIsOsiApproved SHL_0_51 = False -licenseIsOsiApproved SHL_0_5 = False licenseIsOsiApproved SimPL_2_0 = True -licenseIsOsiApproved SISSL_1_2 = False licenseIsOsiApproved SISSL = True licenseIsOsiApproved Sleepycat = True -licenseIsOsiApproved SMLNJ = False -licenseIsOsiApproved SMPPL = False -licenseIsOsiApproved SNIA = False -licenseIsOsiApproved Spencer_86 = False -licenseIsOsiApproved Spencer_94 = False -licenseIsOsiApproved Spencer_99 = False licenseIsOsiApproved SPL_1_0 = True -licenseIsOsiApproved SSH_OpenSSH = False -licenseIsOsiApproved SSH_short = False -licenseIsOsiApproved SSPL_1_0 = False -licenseIsOsiApproved SugarCRM_1_1_3 = False -licenseIsOsiApproved SWL = False -licenseIsOsiApproved TAPR_OHL_1_0 = False -licenseIsOsiApproved TCL = False -licenseIsOsiApproved TCP_wrappers = False -licenseIsOsiApproved TMate = False -licenseIsOsiApproved TORQUE_1_1 = False -licenseIsOsiApproved TOSL = False -licenseIsOsiApproved TU_Berlin_1_0 = False -licenseIsOsiApproved TU_Berlin_2_0 = False licenseIsOsiApproved UCL_1_0 = True -licenseIsOsiApproved Unicode_DFS_2015 = False -licenseIsOsiApproved Unicode_DFS_2016 = False -licenseIsOsiApproved Unicode_TOU = False -licenseIsOsiApproved Unlicense = False licenseIsOsiApproved UPL_1_0 = True -licenseIsOsiApproved Vim = False -licenseIsOsiApproved VOSTROM = False licenseIsOsiApproved VSL_1_0 = True -licenseIsOsiApproved W3C_19980720 = False -licenseIsOsiApproved W3C_20150513 = False licenseIsOsiApproved W3C = True licenseIsOsiApproved Watcom_1_0 = True -licenseIsOsiApproved Wsuipa = False -licenseIsOsiApproved WTFPL = False -licenseIsOsiApproved X11 = False -licenseIsOsiApproved Xerox = False -licenseIsOsiApproved XFree86_1_1 = False -licenseIsOsiApproved Xinetd = False licenseIsOsiApproved Xnet = True -licenseIsOsiApproved Xpp = False -licenseIsOsiApproved XSkat = False -licenseIsOsiApproved YPL_1_0 = False -licenseIsOsiApproved YPL_1_1 = False -licenseIsOsiApproved Zed = False -licenseIsOsiApproved Zend_2_0 = False -licenseIsOsiApproved Zimbra_1_3 = False -licenseIsOsiApproved Zimbra_1_4 = False -licenseIsOsiApproved Zlib_acknowledgement = False licenseIsOsiApproved Zlib = True -licenseIsOsiApproved ZPL_1_1 = False licenseIsOsiApproved ZPL_2_0 = True -licenseIsOsiApproved ZPL_2_1 = False +licenseIsOsiApproved _ = False + +-- | Whether the license is considered libre by Free Software Foundation (FSF). +-- +-- See +-- +-- @since 3.4.0.0 +-- +licenseIsFsfLibre :: LicenseId -> Bool +licenseIsFsfLibre AFL_1_1 = True +licenseIsFsfLibre AFL_1_2 = True +licenseIsFsfLibre AFL_2_0 = True +licenseIsFsfLibre AFL_2_1 = True +licenseIsFsfLibre AFL_3_0 = True +licenseIsFsfLibre AGPL_1_0 = True +licenseIsFsfLibre AGPL_3_0_only = True +licenseIsFsfLibre AGPL_3_0_or_later = True +licenseIsFsfLibre Apache_1_0 = True +licenseIsFsfLibre Apache_1_1 = True +licenseIsFsfLibre Apache_2_0 = True +licenseIsFsfLibre APSL_2_0 = True +licenseIsFsfLibre Artistic_2_0 = True +licenseIsFsfLibre BitTorrent_1_1 = True +licenseIsFsfLibre BSD_2_Clause_FreeBSD = True +licenseIsFsfLibre BSD_3_Clause_Clear = True +licenseIsFsfLibre BSD_3_Clause = True +licenseIsFsfLibre BSD_4_Clause = True +licenseIsFsfLibre BSL_1_0 = True +licenseIsFsfLibre CC_BY_4_0 = True +licenseIsFsfLibre CC_BY_SA_4_0 = True +licenseIsFsfLibre CC0_1_0 = True +licenseIsFsfLibre CDDL_1_0 = True +licenseIsFsfLibre CECILL_2_0 = True +licenseIsFsfLibre CECILL_B = True +licenseIsFsfLibre CECILL_C = True +licenseIsFsfLibre ClArtistic = True +licenseIsFsfLibre Condor_1_1 = True +licenseIsFsfLibre CPAL_1_0 = True +licenseIsFsfLibre CPL_1_0 = True +licenseIsFsfLibre ECL_2_0 = True +licenseIsFsfLibre EFL_2_0 = True +licenseIsFsfLibre EPL_1_0 = True +licenseIsFsfLibre EPL_2_0 = True +licenseIsFsfLibre EUDatagrid = True +licenseIsFsfLibre EUPL_1_1 = True +licenseIsFsfLibre EUPL_1_2 = True +licenseIsFsfLibre FSFAP = True +licenseIsFsfLibre FTL = True +licenseIsFsfLibre GFDL_1_1_only = True +licenseIsFsfLibre GFDL_1_1_or_later = True +licenseIsFsfLibre GFDL_1_2_only = True +licenseIsFsfLibre GFDL_1_2_or_later = True +licenseIsFsfLibre GFDL_1_3_only = True +licenseIsFsfLibre GFDL_1_3_or_later = True +licenseIsFsfLibre Gnuplot = True +licenseIsFsfLibre GPL_2_0_only = True +licenseIsFsfLibre GPL_2_0_or_later = True +licenseIsFsfLibre GPL_3_0_only = True +licenseIsFsfLibre GPL_3_0_or_later = True +licenseIsFsfLibre HPND = True +licenseIsFsfLibre IJG = True +licenseIsFsfLibre IMatix = True +licenseIsFsfLibre Imlib2 = True +licenseIsFsfLibre Intel = True +licenseIsFsfLibre IPA = True +licenseIsFsfLibre IPL_1_0 = True +licenseIsFsfLibre ISC = True +licenseIsFsfLibre LGPL_2_1_only = True +licenseIsFsfLibre LGPL_2_1_or_later = True +licenseIsFsfLibre LGPL_3_0_only = True +licenseIsFsfLibre LGPL_3_0_or_later = True +licenseIsFsfLibre LPL_1_02 = True +licenseIsFsfLibre LPPL_1_2 = True +licenseIsFsfLibre LPPL_1_3a = True +licenseIsFsfLibre MIT = True +licenseIsFsfLibre MPL_1_1 = True +licenseIsFsfLibre MPL_2_0 = True +licenseIsFsfLibre MS_PL = True +licenseIsFsfLibre MS_RL = True +licenseIsFsfLibre NCSA = True +licenseIsFsfLibre Nokia = True +licenseIsFsfLibre NOSL = True +licenseIsFsfLibre NPL_1_0 = True +licenseIsFsfLibre NPL_1_1 = True +licenseIsFsfLibre ODbL_1_0 = True +licenseIsFsfLibre OFL_1_0 = True +licenseIsFsfLibre OFL_1_1 = True +licenseIsFsfLibre OLDAP_2_3 = True +licenseIsFsfLibre OLDAP_2_7 = True +licenseIsFsfLibre OpenSSL = True +licenseIsFsfLibre OSL_1_0 = True +licenseIsFsfLibre OSL_1_1 = True +licenseIsFsfLibre OSL_2_0 = True +licenseIsFsfLibre OSL_2_1 = True +licenseIsFsfLibre OSL_3_0 = True +licenseIsFsfLibre PHP_3_01 = True +licenseIsFsfLibre Python_2_0 = True +licenseIsFsfLibre QPL_1_0 = True +licenseIsFsfLibre RPSL_1_0 = True +licenseIsFsfLibre Ruby = True +licenseIsFsfLibre SGI_B_2_0 = True +licenseIsFsfLibre SISSL = True +licenseIsFsfLibre Sleepycat = True +licenseIsFsfLibre SMLNJ = True +licenseIsFsfLibre SPL_1_0 = True +licenseIsFsfLibre Unlicense = True +licenseIsFsfLibre UPL_1_0 = True +licenseIsFsfLibre Vim = True +licenseIsFsfLibre W3C = True +licenseIsFsfLibre WTFPL = True +licenseIsFsfLibre X11 = True +licenseIsFsfLibre XFree86_1_1 = True +licenseIsFsfLibre Xinetd = True +licenseIsFsfLibre YPL_1_1 = True +licenseIsFsfLibre Zend_2_0 = True +licenseIsFsfLibre Zimbra_1_3 = True +licenseIsFsfLibre Zlib = True +licenseIsFsfLibre ZPL_2_0 = True +licenseIsFsfLibre ZPL_2_1 = True +licenseIsFsfLibre _ = False ------------------------------------------------------------------------------- -- Creation diff --git a/boot/SPDX.LicenseId.template.hs b/boot/SPDX.LicenseId.template.hs index 7816823f2d5..d5b9e957a47 100644 --- a/boot/SPDX.LicenseId.template.hs +++ b/boot/SPDX.LicenseId.template.hs @@ -5,6 +5,7 @@ module Distribution.SPDX.LicenseId ( licenseId, licenseName, licenseIsOsiApproved, + licenseIsFsfLibre, mkLicenseId, licenseIdList, -- * Helpers @@ -131,8 +132,25 @@ licenseName {{l.constructor}} = {{l.name}} -- See . licenseIsOsiApproved :: LicenseId -> Bool {% for l in licenses %} -licenseIsOsiApproved {{l.constructor}} = {% if l.isOsiApproved %}True{% else %}False{% endif %} +{% if l.isOsiApproved %} +licenseIsOsiApproved {{l.constructor}} = True +{% endif %} {% endfor %} +licenseIsOsiApproved _ = False + +-- | Whether the license is considered libre by Free Software Foundation (FSF). +-- +-- See +-- +-- @since 3.4.0.0 +-- +licenseIsFsfLibre :: LicenseId -> Bool +{% for l in licenses %} +{% if l.isFsfLibre %} +licenseIsFsfLibre {{l.constructor}} = True +{% endif %} +{% endfor %} +licenseIsFsfLibre _ = False ------------------------------------------------------------------------------- -- Creation diff --git a/cabal-dev-scripts/src/GenSPDX.hs b/cabal-dev-scripts/src/GenSPDX.hs index 4f7de05cb22..bc2ab280f35 100644 --- a/cabal-dev-scripts/src/GenSPDX.hs +++ b/cabal-dev-scripts/src/GenSPDX.hs @@ -3,7 +3,7 @@ module Main (main) where import Control.Lens (imap) -import Data.Aeson (FromJSON (..), eitherDecode, withObject, (.:)) +import Data.Aeson (FromJSON (..), eitherDecode, withObject, (.!=), (.:), (.:?)) import Data.List (sortOn) import Data.Semigroup ((<>)) import Data.Text (Text) @@ -95,6 +95,7 @@ generate' lss template = template $ Input , ilId = textShow (licenseId l) , ilName = textShow (licenseName l) , ilIsOsiApproved = licenseOsiApproved l + , ilIsFsfLibre = licenseFsfLibre l } licenseIds :: Text @@ -116,6 +117,7 @@ data License = License { licenseId :: !Text , licenseName :: !Text , licenseOsiApproved :: !Bool + , licenseFsfLibre :: !Bool , licenseDeprecated :: !Bool } deriving (Show) @@ -128,6 +130,7 @@ instance FromJSON License where <$> obj .: "licenseId" <*> obj .: "name" <*> obj .: "isOsiApproved" + <*> obj .:? "isFsfLibre" .!= False <*> obj .: "isDeprecatedLicenseId" instance FromJSON LicenseList where diff --git a/cabal-dev-scripts/src/GenSPDXExc.hs b/cabal-dev-scripts/src/GenSPDXExc.hs index ee2afd471e2..1319be0f553 100644 --- a/cabal-dev-scripts/src/GenSPDXExc.hs +++ b/cabal-dev-scripts/src/GenSPDXExc.hs @@ -94,6 +94,7 @@ generate' lss template = template $ Input , ilId = textShow (licenseId l) , ilName = textShow (licenseName l) , ilIsOsiApproved = False -- not used in exceptions + , ilIsFsfLibre = False -- not used in exceptions } licenseIds :: Text diff --git a/cabal-dev-scripts/src/GenUtils.hs b/cabal-dev-scripts/src/GenUtils.hs index fdcc26d46ea..208630ebc6a 100644 --- a/cabal-dev-scripts/src/GenUtils.hs +++ b/cabal-dev-scripts/src/GenUtils.hs @@ -157,6 +157,7 @@ data InputLicense = InputLicense , ilId :: Text , ilName :: Text , ilIsOsiApproved :: Bool + , ilIsFsfLibre :: Bool } deriving (Show, Generic)