summarylogtreecommitdiffstats
diff options
context:
space:
mode:
author0x9fff002021-05-08 21:20:08 +0200
committer0x9fff002021-05-08 21:20:08 +0200
commite22cf48a0b31781f72c88315e1b16761e8f9f8d3 (patch)
tree3a4d6528b2fe88583ccb8bf02a69c82e332ab53d
parentf9a6f014456ef5d4411b517cf1d58a2038afadce (diff)
downloadaur-e22cf48a0b31781f72c88315e1b16761e8f9f8d3.tar.gz
follow Go package guidelines
-rw-r--r--.SRCINFO9
-rw-r--r--.gitignore1
-rw-r--r--.gitignore_append1
-rw-r--r--PKGBUILD44
4 files changed, 35 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7bc296c39eb5..ad1a1a11734a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,23 @@
pkgbase = pullcord-git
pkgdesc = Discord archiver - git version
- pkgver = r134.5209be1
+ pkgver = r137.a4456d6
pkgrel = 2
url = https://github.com/tsudoko/pullcord
arch = x86_64
license = Unlicense
+ license = BSD
makedepends = git
makedepends = go
- makedepends = golang-github-gorilla-websocket
- makedepends = golang-golang-x-crypto
provides = pullcord
conflicts = pullcord
source = git+https://github.com/tsudoko/pullcord.git
source = git+https://github.com/bwmarrin/discordgo.git
+ source = LICENSE.websocket::https://raw.githubusercontent.com/gorilla/websocket/v1.4.0/LICENSE
+ source = LICENSE.crypto::https://raw.githubusercontent.com/golang/crypto/4d3f4d9ffa16a13f451c3b2999e9c49e9750bf06/LICENSE
sha256sums = SKIP
sha256sums = SKIP
+ sha256sums = 2be1b548b0387ca8948e1bb9434e709126904d15f622cc2d0d8e7f186e4d122d
+ sha256sums = 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067
pkgname = pullcord-git
diff --git a/.gitignore b/.gitignore
index 1e683da2ccd4..188b82a6cb4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,4 @@ src/
# archlinuxpackages linux
pullcord
discordgo
+LICENSE.*
diff --git a/.gitignore_append b/.gitignore_append
index f18429d50fb3..564cb7255aa7 100644
--- a/.gitignore_append
+++ b/.gitignore_append
@@ -1,3 +1,4 @@
# archlinuxpackages linux
pullcord
discordgo
+LICENSE.*
diff --git a/PKGBUILD b/PKGBUILD
index e94757b7e037..dd24a91e9de6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,19 +2,23 @@
_pkgname=pullcord
pkgname=$_pkgname-git
-pkgver=r134.5209be1
+pkgver=r137.a4456d6
pkgrel=2
pkgdesc="Discord archiver - git version"
arch=('x86_64')
url="https://github.com/tsudoko/$_pkgname"
-license=('Unlicense')
-makedepends=('git' 'go' 'golang-github-gorilla-websocket' 'golang-golang-x-crypto')
+license=('Unlicense' 'BSD')
+makedepends=('git' 'go')
provides=('pullcord')
conflicts=('pullcord')
source=("git+$url.git"
- 'git+https://github.com/bwmarrin/discordgo.git')
+ 'git+https://github.com/bwmarrin/discordgo.git'
+ 'LICENSE.websocket::https://raw.githubusercontent.com/gorilla/websocket/v1.4.0/LICENSE'
+ 'LICENSE.crypto::https://raw.githubusercontent.com/golang/crypto/4d3f4d9ffa16a13f451c3b2999e9c49e9750bf06/LICENSE')
sha256sums=('SKIP'
- 'SKIP')
+ 'SKIP'
+ '2be1b548b0387ca8948e1bb9434e709126904d15f622cc2d0d8e7f186e4d122d'
+ '2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067')
pkgver() {
cd "$_pkgname"
@@ -24,27 +28,33 @@ pkgver() {
prepare() {
cd "$_pkgname"
+
git submodule deinit -f --all
git submodule init
git config submodule.vendor/github.com/bwmarrin/discordgo.url "$srcdir/discordgo"
git submodule update
- cd ..
- mkdir -p gopath/src/
- mv "$_pkgname"/vendor/* gopath/src/
- mkdir -p gopath/src/github.com/tsudoko
- ln -rTsf "$_pkgname" gopath/src/github.com/tsudoko/pullcord
+ go mod init github.com/tsudoko/pullcord
+ go mod edit -replace=github.com/bwmarrin/discordgo=./vendor/github.com/bwmarrin/discordgo
+ go mod tidy
+
+ mkdir build
}
build() {
- export GOPATH="$srcdir/gopath:/usr/share/gocode"
- cd gopath/src/github.com/tsudoko/pullcord
- go build -v \
- -trimpath \
- -ldflags "-extldflags $LDFLAGS" ./cmd/pullcord
+ cd "$_pkgname"
+
+ 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 -o build ./cmd/...
}
package() {
- cd "$_pkgname"
- install -Dm755 pullcord "$pkgdir/usr/bin/pullcord"
+ install -Dm755 -t "$pkgdir/usr/bin" $_pkgname/build/*
+ install -Dm644 $_pkgname/vendor/github.com/bwmarrin/discordgo/LICENSE "$pkgdir/usr/share/licenses/$pkgname/github.com/bwmarrin/discordgo/LICENSE"
+ install -Dm644 LICENSE.websocket "$pkgdir/usr/share/licenses/$pkgname/github.com/gorilla/websocket/LICENSE"
+ install -Dm644 LICENSE.crypto "$pkgdir/usr/share/licenses/$pkgname/golang.org/x/crypto/LICENSE"
}