Skip to content

Commit

Permalink
addpkg(main/teldrive): 1.6.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 11, 2025
1 parent 60a509a commit 84d3a70
Showing 1 changed file with 34 additions and 0 deletions.
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
}

0 comments on commit 84d3a70

Please sign in to comment.