···1+{ lib
2+, buildGoModule
3+, fetchFromGitHub
4+}:
5+6+buildGoModule rec {
7+ pname = "licenseclassifier";
8+ version = "2.0.0";
9+10+ src = fetchFromGitHub {
11+ owner = "google";
12+ repo = "licenseclassifier";
13+ rev = "v${version}";
14+ hash = "sha256-j+8hX8W0VD0h09Qmu7POnHT8f8+SeG5Si1fI0CDIwuo=";
15+ };
16+17+ # The new and improved "License Classifier v2" is hidden in a subdirectory.
18+ sourceRoot = "source/v2";
19+20+ vendorHash = "sha256-u0VR8DCmbZS0MF26Y4HfqtLaGyX2n2INdAidVNbnXPE=";
21+22+ ldflags = [ "-s" "-w" ];
23+24+ meta = with lib; {
25+ description = "A License Classifier";
26+ longDescription = ''
27+ The license classifier can analyze text to determine what type of license
28+ it contains. It searches for license texts in a file and compares them to
29+ an archive of known licenses. These files could be, e.g., LICENSE files
30+ with a single or multiple licenses in it, or source code files with the
31+ license text in a comment.
32+ '';
33+ homepage = "https://github.com/google/licenseclassifier";
34+ license = licenses.asl20;
35+ platforms = platforms.unix;
36+ maintainers = with maintainers; [ tnias ];
37+ };
38+}