You are not logged in.
I would like to package dgraph, a go get program.
pkgname=dgraph-git
pkgver=1.0
pkgrel=1
pkgdesc='a low latency, high throughput, native and distributed graph database'
arch=('x86_64' 'i686')
url='https://github.com/dgraph-io/dgraph'
license=('custom')
provides=('dgraph')
options=('!strip' '!emptydirs')
depends=('go')
prepare() {
mkdir -p "./gopath/src/github.com/dgraph-io"
ln -rTsf "dgraph-git-1.0" "./gopath/src/github.com/dgraph-io/dgraph"
export GOPATH="${srcdir}/gopath"
ls ${GOPATH}
cd "${GOPATH}/src/github.com/dgraph-io/dgraph"
go get -d ./...
}
build() {
export GOPATH="${srcdir}/gopath"
cd "${GOPATH}/src/github.com/dgraph-io/dgraph"
go install -v ./...
}
package() {
export GOPATH="${srcdir}/gopath"
cd "${GOPATH}/bin"
for binary in dgraph dgraphloader postingiterator; do
install -Dm755 bin/$binary "$pkgdir/usr/bin/$binary"
done
}
But it fails in the very first folder creation. My brain is blocked: What's wrong with this PKGBUILD directly modelled after the example in the Wiki?
--Thanks a lot
Last edited by tannenbaum (2019-04-03 12:38:00)
Offline
mkdir -p "./gopath/src/github.com/dgraph-io"
try removing the ./ .
If that fails, post the output makepkg gives so we can see the exact errorr message.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
I've actually added the ./ – without it is still:
~/aur/dgraph-git/src/gopath/src/github.com/dgraph-io/dgraph: File or directory not found
Offline
The PKGBUILD you posted is missing the package() function and won't build at all.
Please post the complete PKGBUILD you are using.
Last edited by Lone_Wolf (2019-04-03 12:19:00)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
You are indeed right. I erroneously thought it would be out of scope.
Last edited by tannenbaum (2019-04-03 12:41:56)
Offline
If I add
makedepends=('git')
....
source=(git+https://github.com/dgraph-io/dgraph)
md5sums=('SKIP')
then in prepare change
ln -rTsf "dgraph-git-1.0" "./gopath/src/github.com/dgraph-io/dgraph"
to
ln -rTsf dgraph gopath/src/github.com/dgraph-io/dgraph
It then progresses to package() and fails because "${GOPATH}/bin" does not exist.
Offline
First : you haven't added a source= field, so makepkg doesn't download anything.
add one and add git to makedepends= field (create if needed)
second :
Your PKGBUILD (and the Go wikipage examples) uses gopath in 2 forms : GOPATH & gopath .
The lowercase is just a foldername, the uppercase is a parameter.
It matters which form you use, carefully compare your code with the wiki examples.
We can't change the parameter GOPATH, but could use gofolder instead of gopath for the directory to avoid confusion.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline