You are not logged in.

#1 2019-04-03 01:40:49

tannenbaum
Member
Registered: 2019-01-23
Posts: 8

Difficult Go package - dgraph [Question]

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

#2 2019-04-03 11:19:09

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: Difficult Go package - dgraph [Question]

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

#3 2019-04-03 12:12:10

tannenbaum
Member
Registered: 2019-01-23
Posts: 8

Re: Difficult Go package - dgraph [Question]

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

#4 2019-04-03 12:18:46

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: Difficult Go package - dgraph [Question]

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

#5 2019-04-03 12:38:21

tannenbaum
Member
Registered: 2019-01-23
Posts: 8

Re: Difficult Go package - dgraph [Question]

You are indeed right. I erroneously thought it would be out of scope.

Last edited by tannenbaum (2019-04-03 12:41:56)

Offline

#6 2019-04-03 13:21:11

loqs
Member
Registered: 2014-03-06
Posts: 17,369

Re: Difficult Go package - dgraph [Question]

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

#7 2019-04-03 13:30:33

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: Difficult Go package - dgraph [Question]

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

Board footer

Powered by FluxBB