2018-07-01 23:28:36 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://ipfs.io/
|
2018-06-28 16:44:31 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="A peer-to-peer hypermedia distribution protocol"
|
2019-01-21 13:53:58 +01:00
|
|
|
TERMUX_PKG_LICENSE="MIT"
|
2020-05-13 10:01:25 +02:00
|
|
|
TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>"
|
2021-07-22 14:50:42 +02:00
|
|
|
TERMUX_PKG_VERSION=0.9.1
|
2020-01-30 19:48:26 +01:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/ipfs/go-ipfs/releases/download/v${TERMUX_PKG_VERSION}/go-ipfs-source.tar.gz
|
2021-07-22 14:50:42 +02:00
|
|
|
TERMUX_PKG_SHA256=4658b2204b4d830cdb2d5c25e93dfc5486e1735d8264c05cdcb67a4ff9656877
|
2021-02-20 12:22:05 +01:00
|
|
|
TERMUX_PKG_SUGGESTS="termux-services"
|
|
|
|
TERMUX_PKG_SERVICE_SCRIPT=("ipfs" '[ ! -d "${HOME}/.ipfs" ] && ipfs init --empty-repo 2>&1 && ipfs config --json Swarm.EnableRelayHop false 2>&1 && ipfs config --json Swarm.EnableAutoRelay true 2>&1; exec ipfs daemon --enable-namesys-pubsub 2>&1')
|
2018-06-28 16:44:31 +02:00
|
|
|
|
|
|
|
termux_step_make() {
|
2020-05-09 13:09:43 +02:00
|
|
|
termux_setup_golang
|
2018-06-28 16:44:31 +02:00
|
|
|
|
2020-05-09 13:09:43 +02:00
|
|
|
export GOPATH=${TERMUX_PKG_BUILDDIR}
|
|
|
|
export GOARCH=${TERMUX_ARCH}
|
2018-06-28 16:44:31 +02:00
|
|
|
|
2020-05-09 13:09:43 +02:00
|
|
|
if [ "${TERMUX_ARCH}" = "aarch64" ]; then
|
|
|
|
GOARCH="arm64"
|
|
|
|
elif [ "${TERMUX_ARCH}" = "i686" ]; then
|
|
|
|
GOARCH="386"
|
|
|
|
elif [ "${TERMUX_ARCH}" = "x86_64" ]; then
|
|
|
|
GOARCH="amd64"
|
|
|
|
fi
|
2018-06-28 16:44:31 +02:00
|
|
|
|
2020-05-09 13:09:43 +02:00
|
|
|
mkdir -p "${GOPATH}/src/github.com/ipfs"
|
|
|
|
cp -a "${TERMUX_PKG_SRCDIR}" "${GOPATH}/src/github.com/ipfs/go-ipfs"
|
|
|
|
cd "${GOPATH}/src/github.com/ipfs/go-ipfs"
|
2021-07-10 16:00:18 +02:00
|
|
|
|
2020-05-09 13:09:43 +02:00
|
|
|
make build
|
2019-04-17 23:57:24 +02:00
|
|
|
|
2020-05-09 13:09:43 +02:00
|
|
|
# Fix folders without write permissions preventing which fails repeating builds:
|
|
|
|
cd $TERMUX_PKG_BUILDDIR
|
|
|
|
find . -type d -exec chmod u+w {} \;
|
2018-06-28 16:44:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make_install() {
|
2020-05-09 13:09:43 +02:00
|
|
|
install -Dm700 -t "$TERMUX_PREFIX"/bin "${TERMUX_PKG_BUILDDIR}/src/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs"
|
2018-06-28 16:44:31 +02:00
|
|
|
}
|