Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(main/telegram-bot-api): Switch to tag version control #21067

Closed
wants to merge 1 commit into from
Closed
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
47 changes: 10 additions & 37 deletions packages/telegram-bot-api/build.sh
Original file line number Diff line number Diff line change
@@ -1,44 +1,17 @@
TERMUX_PKG_HOMEPAGE=https://github.com/tdlib/telegram-bot-api
TERMUX_PKG_HOMEPAGE=https://core.telegram.org/bots
TERMUX_PKG_DESCRIPTION="Telegram Bot API server"
TERMUX_PKG_LICENSE="BSL-1.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_SRCURL=git+https://github.com/tdlib/telegram-bot-api
_COMMIT=12bbe26692b8c6e347aaf3e32e0e9d11b86bb56d
_COMMIT_DATE=2024.07.30
TERMUX_PKG_VERSION=${_COMMIT_DATE//./}
TERMUX_PKG_SHA256=6c0dddef10c0e1050a0f9840895d71830a867bb1932cd150d1d56b1e9510fc18
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_GIT_BRANCH=master
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_MAINTAINER="Maria Lisina @Sarisan"
TERMUX_PKG_VERSION="1:7.8"
TERMUX_PKG_SRCURL=https://github.com/Sarisan/telegram-bot-api/archive/refs/tags/v${TERMUX_PKG_VERSION#*:}.tar.gz
TERMUX_PKG_SHA256=07c4ed2404c4648446104ffe6aad988dd30bb0ac0256e6f43bf616103e49be42
TERMUX_PKG_DEPENDS="libc++, openssl, zlib"

termux_step_get_source() {
rm -rf $TERMUX_PKG_SRCDIR
mkdir -p $TERMUX_PKG_SRCDIR
cd $TERMUX_PKG_SRCDIR
git clone --depth 1 --branch ${TERMUX_PKG_GIT_BRANCH} \
${TERMUX_PKG_SRCURL#git+} .
git fetch --unshallow
git checkout $_COMMIT
git submodule update --init --recursive --depth=1
}

termux_step_post_get_source() {
local version="$(git log -1 --format=%cs | sed 's/-//g')"
if [ "$version" != "$TERMUX_PKG_VERSION" ]; then
echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\""
echo " is different from what is expected to be: \"$version\""
return 1
fi

local s=$(find . -type f ! -path '*/.git/*' -print0 | xargs -0 sha256sum | LC_ALL=C sort | sha256sum)
if [[ "${s}" != "${TERMUX_PKG_SHA256} "* ]]; then
termux_error_exit "Checksum mismatch for source files."
fi
}
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_AUTO_UPDATE=true

termux_step_host_build() {
termux_setup_cmake
cmake "-DCMAKE_BUILD_TYPE=Release" "$TERMUX_PKG_SRCDIR"
cmake --build . --target prepare_cross_compiling

cmake -S $TERMUX_PKG_SRCDIR -B $TERMUX_PKG_HOSTBUILD_DIR -DCMAKE_BUILD_TYPE=Release
cmake --build $TERMUX_PKG_HOSTBUILD_DIR --target prepare_cross_compiling
}