Add asciinema package
authorFredrik Fornwall <fredrik@fornwall.net>
Thu, 20 Aug 2015 01:17:57 +0000 (03:17 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Thu, 20 Aug 2015 01:17:57 +0000 (03:17 +0200)
packages/asciinema/Makefile.patch [new file with mode: 0644]
packages/asciinema/build.sh [new file with mode: 0644]
packages/asciinema/commands-rec.go.patch [new file with mode: 0644]
packages/asciinema/util-cfg.go.patch [new file with mode: 0644]

diff --git a/packages/asciinema/Makefile.patch b/packages/asciinema/Makefile.patch
new file mode 100644 (file)
index 0000000..0b1bd3b
--- /dev/null
@@ -0,0 +1,22 @@
+diff -u -r ../asciinema-1.1.1/Makefile ./Makefile
+--- ../asciinema-1.1.1/Makefile        2015-06-21 17:58:14.000000000 +0200
++++ ./Makefile 2015-08-20 01:39:05.000000000 +0200
+@@ -1,6 +1,6 @@
+ NAME=asciinema
+ VERSION=$(shell grep 'const Version' main.go | awk -F '"' '{print $$2}')
+-COMMIT=$(shell git rev-parse --short HEAD)
++COMMIT=1.1.1
+ DIRS=bin
+ INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
+@@ -14,8 +14,8 @@
+ all: build
+-build: test
+-      go build -o bin/asciinema -ldflags "-X main.GitCommit $(COMMIT)"
++build:
++      go build -o bin/asciinema -ldflags "-extldflags=-pie -X main.GitCommit $(COMMIT)"
+ test:
+       go test ./...
diff --git a/packages/asciinema/build.sh b/packages/asciinema/build.sh
new file mode 100644 (file)
index 0000000..d351880
--- /dev/null
@@ -0,0 +1,35 @@
+TERMUX_PKG_HOMEPAGE=https://asciinema.org/
+TERMUX_PKG_DESCRIPTION="Record and share your terminal sessions, the right way"
+TERMUX_PKG_VERSION=1.1.1
+TERMUX_PKG_SRCURL=https://github.com/asciinema/asciinema/archive/v${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_FOLDERNAME=asciinema-${TERMUX_PKG_VERSION}
+TERMUX_PKG_BUILD_IN_SRC=yes
+
+termux_step_make () {
+       export GOOS=android
+       export GO_LDFLAGS="-extldflags=-pie"
+       export CGO_ENABLED=1
+       if [ "$TERMUX_ARCH" = "arm" ]; then
+               export GOARCH=arm
+               export GOARM=7
+       elif [ "$TERMUX_ARCH" = "i686" ]; then
+               export GOARCH=386
+               export GO386=sse2
+       else
+               echo "ERROR: Unsupported arch: $TERMUX_ARCH"
+               exit 1
+       fi
+
+       export GOPATH=$TERMUX_PKG_TMPDIR
+       cd $GOPATH
+       mkdir -p src/github.com/asciinema/asciinema/
+       cp -Rf $TERMUX_PKG_SRCDIR/* src/github.com/asciinema/asciinema/
+}
+
+termux_step_make_install () {
+       cd $GOPATH/src/github.com/asciinema/asciinema
+       export GOROOT=$HOME/lib/go/
+       export PATH=$PATH:$GOROOT/bin/
+       PREFIX=$TERMUX_PREFIX make build
+       PREFIX=$TERMUX_PREFIX make install
+}
diff --git a/packages/asciinema/commands-rec.go.patch b/packages/asciinema/commands-rec.go.patch
new file mode 100644 (file)
index 0000000..8c99a45
--- /dev/null
@@ -0,0 +1,12 @@
+diff -u -r ../asciinema-1.1.1/commands/rec.go ./commands/rec.go
+--- ../asciinema-1.1.1/commands/rec.go 2015-06-21 17:58:14.000000000 +0200
++++ ./commands/rec.go  2015-08-20 01:45:49.000000000 +0200
+@@ -69,7 +69,7 @@
+ }
+ func tmpPath() (string, error) {
+-      file, err := ioutil.TempFile("", "asciicast-")
++      file, err := ioutil.TempFile("@TERMUX_PREFIX@/tmp", "asciicast-")
+       if err != nil {
+               return "", err
+       }
diff --git a/packages/asciinema/util-cfg.go.patch b/packages/asciinema/util-cfg.go.patch
new file mode 100644 (file)
index 0000000..9aaece6
--- /dev/null
@@ -0,0 +1,12 @@
+diff -u -r ../asciinema-1.1.1/util/cfg.go ./util/cfg.go
+--- ../asciinema-1.1.1/util/cfg.go     2015-06-21 17:58:14.000000000 +0200
++++ ./util/cfg.go      2015-08-20 01:47:50.000000000 +0200
+@@ -13,7 +13,7 @@
+ const (
+       DefaultAPIURL  = "https://asciinema.org"
+-      DefaultCommand = "/bin/sh"
++      DefaultCommand = "@TERMUX_PREFIX@/bin/bash"
+ )
+ type ConfigAPI struct {