-
Notifications
You must be signed in to change notification settings - Fork 3
/
git.PKGBUILD
41 lines (37 loc) · 1.12 KB
/
git.PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
source PKGBUILD
pkgdesc="Skywire Mainnet Node implementation. Skycoin.com - develop branch"
#build a branch with BRANCH=branch
#build a fork with FORK=<github-username>
source=("git+${url}.git#branch=${BRANCH:-develop}"
"${_source[@]}"
)
sha256sums=('SKIP'
'SKIP')
pkgver() {
_version=$(git ls-remote --tags --refs --sort="version:refname" ${url}.git | tail -n1)
_version=${_version##*/}
_version=${_version%%-*}
_version=${_version//v/}
echo ${_version}
}
prepare() {
# https://wiki.archlinux.org/index.php/Go_package_guidelines
mkdir -p ${srcdir}/go/src/github.com/${_githuborg}/ ${srcdir}/go/bin ${srcdir}/go/apps
ln -rTsf ${srcdir}/${_pkgname} ${srcdir}/go/src/${_pkggopath}
cd ${srcdir}/go/src/${_pkggopath}/
}
build() {
cd ${srcdir}/go/src/${_pkggopath}
#build the frontend. Normlly not necessary
#make build-ui
export GOPATH=${srcdir}/go
export GOBIN=${GOPATH}/bin
export _GOAPPS=${GOPATH}/apps
export GOOS=linux
export CGO_ENABLED=1 #default anyways
#use musl-gcc for static compilation
export CC=musl-gcc
rm -rf ${srcdir}/${pkgname}-${pkgver}${_rc}
ln -fs ${srcdir}/${pkgname} ${srcdir}/${pkgname}-${pkgver}${_rc}
_build
}