termux-packages/packages/btfs2/build.sh

39 lines
1.3 KiB
Bash
Raw Normal View History

2022-01-18 05:17:22 +01:00
TERMUX_PKG_HOMEPAGE=https://www.bittorrent.com/btfs/
TERMUX_PKG_DESCRIPTION="Decentralized file system integrating with TRON network and Bittorrent network"
TERMUX_PKG_LICENSE="Apache-2.0, MIT"
TERMUX_PKG_LICENSE_FILE="LICENSE-APACHE, LICENSE-MIT"
TERMUX_PKG_MAINTAINER="Simbad Marino <cctechmx@gmail.com>"
TERMUX_PKG_VERSION="2.1.2"
2022-01-18 05:17:22 +01:00
TERMUX_PKG_SRCURL=https://github.com/bittorrent/go-btfs/archive/refs/tags/btfs-v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=9e7bdea2bb291235ebdbe932a620cd33c20baa5654680ee6b2e5fe9c1a5afb99
2022-01-18 05:17:22 +01:00
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_UPDATE_VERSION_REGEXP="\d+\.\d+\.\d+"
2022-01-18 05:17:22 +01:00
TERMUX_PKG_BUILD_IN_SRC=true
2022-02-21 10:08:39 +01:00
TERMUX_PKG_CONFLICTS="btfs"
TERMUX_PKG_REPLACES="btfs"
2022-01-18 05:17:22 +01:00
2022-02-11 07:49:24 +01:00
termux_step_pre_configure() {
2022-01-18 05:17:22 +01:00
termux_setup_golang
go mod init || :
go mod tidy
# Please do not ever disable CGO:
# https://github.com/termux/termux-packages/issues/9094
local _GOPATH=$(go env GOPATH)
pushd $_GOPATH/pkg/mod/github.com/karalabe/usb@*
local target=hidapi/libusb/hid.c
chmod 0755 $(dirname $target)
chmod 0644 $target
2022-03-08 01:50:50 +01:00
patch -p1 < $TERMUX_PKG_BUILDER_DIR/karalabe-usb-pthread_barrier.patch.diff || :
popd
2022-02-11 07:49:24 +01:00
}
termux_step_make() {
2022-01-18 05:17:22 +01:00
make build
}
termux_step_make_install() {
2022-02-21 10:08:39 +01:00
install -Dm700 -t $TERMUX_PREFIX/bin $TERMUX_PKG_SRCDIR/cmd/btfs/btfs
ln -sfT btfs $TERMUX_PREFIX/bin/btfs2
2022-01-18 05:17:22 +01:00
}