MyNixOS website logo
Description

A license compatibility helper.

The not so great automatic Haskell licensor

Licensor is a program that generates a report of the dependencies and transitive dependencies of a Haskell project and their licenses.

NOTE: Currently, Stack and a stack.yaml file are required.

Description

Choosing a license for a software project or determining whether a particular dependency can be added to a project can be projects themselves. Unless starting from scratch, programmers should consider the licenses of the dependencies and transitive dependencies of their projects to make informed decisions and avoid license compatibility issues.

Of course, this is just a starting point. "Beyond (...) general observations, it is difficult, if not impossible, to provide precise guidance about what licenses may or may not be compatible with each other. (...) Programmers who are considering combining code governed by two or more different licenses should proceed cautiously" (Andrew M. St. Laurent).

Disclaimer

Licensor is not a lawyer and does not provide legal advice.

For more information about licenses and license compatibility issues, read the text of the licenses or consult with a lawyer before making any decision.

Related programs

Licensor is not the only license compatibility helper for Haskell:

  • Licensor uses a Cabal library and Stack program approach for detecting licenses and listing dependencies, respectively. For a Cabal library and program approach, consider using the cabal-dependency-licenses program or the cabal-plan utility.

Installation and usage

To install Licensor, use Cabal:

$ cabal update && cabal install licensor

Then, run the licensor executable inside a Haskell project:

$ licensor

To see the license report for Licensor, clone the repository:

$ git clone https://github.com/jpvillaisaza/licensor

And run licensor inside the project:

$ cd licensor/ && licensor

Or build and run licensor inside the project:

$ cd licensor/ && stack build --exec licensor

To generate a report including license files for all dependencies, use the --licenses option and redirect the output to a file:

$ licensor --quiet --licenses > licenses.md

See licenses.md for an example.

NOTE: This is currently using the Hackage API, which doesn't require building any package, but could probably be improved to use the installed packages if present.

For more information, run licensor --help:

usage: licensor
  -q, -s  --quiet, --silent  Quiet/silent mode
          --licenses         Fetch license files
  -h      --help             Display help message
  -V      --version          Print version information

Notes

Dependencies

Licensor uses the Stack program to list dependencies for a Haskell project. A future enhancement could be to use the Stack library.

Licenses and license detection

Licensor uses the Cabal library to detect the license of a Haskell project and its dependencies (including transitive dependencies). To do so, it uses the license field in the package description. A future enhancement could be to use both the license and licence file fields in the package description.

Cabal provides an enumeration of common open source and free software licenses. These are the licenses that appear in the reports generated by Licensor:

LicenseDescription
GPLGNU General Public License
AGPLGNU Affero General Public License
LGPLGNU Lesser General Public License
BSD2BSD 2-Clause License
BSD3BSD 3-Clause License
BSD4BSD 4-Clause License
MITMIT License
ISCISC License
MPLMozilla Public License
ApacheApache License
PublicDomainPublic domain
AllRightsReservedAll rights reserved
UnspecifiedLicenseUnspecified license (All rights reserved)
OtherLicenseOther license
UnknownLicenseUnknown license

Contribution guidelines

Feel free to create issues for reporting bugs and suggesting enhancements, or to fork the repository and open a pull request.

License

Licensor is licensed under the MIT License. See LICENSE.md.

License report

Licensor (0.5.0) depends on the following libraries:

LibraryLicense
CabalBSD-3
baseBSD-3
bytestringBSD-3
containersBSD-3
directoryBSD-3
http-clientMIT
http-client-tlsMIT
processBSD-3
tarBSD-3
temporaryBSD-3
zlibBSD-3

And the following licenses (including transitive dependencies):

LicenseNumber of libraries
BSD-21
BSD-322
MIT5

(Tested with Licensor 0.5.0, Stack 2.7.1, and LTS Haskell 17.13.)

Additional resources

Metadata

Version

0.5.0

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows