add(main): new package hcloud

This commit is contained in:
Confundo 2022-07-29 00:11:08 +02:00 committed by Uchiha Kakashi
parent 4685eecb9b
commit 111363b541
1 changed files with 27 additions and 0 deletions

27
packages/hcloud/build.sh Normal file
View File

@ -0,0 +1,27 @@
TERMUX_PKG_HOMEPAGE=https://github.com/hetznercloud/cli
TERMUX_PKG_DESCRIPTION="Hetzner Cloud command line client"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.30.1"
TERMUX_PKG_SRCURL=https://github.com/hetznercloud/cli/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=6530f5b2e90fbc74ea7b91da283840d08138b361166fc0eba3e9723313a712d6
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
termux_step_pre_configure() {
termux_setup_golang
go mod init || :
go mod tidy
}
termux_step_make() {
# Below are taken from github.com/hetznercloud/cli@v1.30.1/.goreleaser.yml
local CGO_ENABLED=0
local LD_FLAGS="-s -w -X 'github.com/hetznercloud/cli/internal/version.Version=v${TERMUX_PKG_VERSION}'"
go build -ldflags "${LD_FLAGS}" -o hcloud cmd/hcloud/main.go
}
termux_step_make_install() {
install -Dm700 -t $TERMUX_PREFIX/bin hcloud
}