1module Cabal2Nix.License ( fromCabalLicense ) where
3import Distribution.Nixpkgs.License
4import Distribution.License ( License(..) )
7fromCabalLicense :: Distribution.License.License -> Distribution.Nixpkgs.License.License
8fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
9fromCabalLicense (GPL (Just (Version [2] []))) = Known "stdenv.lib.licenses.gpl2"
10fromCabalLicense (GPL (Just (Version [3] []))) = Known "stdenv.lib.licenses.gpl3"
11fromCabalLicense (LGPL Nothing) = Unknown (Just "LGPL")
12fromCabalLicense (LGPL (Just (Version [2,1] []))) = Known "stdenv.lib.licenses.lgpl21"
13fromCabalLicense (LGPL (Just (Version [2] []))) = Known "stdenv.lib.licenses.lgpl2"
14fromCabalLicense (LGPL (Just (Version [3] []))) = Known "stdenv.lib.licenses.gpl3"
15fromCabalLicense (AGPL Nothing) = Unknown (Just "AGPL")
16fromCabalLicense (AGPL (Just (Version [3] []))) = Known "stdenv.lib.licenses.agpl3"
17fromCabalLicense (AGPL (Just (Version [3,0] []))) = Known "stdenv.lib.licenses.agpl3"
18fromCabalLicense (MPL (Version [2,0] [])) = Known "stdenv.lib.licenses.mpl20"
19fromCabalLicense BSD2 = Known "stdenv.lib.licenses.bsd2"
20fromCabalLicense BSD3 = Known "stdenv.lib.licenses.bsd3"
21fromCabalLicense BSD4 = Known "stdenv.lib.licenses.bsdOriginal"
22fromCabalLicense MIT = Known "stdenv.lib.licenses.mit"
23fromCabalLicense PublicDomain = Known "stdenv.lib.licenses.publicDomain"
24fromCabalLicense UnspecifiedLicense = Known "stdenv.lib.licenses.unfree"
25fromCabalLicense AllRightsReserved = Known "stdenv.lib.licenses.unfree"
26fromCabalLicense (Apache Nothing) = Known "stdenv.lib.licenses.asl20"
27fromCabalLicense (Apache (Just (Version [2,0] []))) = Known "stdenv.lib.licenses.asl20"
28fromCabalLicense ISC = Known "stdenv.lib.licenses.isc"
29fromCabalLicense OtherLicense = Unknown Nothing
30fromCabalLicense l = error $ "Cabal2Nix.License.fromCabalLicense: unknown license " ++ show l
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list