chiark / gitweb /
imagemagick: Update version
[termux-packages] / packages / asciinema / build.sh
1 # Go programs does not build on android-386
2 # - will hopefully get fixed in go 1.6!
3 # https://github.com/golang/go/issues/9327
4 TERMUX_PKG_HOMEPAGE=https://asciinema.org/
5 TERMUX_PKG_DESCRIPTION="Record and share your terminal sessions, the right way"
6 TERMUX_PKG_VERSION=1.1.1
7 TERMUX_PKG_SRCURL=https://github.com/asciinema/asciinema/archive/v${TERMUX_PKG_VERSION}.tar.gz
8 TERMUX_PKG_FOLDERNAME=asciinema-${TERMUX_PKG_VERSION}
9 TERMUX_PKG_BUILD_IN_SRC=yes
10
11 termux_step_make () {
12         export GOOS=android
13         export GO_LDFLAGS="-extldflags=-pie"
14         export CGO_ENABLED=1
15         if [ "$TERMUX_ARCH" = "arm" ]; then
16                 export GOARCH=arm
17                 export GOARM=7
18         elif [ "$TERMUX_ARCH" = "i686" ]; then
19                 export GOARCH=386
20                 export GO386=sse2
21         else
22                 echo "ERROR: Unsupported arch: $TERMUX_ARCH"
23                 exit 1
24         fi
25
26         export GOPATH=$TERMUX_PKG_TMPDIR
27         cd $GOPATH
28         mkdir -p src/github.com/asciinema/asciinema/
29         cp -Rf $TERMUX_PKG_SRCDIR/* src/github.com/asciinema/asciinema/
30 }
31
32 termux_step_make_install () {
33         cd $GOPATH/src/github.com/asciinema/asciinema
34         export GOROOT=$HOME/lib/go/
35         export PATH=$GOROOT/bin:$PATH
36         PREFIX=$TERMUX_PREFIX make build
37         PREFIX=$TERMUX_PREFIX make install
38 }