diff options
author | a821 | 2022-03-18 11:38:50 +0100 |
---|---|---|
committer | a821 | 2022-03-18 11:38:50 +0100 |
commit | cc59c74edcc543089f157318a3df1a8e9dce3a43 (patch) | |
tree | 1d17b28c757f0a060741dceab0986bb03457977f | |
parent | 45f9723a25e88586dda180c5dbe41d483b0f1bf5 (diff) | |
download | aur-cc59c74edcc543089f157318a3df1a8e9dce3a43.tar.gz |
Fix PKGBUILD
* Fix source URL as github discontinued the git:// protocol
* Fix PKGBUILD so it complies with the GO packaging guidelines
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | PKGBUILD | 61 |
2 files changed, 30 insertions, 40 deletions
@@ -1,14 +1,15 @@ pkgbase = go-pkgs-git pkgdesc = Command gopkgs list your installed Go packages for import - pkgver = 20160408.11_01f4431 + pkgver = r14.81e90e2 pkgrel = 1 + epoch = 1 + url = https://github.com/tpng/gopkgs arch = i686 arch = x86_64 - license = GPL + license = MIT makedepends = go makedepends = git - source = git://github.com/tpng/gopkgs.git + source = git+https://github.com/tpng/gopkgs md5sums = SKIP pkgname = go-pkgs-git - @@ -1,49 +1,38 @@ pkgname=go-pkgs-git -pkgver=20160408.11_01f4431 +pkgver=r14.81e90e2 pkgrel=1 +epoch=1 pkgdesc="Command gopkgs list your installed Go packages for import" arch=('i686' 'x86_64') -license=('GPL') -depends=( -) -makedepends=( - 'go' - 'git' -) - -source=( - "git://github.com/tpng/gopkgs.git" -) - -md5sums=( - 'SKIP' -) - -backup=( -) - -conflicts=( -) +url="https://github.com/tpng/gopkgs" +license=('MIT') +makedepends=('go' 'git') +source=("git+${url}") +md5sums=('SKIP') pkgver() { - cd "$srcdir/gopkgs" - local date=$(git log -1 --format="%cd" --date=short | sed s/-//g) - local count=$(git rev-list --count HEAD) - local commit=$(git rev-parse --short HEAD) - echo "$date.${count}_$commit" + cd gopkgs + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd gopkgs + go mod init "${url#https://}" + go mod tidy } build() { - GOPATH=$srcdir - GOBIN=$srcdir/bin/ - mkdir -p $srcdir/src - ln -sf $srcdir/gopkgs $srcdir/src - cd $srcdir/src/gopkgs - go get -v + cd gopkgs + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build } package() { - find "$srcdir/bin/" -type f -executable | while read filename; do - install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)" - done + cd gopkgs + install -Dm755 -t "$pkgdir/usr/bin" gopkgs + install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } |