jpvillaisaza / licensor Goto Github PK
View Code? Open in Web Editor NEWA license compatibility helper for Haskell
License: MIT License
A license compatibility helper for Haskell
License: MIT License
$ stack list-dependencies
DEPRECATED: Use ls dependencies instead. Will be removed in next major version.
https://en.wikipedia.org/wiki/License_compatibility#Compatibility_of_FOSS_licenses
IANAL, but my understanding of how licensing compatibility and their subsumption rules work is that by using BSD3 licensed libraries you must license this utility as BSD3 or something stronger. BSD3 software can use MIT but not vice versa.
falsifian angel licensor $ cabal build .
Resolving dependencies...
Build profile: -w ghc-8.6.4 -O1
In order, the following will be built (use -v for more details):
- licensor-0.4.1 (lib) (configuration changed)
- licensor-0.4.1 (exe:licensor) (configuration changed)
Configuring library for licensor-0.4.1..
Preprocessing library for licensor-0.4.1..
Building library for licensor-0.4.1..
[2 of 2] Compiling Licensor ( src/Licensor.hs, /home/falsifian/src/licensor/dist-newstyle/build/x86_64-
openbsd/ghc-8.6.4/licensor-0.4.1/build/Licensor.o )
src/Licensor.hs:69:15: error:
• No instance for (Distribution.Text.Text LiLicense)
arising from a use of ‘display’
• In the first argument of ‘comparing’, namely ‘display’
In the expression: comparing display
In an equation for ‘compare’: compare = comparing display
|
69 | comparing display
| ^^^^^^^
cabal: Failed to build licensor-0.4.1 (which is required by exe:licensor from
licensor-0.4.1).
I suspect it's because cabal is trying to use version 2 of the Cabal library. I'm currently trying with a version restriction >= 3.0
added for Cabal
and will send a pull request if it works.
I'm leaning towards cmdargs.
It would be nice to start with an option to get the licenses for a remote package.
Hi @jpvillaisaza, thanks for maintaining this package!
Licensor could become a very useful tool in the conda-forge ecosystem for Haskell packages. What it is missing is to collect all license files, instead of just collecting the license types.
Context: in order to add a package to conda-forge, you need to provide a folder that contains all your dependencies' license files (can also be a single file, like in the code-server-recipe). I was hoping that the current output of licensor (summary of the license types) would be sufficient, but unfortunately it is not.
Is collecting all license files a feature you consider in scope for licensor? It would help the packaging community tremendously and would allow us to add tools like hadolint to conda-forge. Unfortunately I can't contribute this myself, as I don't know Haskell.
Would be great to know what you think about this. :)
If the name of a package in a project matches the name of a package included in Hackage, the license of the package is incorrectly reported as the license of the latter.
Note that fixing #16 should fix this one as well.
Add a license report for Licensor (69 dependencies under BSD3 and 7 under MIT for version 0.1.0).
@jpvillaisaza this library really saved me this week! Thank you for putting it together. I wanted to contribute a bit of documentation to help others who might get the above error.
In my case, it was because stack list-dependencies
was producing <unknown>
versions. In getDependencies
; this in turn can cause the parse to fail for certain dependencies, like
base-<unknown>
ghc-prim-<unknown>
integer-gmp-<unknown>
template-haskell-<unknown>
This will subsequently cause sequence
to collapse the list of [Maybe PackageIdentifier]
to Nothing
instead of Just [PackageIdentifier]
, resulting in that error message. I had to do a filter isJust
on top of the parsed results to throw those out, and the rest worked beautifully 👍
I'm running OpenBSD current, and this is what I get when I try to run licensor from my top-level directory:
$ licensor
Package: sound-stream-0.0.0.0 (License: NONE)
Writing implicit global project config file to: /home/falsifian/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-16.20
Unable to find installation URLs for OS key: openbsd64-maj6-min8
Unable to find installation URLs for OS key: openbsd64-maj6-min8
Error: ...
I'm not really familiar with stack, so I'm not sure what the error means or why my OS matters when checking licenses.
(License: NONE is correct; I haven't picked one.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.