chiark / gitweb /
toilet: Switch to mirror for downloading source
[termux-packages] / packages / asciinema / build.sh
1 TERMUX_PKG_HOMEPAGE=https://asciinema.org/
2 TERMUX_PKG_DESCRIPTION="Record and share your terminal sessions, the right way"
3 TERMUX_PKG_VERSION=1.1.1
4 TERMUX_PKG_BUILD_REVISION=1
5 TERMUX_PKG_SRCURL=https://github.com/asciinema/asciinema/archive/v${TERMUX_PKG_VERSION}.tar.gz
6 TERMUX_PKG_FOLDERNAME=asciinema-${TERMUX_PKG_VERSION}
7 TERMUX_PKG_BUILD_IN_SRC=yes
8
9 termux_step_make () {
10         export GOOS=android
11         export GO_LDFLAGS="-extldflags=-pie"
12         export CGO_ENABLED=1
13         if [ "$TERMUX_ARCH" = "arm" ]; then
14                 export GOARCH=arm
15                 export GOARM=7
16         elif [ "$TERMUX_ARCH" = "i686" ]; then
17                 export GOARCH=386
18                 export GO386=sse2
19         elif [ "$TERMUX_ARCH" = "aarch64" ]; then
20                 export GOARCH=arm64
21         elif [ "$TERMUX_ARCH" = "x86_64" ]; then
22                 export GOARCH=amd64
23         else
24                 echo "ERROR: Unsupported arch: $TERMUX_ARCH"
25                 exit 1
26         fi
27
28         export GOPATH=$TERMUX_PKG_TMPDIR
29         cd $GOPATH
30         mkdir -p src/github.com/asciinema/asciinema/
31         cp -Rf $TERMUX_PKG_SRCDIR/* src/github.com/asciinema/asciinema/
32 }
33
34 termux_step_make_install () {
35         cd $GOPATH/src/github.com/asciinema/asciinema
36         termux_setup_golang
37         PREFIX=$TERMUX_PREFIX make build
38         PREFIX=$TERMUX_PREFIX make install
39 }