summarylogtreecommitdiffstats
diff options
context:
space:
mode:
author@RubenKelevra2021-01-25 23:28:44 +0100
committer@RubenKelevra2021-01-25 23:28:44 +0100
commit4e131217e49e94617baea89c4535b6b4bc15d52d (patch)
treebd8bcb02f392edccf8b5483a56fefd0fc27da44c
parent62f1676ed328b8d424fed5eb6588f342c9f3a7f8 (diff)
downloadaur-git-remote-ipld-git.tar.gz
update package (building but crashing now, see issue #33 in the repo)
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD68
2 files changed, 43 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 88c1fc27a40..ada27e0f740 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,21 @@
pkgbase = git-remote-ipld-git
pkgdesc = git IPLD remote helper
- pkgver = 0.0.0.g61547fd
+ pkgver = 0.0.0.r0.g501d5f2ce
pkgrel = 1
+ epoch = 1
url = https://github.com/ipfs-shipyard/git-remote-ipld
arch = i686
arch = x86_64
arch = armv7h
license = MIT
+ makedepends = go>=2:1.14.4-1
makedepends = git
- makedepends = go
- makedepends = jq
makedepends = go-ipfs
depends = git
provides = git-remote-ipld
conflicts = git-remote-ipld
source = git+https://github.com/ipfs-shipyard/git-remote-ipld.git
- sha256sums = SKIP
+ b2sums = SKIP
pkgname = git-remote-ipld-git
diff --git a/PKGBUILD b/PKGBUILD
index 0efdf7d4f9f..dd9e4ce624c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,54 +1,64 @@
-# Maintainer: Sameer Puri <purisame@spuri.io>
+# Maintainer: @RubenKelevra
+# Contributor: Sameer Puri <purisame@spuri.io>
_pkgname=git-remote-ipld
pkgname=$_pkgname-git
-pkgver=0.0.0.g61547fd
+pkgver=0.0.0.r0.g501d5f2ce
pkgrel=1
+epoch=1
pkgdesc='git IPLD remote helper'
url="https://github.com/ipfs-shipyard/$_pkgname"
arch=('i686' 'x86_64' 'armv7h')
license=('MIT')
depends=('git')
-makedepends=('git' 'go' 'jq' 'go-ipfs')
+makedepends=("go>=2:1.14.4-1" git 'go-ipfs')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("git+${url}.git")
-sha256sums=('SKIP')
+b2sums=('SKIP')
pkgver() {
- cd "$srcdir/$_pkgname"
- VERSION=$(jq -r .version package.json)
- REST=$(git rev-parse --short HEAD | sed -e 's/^v//' -e 's/^\(.*\)-\([0-9]*\)-\(g[0-9a-f]*\)$/r\2.\3/')
- printf "%s.g%s" "$VERSION" "$REST" | sed -e 's/-//g'
+ cd "$srcdir/$_pkgname"
+ #VERSION=$(grep -E "^const CurrentVersionNumber = " version.go | awk '{ print $4 }' | sed 's/"//g')
+ VERSION=$(git tag | grep -vE "floodsub|sharding-pre" | grep -ve "-dev" | sed 's/-/~/g' | sort --version-sort --reverse | sed 's/~/-/g' | head -n1)
+ if [ -z "$VERSION" ]; then
+ VERSION="0.0.0"
+ COUNT=0
+ else
+ COUNT=$(git rev-list "$VERSION.." --count)
+ fi
+ CHKSUM=$(git rev-list master | head -n1)
+ VERSION=$(echo "$VERSION" | sed 's/^v//' | sed 's/-//')
+ printf "%s.%s.%s" "$VERSION" "r$COUNT" "g${CHKSUM:0:9}"
}
prepare() {
- mkdir -p "$srcdir"/src/github.com/ipfs-shipyard
- ln -sf "$srcdir/$_pkgname" "$srcdir"/src/github.com/ipfs-shipyard/"$_pkgname"
+ cd "$srcdir/$_pkgname"
+ mkdir -p "${srcdir}/../go"
+ export GOPATH="${srcdir}/../go"
+ export PATH="$PATH:$GOPATH/bin"
+ # fix for broken version
+ chmod u+w -R "$GOPATH"
+ go get -d -v ./...
}
build() {
- # Required for go get
- export GOPATH="$srcdir"
- export GOBIN="$srcdir/bin"
- export PATH=$PATH:$GOPATH/bin
-
- msg2 'Installing dependencies...'
- cd "$GOPATH"/src
- go get -d -v github.com/ipfs-shipyard/"$_pkgname"
-
- msg2 'Building binary...'
- cd "$GOPATH"/src/github.com/ipfs-shipyard/"$_pkgname"
- make install
+ cd "$srcdir/$_pkgname"
+ export GOPATH="${srcdir}/../go"
+ export PATH="$PATH:$GOPATH/bin"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ make GOFLAGS="-buildmode=pie -trimpath -modcacherw"
}
package() {
- msg2 'Packaging binary...'
- install -Dm 755 bin/git-remote-ipld "${pkgdir}/usr/bin/git-remote-ipld"
-
- msg2 'Packaging auxiliary files...'
- cd "$_pkgname"
- install -Dm 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
- install -Dm 644 -t "${pkgdir}/usr/share/doc/${pkgname}" README.md
+ cd "$srcdir/$_pkgname"
+ install -Dm 755 cmd/$_pkgname/$_pkgname "${pkgdir}/usr/bin/git-remote-ipld"
+ install -Dm 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
+ install -Dm 644 -t "${pkgdir}/usr/share/doc/${pkgname}" README.md
+ # make sure the gopath is writeable
+ chmod u+w -R "$GOPATH"
}