Skip to content

Conversation

jopejoe1
Copy link
Member

I'm working on removing all stringy licenses in nixpkgs, and currently the only ones left are the ones in haskellPackages and node2nix packages. This change fixes the ones for Haskell packages.

Copy link
Member

@sternenseemann sternenseemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a changelog entry, ideally noting when nixpkgs added support for lib.licensesSpdx.


fromCabalLicense :: Distribution.License.License -> Distribution.Nixpkgs.License.License
fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
fromCabalLicense (GPL Nothing) = Known "lib.licenses.gpl2Plus"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These cases are intentional as there is not enough information to conclude what variant of the license in question is used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do realize they were intentional, but they can't stay in their current form. I'm currently working towards disallowing stringy licenses in nixpkgs, and those are pretty much the only ones left. Other options would be to make it even less informational with lib.licenses.free or to add a new custom license (not really a fan of this).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at a few packages in more detail and I think we can reasonably do two things:

  • interpret GPL as gpl2Plus as done here. That's because they could have used GPL-2 or GPL-3 if they wanted to be more specific.
  • just use free as fallback for this.

For me, both are fine.

Comment on lines +55 to +62
-- Not handed: the '+' suffix and user-defined licences references.
-- Use the SPDX expression as a free-form license string.
Unknown (Just $ DPretty.prettyShow simpl)
fromSPDXLicenseExpression (SPDX.ELicense simpl (Just excep)) =
case simpl of
SPDX.ELicenseId lid -> Known ("lib.licensesSpdx.\"" ++ DPretty.prettyShow lid ++ "\" lib.licensesSpdx.\"" ++ DPretty.prettyShow excep ++ "\"")
_ ->
-- Not handed: the '+' suffix and user-defined licences references.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- Not handed: the '+' suffix and user-defined licences references.
-- Use the SPDX expression as a free-form license string.
Unknown (Just $ DPretty.prettyShow simpl)
fromSPDXLicenseExpression (SPDX.ELicense simpl (Just excep)) =
case simpl of
SPDX.ELicenseId lid -> Known ("lib.licensesSpdx.\"" ++ DPretty.prettyShow lid ++ "\" lib.licensesSpdx.\"" ++ DPretty.prettyShow excep ++ "\"")
_ ->
-- Not handed: the '+' suffix and user-defined licences references.
-- Not handled: the '+' suffix and user-defined licences references.
-- Use the SPDX expression as a free-form license string.
Unknown (Just $ DPretty.prettyShow simpl)
fromSPDXLicenseExpression (SPDX.ELicense simpl (Just excep)) =
case simpl of
SPDX.ELicenseId lid -> Known ("lib.licensesSpdx.\"" ++ DPretty.prettyShow lid ++ "\" lib.licensesSpdx.\"" ++ DPretty.prettyShow excep ++ "\"")
_ ->
-- Not handled: the '+' suffix and user-defined licences references.

homepage = "https://github.com/blamario/incremental-parser";
description = "Generic parser library capable of providing partial results from partial input";
license = "GPL";
license = lib.licenses.gpl2Plus;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream has changed to GPL-3 by now.

homepage = "http://github.com/jgm/highlighting-kate";
description = "Syntax highlighting";
license = "GPL";
license = lib.licenses.gpl2Plus;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream still uses GPL, and has gpl2Only, I think: https://github.com/jgm/highlighting-kate/blob/master/LICENSE

homepage = "https://github.com/skogsbaer/HTF/";
description = "The Haskell Test Framework";
license = "LGPL";
license = lib.licenses.lgpl2Plus;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream has now LGPL-2.1, which renders as LGPL-2.1-only on hackage.

homepage = "https://wiki.haskell.org/Lambdabot";
description = "Social plugins for Lambdabot";
license = "GPL";
license = lib.licenses.gpl2Plus;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lambdabot-social-plugins has GPL, but.. the license looks like BSD/MIT: https://github.com/lambdabot/lambdabot/blob/master/lambdabot-social-plugins/LICENSE

homepage = "http://github.com/jgm/texmath";
description = "Conversion between formats used to represent mathematics";
license = "GPL";
license = lib.licenses.gpl2Plus;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

texmath has updated to GPL-2, which renders as GPL-2.0-only on hackage.


fromCabalLicense :: Distribution.License.License -> Distribution.Nixpkgs.License.License
fromCabalLicense (GPL Nothing) = Unknown (Just "GPL")
fromCabalLicense (GPL Nothing) = Known "lib.licenses.gpl2Plus"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at a few packages in more detail and I think we can reasonably do two things:

  • interpret GPL as gpl2Plus as done here. That's because they could have used GPL-2 or GPL-3 if they wanted to be more specific.
  • just use free as fallback for this.

For me, both are fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants