Skip to content

Commit 03f2723

Browse files
haskellPackages.mkDerivation: make license optional
`stdenv.mkDerivation` does not require meta.license to be passed, so there is no reason `haskellPackages.mkDerivation` needs to enforce this. This would free up cabal2nix to not report a license if it is not sure. As I have argued in NixOS/cabal2nix#677 (comment), it is better not to report a license than reporting an inaccurate one. This would also allow to stop generating arbitrary strings as licenses in cabal2nix to remove string values to facilitate more cleanliness in the spirit of #445672, though the question is whether it is wise to remove the meta data altogether.
1 parent 3c0492f commit 03f2723

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkgs/development/haskell-modules/generic-builder.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ in
9696
libraryFrameworkDepends ? [ ],
9797
executableFrameworkDepends ? [ ],
9898
homepage ? "https://hackage.haskell.org/package/${pname}",
99-
platforms ? with lib.platforms; all, # GHC can cross-compile
99+
platforms ? lib.platforms.all, # GHC can cross-compile
100100
badPlatforms ? lib.platforms.none,
101101
hydraPlatforms ? null,
102102
hyperlinkSource ? true,
103103
isExecutable ? false,
104104
isLibrary ? !isExecutable,
105105
jailbreak ? false,
106-
license,
106+
license ? null,
107107
enableParallelBuilding ? true,
108108
maintainers ? null,
109109
teams ? null,
@@ -1031,10 +1031,11 @@ lib.fix (
10311031
};
10321032

10331033
meta = {
1034-
inherit homepage license platforms;
1034+
inherit homepage platforms;
10351035
}
10361036
// optionalAttrs (args ? broken) { inherit broken; }
10371037
// optionalAttrs (args ? description) { inherit description; }
1038+
// optionalAttrs (args ? license) { inherit license; }
10381039
// optionalAttrs (args ? maintainers) { inherit maintainers; }
10391040
// optionalAttrs (args ? teams) { inherit teams; }
10401041
// optionalAttrs (args ? hydraPlatforms) { inherit hydraPlatforms; }

0 commit comments

Comments
 (0)