Skip to content

Commit 1a2e97e

Browse files
committed
fromCabalLicense: don't return stringy licenses
1 parent 3994038 commit 1a2e97e

32 files changed

+35
-35
lines changed

cabal2nix/src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ import Distribution.Version
1818
-- TODO: Programmatically strip trailing zeros from license version numbers.
1919

2020
fromCabalLicense :: Distribution.License.License -> Distribution.Nixpkgs.License.License
21-
fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
21+
fromCabalLicense (GPL Nothing) = Known "lib.licenses.gpl2Plus"
2222
fromCabalLicense (GPL (Just (versionNumbers -> [2]))) = Known "lib.licenses.gpl2Only"
2323
fromCabalLicense (GPL (Just (versionNumbers -> [3]))) = Known "lib.licenses.gpl3Only"
2424
fromCabalLicense (GPL (Just (versionNumbers -> [3,0]))) = Known "lib.licenses.gpl3Only"
25-
fromCabalLicense (LGPL Nothing) = Unknown (Just "LGPL")
25+
fromCabalLicense (LGPL Nothing) = Known "lib.licenses.lgpl2Plus"
2626
fromCabalLicense (LGPL (Just (versionNumbers -> [2,1]))) = Known "lib.licenses.lgpl21Only"
2727
fromCabalLicense (LGPL (Just (versionNumbers -> [2]))) = Known "lib.licenses.lgpl2Only"
2828
fromCabalLicense (LGPL (Just (versionNumbers -> [3]))) = Known "lib.licenses.lgpl3Only"
2929
fromCabalLicense (LGPL (Just (versionNumbers -> [3,0]))) = Known "lib.licenses.lgpl3Only"
30-
fromCabalLicense (AGPL Nothing) = Unknown (Just "AGPL")
30+
fromCabalLicense (AGPL Nothing) = Known "lib.licenses.agpl3Plus"
3131
fromCabalLicense (AGPL (Just (versionNumbers -> [3]))) = Known "lib.licenses.agpl3Only"
3232
fromCabalLicense (AGPL (Just (versionNumbers -> [3,0]))) = Known "lib.licenses.agpl3Only"
3333
fromCabalLicense (MPL (versionNumbers -> [2,0])) = Known "lib.licenses.mpl20"
@@ -41,7 +41,7 @@ fromCabalLicense AllRightsReserved = Known "lib.licenses
4141
fromCabalLicense (Apache Nothing) = Known "lib.licenses.asl20"
4242
fromCabalLicense (Apache (Just (versionNumbers -> [2,0]))) = Known "lib.licenses.asl20"
4343
fromCabalLicense ISC = Known "lib.licenses.isc"
44-
fromCabalLicense OtherLicense = Unknown Nothing
44+
fromCabalLicense OtherLicense = Known "lib.licenses.free"
4545
fromCabalLicense (UnknownLicense "CC0-1.0") = Known "lib.licenses.cc0"
4646
fromCabalLicense (UnknownLicense "BSD3ClauseORApache20") = Known "lib.licenses.bsd3"
4747
fromCabalLicense l = error $ "Distribution.Nixpkgs.Haskell.FromCabal.License.fromCabalLicense: unknown license"

cabal2nix/test/golden-test-cases/HTF.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ mkDerivation {
2727
];
2828
homepage = "https://github.com/skogsbaer/HTF/";
2929
description = "The Haskell Test Framework";
30-
license = "LGPL";
30+
license = lib.licenses.lgpl2Plus;
3131
mainProgram = "htfpp";
3232
}

cabal2nix/test/golden-test-cases/bioalign.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ mkDerivation {
66
libraryHaskellDepends = [ base biocore bytestring ];
77
homepage = "https://patch-tag.com/r/dfornika/biophd/home";
88
description = "Data structures and helper functions for calculating alignments";
9-
license = "GPL";
9+
license = lib.licenses.gpl2Plus;
1010
}

cabal2nix/test/golden-test-cases/ede.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ mkDerivation {
2020
];
2121
homepage = "http://github.com/brendanhay/ede";
2222
description = "Templating language with similar syntax and features to Liquid or Jinja2";
23-
license = "unknown";
23+
license = lib.licenses.free;
2424
}

cabal2nix/test/golden-test-cases/gogol-adexchange-buyer.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ mkDerivation {
66
libraryHaskellDepends = [ base gogol-core ];
77
homepage = "https://github.com/brendanhay/gogol";
88
description = "Google Ad Exchange Buyer SDK";
9-
license = "unknown";
9+
license = lib.licenses.free;
1010
}

cabal2nix/test/golden-test-cases/gogol-admin-emailmigration.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ mkDerivation {
66
libraryHaskellDepends = [ base gogol-core ];
77
homepage = "https://github.com/brendanhay/gogol";
88
description = "Google Email Migration API v2 SDK";
9-
license = "unknown";
9+
license = lib.licenses.free;
1010
}

cabal2nix/test/golden-test-cases/gogol-affiliates.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ mkDerivation {
66
libraryHaskellDepends = [ base gogol-core ];
77
homepage = "https://github.com/brendanhay/gogol";
88
description = "Google Affiliate Network SDK";
9-
license = "unknown";
9+
license = lib.licenses.free;
1010
}

cabal2nix/test/golden-test-cases/gogol-apps-tasks.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ mkDerivation {
66
libraryHaskellDepends = [ base gogol-core ];
77
homepage = "https://github.com/brendanhay/gogol";
88
description = "Google Tasks SDK";
9-
license = "unknown";
9+
license = lib.licenses.free;
1010
}

cabal2nix/test/golden-test-cases/gogol-appstate.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ mkDerivation {
66
libraryHaskellDepends = [ base gogol-core ];
77
homepage = "https://github.com/brendanhay/gogol";
88
description = "Google App State SDK";
9-
license = "unknown";
9+
license = lib.licenses.free;
1010
}

cabal2nix/test/golden-test-cases/gogol-blogger.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ mkDerivation {
66
libraryHaskellDepends = [ base gogol-core ];
77
homepage = "https://github.com/brendanhay/gogol";
88
description = "Google Blogger SDK";
9-
license = "unknown";
9+
license = lib.licenses.free;
1010
}

0 commit comments

Comments
 (0)