@@ -473,6 +473,7 @@ RECIPE_MAINTAINER:pn-libxvmc = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-libxxf86vm = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-libyaml = "Wang Mingyu <wangmy@fujitsu.com>"
RECIPE_MAINTAINER:pn-libzip = "Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>"
+RECIPE_MAINTAINER:pn-licensecheck = "Tim Orling <tim.orling@konsulko.com>"
RECIPE_MAINTAINER:pn-lighttpd = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-linux-dummy = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-linux-firmware = "Vivek Puar <vpuar@qti.qualcomm.com>"
new file mode 100644
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: MIT
+//
+// Command licensecheck prints the licenses that github.com/google/licensecheck
+// finds in each file, one JSON object per file.
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+ "os"
+
+ "github.com/google/licensecheck"
+)
+
+type match struct {
+ ID string `json:"id"`
+ Start int `json:"start"`
+ End int `json:"end"`
+ IsURL bool `json:"url,omitempty"`
+}
+
+type result struct {
+ File string `json:"file"`
+ Percent float64 `json:"percent"`
+ Matches []match `json:"matches"`
+ Error string `json:"error,omitempty"`
+}
+
+func main() {
+ if len(os.Args) < 2 {
+ fmt.Fprintln(os.Stderr, "usage: licensecheck FILE...")
+ os.Exit(2)
+ }
+ enc := json.NewEncoder(os.Stdout)
+ for _, f := range os.Args[1:] {
+ r := result{File: f, Matches: []match{}}
+ data, err := os.ReadFile(f)
+ if err != nil {
+ r.Error = err.Error()
+ } else {
+ cov := licensecheck.Scan(data)
+ r.Percent = cov.Percent
+ for _, m := range cov.Match {
+ r.Matches = append(r.Matches, match{m.ID, m.Start, m.End, m.IsURL})
+ }
+ }
+ enc.Encode(r)
+ }
+}
new file mode 100644
@@ -0,0 +1,31 @@
+SUMMARY = "Identify the licenses in license files"
+DESCRIPTION = "A command line front end for the Go licensecheck library, which \
+pkg.go.dev uses to detect the licenses of Go modules. For each file, it lists \
+every license that it finds, where in the file, and how much of the file the \
+licenses cover. go-mod-update-modules.bbclass uses it to identify the licenses \
+of Go module dependencies."
+HOMEPAGE = "https://github.com/google/licensecheck"
+BUGTRACKER = "https://github.com/google/licensecheck/issues"
+SECTION = "devel"
+
+# No CPE in the NVD yet. Name the vendor, as other projects are also
+# called licensecheck.
+CVE_PRODUCT = "google:licensecheck"
+
+LICENSE = "BSD-3-Clause AND MIT"
+LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=a413d6b3884e141783f23d00d5838777 \
+ file://src/${GO_IMPORT}/cmd/licensecheck/main.go;beginline=1;endline=1;md5=6ec41034e04432ee375d0e14fba596f4"
+
+SRC_URI = "git://github.com/google/licensecheck;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX} \
+ file://main.go;subdir=${GO_SRCURI_DESTSUFFIX}/cmd/licensecheck"
+SRCREV = "16aaea36649f556bae5a5ee972c247f58a0de1c4"
+
+GO_IMPORT = "github.com/google/licensecheck"
+GO_INSTALL = "${GO_IMPORT}/cmd/licensecheck"
+
+# The library only uses the standard library
+export GO111MODULE = "off"
+
+inherit go
+
+BBCLASSEXTEND = "native"
Add licensecheck 0.3.1, the license detection library that pkg.go.dev uses, for go-mod-update-modules. main.go is a small front end that prints, as JSON, the licenses found in each file and how much of the file they cover. The library is BSD-3-Clause; main.go is MIT. AI-Generated: Claude Fable 5.2 (maintainers.inc entry, CVE_PRODUCT) Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- meta/conf/distro/include/maintainers.inc | 1 + .../licensecheck/files/main.go | 49 +++++++++++++++++++ .../licensecheck/licensecheck_0.3.1.bb | 31 ++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 meta/recipes-devtools/licensecheck/files/main.go create mode 100644 meta/recipes-devtools/licensecheck/licensecheck_0.3.1.bb