Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

addpkg(main/teldrive): 1.6.12 #23157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions packages/teldrive/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
TERMUX_PKG_HOMEPAGE=https://github.com/tgdrive/teldrive
TERMUX_PKG_DESCRIPTION="A high-speed Telegram file management utility"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.6.12"
TERMUX_PKG_SRCURL=https://github.com/tgdrive/teldrive/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=dbde2663622f2a5c2e21975649e4e00531d4d0d8511932ac5c1f4ea220a82437
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_HOSTBUILD=true

termux_step_host_build() {
termux_setup_nodejs
git clone https://github.com/tgdrive/teldrive-ui && cd teldrive-ui
npm install
npm run build
termux_setup_golang
pushd "${TERMUX_PKG_SRCDIR}"
go generate ./...
popd
}

termux_step_pre_configure() {
cp -r $TERMUX_PKG_HOSTBUILD_DIR/teldrive-ui/dist $TERMUX_PKG_SRCDIR/ui/
rm -rf $TERMUX_PKG_HOSTBUILD_DIR/teldrive-ui/dist
}

termux_step_make() {
go build -o teldrive -trimpath -ldflags="-s -w"
}

termux_step_make_install() {
install -Dm700 -t "${TERMUX_PREFIX}"/bin "$TERMUX_PKG_SRCDIR"/teldrive
}