[aur-general] Packaging a go application

Morten Linderud foxboron at archlinux.org
Sat Sep 7 12:48:21 UTC 2019


On Sat, Sep 07, 2019 at 02:37:13PM +0200, Rhys Perry via aur-general wrote:
> Hi, I am currently trying to package an application for use in the aur. The
> problem I am having is the install() section. The only thing i need to be done
> is for the package to move '$srcdir/$_gitname/fathom' into '/bin/'. How would
> I turn that into a .tar.gz?

Why would you need to turn anything into `.tar.gz`? Are you thinking about a
package? `makepkg` does that for you.

Reading the PKGBUILD it seems like you haven't read all the relevant package
guideline pages we provide.

https://wiki.archlinux.org/index.php/Go_package_guidelines

https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git


> ####### PKGBUILD STARTS HERE #######
> license=("MIT")

The license needs to be installed in `package()`.

> arch=("any")

This isn't an "any" package as it contains compiled code. `x86_64` should be
enough
> 
> makedepends=("git" "go" "npm")

Usually you want to build towards `go-pie` to provide PIE enabled binaries. But
since it's an AUR package this isn't super important.

> source=("git://github.com/usefathom/fathom.git")

You want "git+https://github.com....."

> build(){
> export GOPATH="$srcdir"/gopath
> cd $srcdir/$_gitname
> make build
> }

You need to cd into the complete gopath of the source.

> 
> package(){
> echo "I don't know what to do now"
> }

Read any normal PKGBUILD from our repository or guidelines. It should be fairly
obvious.

You can also look at examples by taking a look at the PKGBUILDs from other
go projects. Click on the ones listing `go-pie` as a "(make)" dependency.


https://www.archlinux.org/packages/community/x86_64/go-pie/

-- 
Morten Linderud
PGP: 9C02FF419FECBE16
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20190907/dd5c2d94/attachment.sig>


More information about the aur-general mailing list