termux-packages/packages/gbt/build.sh

28 lines
1.0 KiB
Bash
Raw Normal View History

2018-01-15 00:16:11 +01:00
TERMUX_PKG_HOMEPAGE=https://github.com/jtyr/gbt
TERMUX_PKG_DESCRIPTION="Highly configurable prompt builder for Bash and ZSH written in Go"
2019-01-21 13:53:58 +01:00
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
2019-08-01 03:03:19 +02:00
TERMUX_PKG_VERSION=2.0.0
2021-05-16 11:16:18 +02:00
TERMUX_PKG_REVISION=3
2018-01-15 00:16:11 +01:00
TERMUX_PKG_SRCURL=https://github.com/jtyr/gbt/archive/v${TERMUX_PKG_VERSION}.tar.gz
2019-08-01 03:03:19 +02:00
TERMUX_PKG_SHA256=b324695dc432e8e22bc257f7a6ec576f482ec418fb9c9a8301f47bfdf7766998
_COMMIT=29dc3dac6c06518073a8e879d2b6ec65291ddab2
2018-01-15 00:16:11 +01:00
termux_step_make_install() {
cd $TERMUX_PKG_SRCDIR
termux_setup_golang
export GOPATH=$HOME/go
mkdir -p $GOPATH/{bin,pkg,src/github.com/jtyr}
ln -fs $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/jtyr/gbt
2021-05-16 11:16:18 +02:00
go mod init gbt
go mod tidy
2019-08-01 03:03:19 +02:00
go build -ldflags="-s -w -X main.version=$TERMUX_PKG_VERSION -X main.build=${_COMMIT::6}" -o $TERMUX_PREFIX/bin/gbt github.com/jtyr/gbt/cmd/gbt
2018-01-15 00:16:11 +01:00
mkdir -p $TERMUX_PREFIX/{doc/gbt,share/gbt}
cp -r $TERMUX_PKG_SRCDIR/{sources,themes} $TERMUX_PREFIX/share/gbt/
cp -r $TERMUX_PKG_SRCDIR/{LICENSE,README.md} $TERMUX_PREFIX/doc/gbt/
}