Package Details: license-detector 4.3.0-1

Git Clone URL: https://aur.archlinux.org/license-detector.git (read-only, click to copy)
Package Base: license-detector
Description: Reliable project licenses detector
Upstream URL: https://github.com/go-enry/go-license-detector
Licenses: Apache
Submitter: grawlinson
Maintainer: None
Last Packager: grawlinson
Votes: 1
Popularity: 0.000000
First Submitted: 2020-03-09 22:43 (UTC)
Last Updated: 2022-08-21 07:45 (UTC)

Dependencies (3)

Required by (0)

Sources (1)

Latest Comments

yochananmarqos commented on 2025-04-29 20:53 (UTC)

The upstream project seems to be unmaintained. I suggest using licensee instead.

@gesh: This package is not out of date as it's using the latest release.

Either way, feel free to adopt the package and update to the pre-release if you want.

gesh commented on 2025-04-29 13:22 (UTC)

Needed to add quotes to ldflags as documented in https://wiki.archlinux.org/title/Go_package_guidelines for this to compile.

Also, package is seriously out of date -- the targeted commit dates to two years prior to the latest release.

A patch fixing these issues:

diff --git a/PKGBUILD b/PKGBUILD
index 3bec866..126d070 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,16 @@
 # Maintainer: George Rawlinson <george@rawlinson.net.nz>

 pkgname=license-detector
-pkgver=4.3.0
+pkgver=4.3.1
 pkgrel=1
 pkgdesc='Reliable project licenses detector'
 arch=('x86_64')
 url='https://github.com/go-enry/go-license-detector'
-license=('Apache')
-depends=('glibc')
+license=('Apache-2.0')
 makedepends=('git' 'go')
 options=('!lto')
-_commit='4f2ca6af2ab943d9b5fa3a02782eebc06f79a5f4'
-source=("$pkgname::git+$url#commit=$_commit")
+source=("$pkgname::git+$url#tag=v$pkgver")
 b2sums=('SKIP')

-pkgver() {
-  cd "$pkgname"

-  git describe --tags | sed 's/^v//'
-}

 prepare() {
@@ -37,13 +35,14 @@ build() {
   export CGO_CPPFLAGS="${CPPFLAGS}"
   export CGO_CFLAGS="${CFLAGS}"
   export CGO_CXXFLAGS="${CXXFLAGS}"
+  export CGO_LDFLAGS="${LDFLAGS}" # Alternatively, use "\"${LDFLAGS}\"" below

   go build -v \
     -trimpath \
     -buildmode=pie \
     -mod=readonly \
     -modcacherw \
-    -ldflags "-linkmode external -extldflags ${LDFLAGS}" \
+    -ldflags "-linkmode external" \
     -o build \
     ./cmd/...
 }

The build flags could also be passed via GOFLAGS as outlined there, in case you find this clearer.

It turned out that this didn't fit my needs, so I won't be using this package, though.

Thanks for packaging this!

yochananmarqos commented on 2020-06-02 02:12 (UTC)

Building in a clean chroot worked, sorry for reporting an issue before tying that.

grawlinson commented on 2020-06-01 21:22 (UTC)

yochananmarqos: Are you able to provide more information?

  • Are you using Arch Linux, and not a derivative like Manjaro?
  • Version and package name of go installed

I've tested the package was built in a clean chroot, so it should work everywhere else.

yochananmarqos commented on 2020-06-01 16:56 (UTC)

This fails to build: build log