You are not logged in.

#1 2013-09-17 22:56:48

dysoco
Member
Registered: 2011-10-11
Posts: 43

Writing PKGBUILDs for Go programs.

Hello.

I was thinking in starting maintaining a few packages in the AUR, so decided to write a little test.
Let's say I want to write a PKGBUILD for this package: https://github.com/michaeldv/mop

Now, this is written in the Go language, and as some of you might know, go uses the great 'go' tool, which allows you to quickly fetch a project and install it.
So I was wondering which would be the correct way to install this, as Go specifies that all the programs must be stored in $GOPATH.

I also have no idea how to install it properly.

For example, a PKGBUILD for this program would be:

pkgname=mop-git
pkgver=20130907
pkgrel=1
pkgdesc='Command-line utility that displays information about stock markets (development version)'
url='http://github.com/michaeldv/mop'
license=('MIT')
source=('git://github.com/michaeldv/mop.git')
md5sums=('SKIP')
sha1sums=('SKIP')
sha256sums=('SKIP')
arch=('i686' 'x86_64')
depends=()
makedepends=('git' 'go')
conflicts=()
provides=()

build() {
  go get github.com/michaeldv/mop
  cd $GOPATH/src/github.com/michaeldv/mop
  make build
}

package() {
  cd $GOPATH/src/github.com/michaeldv/mop

  # Install the program.
  cp mop /usr/bin
}

As you can see it's very simple, and the Go command clones the repo and builds it automatically.

So I ask you, is this the correct way to do this? There aren't a lot of Go packages in the AUR to learn from, but most of PKGBUILDs seem to do this in another way, and I wonder why.
Thanks.

Last edited by dysoco (2013-09-17 23:00:21)

Offline

#2 2013-09-17 22:58:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Writing PKGBUILDs for Go programs.

I know nothing about go or creating PKGBUILDs, but there are guidelines in the wiki: https://wiki.archlinux.org/index.php/Go … Guidelines

Offline

#3 2013-09-17 23:02:24

dysoco
Member
Registered: 2011-10-11
Posts: 43

Re: Writing PKGBUILDs for Go programs.

Is this for real? It's really true that this is the best wiki out there, amazing that there's a page for that.

Thanks karol, helpful as ever.

Offline

Board footer

Powered by FluxBB