mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2025-12-27 22:20:31 +00:00
56 lines
1.9 KiB
Bash
56 lines
1.9 KiB
Bash
TERMUX_PKG_HOMEPAGE=https://algernon.roboticoverlords.org/
|
|
TERMUX_PKG_DESCRIPTION="Small self-contained web server with Lua, Markdown, QUIC, Redis and PostgreSQL support"
|
|
TERMUX_PKG_LICENSE="BSD 3-Clause"
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
|
_COMMIT=3d7448c5211ce33de0dbed186689146e497dc405
|
|
_COMMIT_DATE=20230301
|
|
TERMUX_PKG_VERSION=1.14.0-p${_COMMIT_DATE}
|
|
TERMUX_PKG_REVISION=1
|
|
#TERMUX_PKG_SRCURL="https://github.com/xyproto/algernon/archive/v${TERMUX_PKG_VERSION}.tar.gz"
|
|
TERMUX_PKG_SRCURL=git+https://github.com/xyproto/algernon
|
|
TERMUX_PKG_SHA256=5ed11b7371d8a8be3c62bbf234e18228d920f1c0dc28da33daf6a0f9b316fa3d
|
|
TERMUX_PKG_GIT_BRANCH=main
|
|
TERMUX_PKG_AUTO_UPDATE=false
|
|
|
|
termux_step_post_get_source() {
|
|
git fetch --unshallow
|
|
git checkout $_COMMIT
|
|
|
|
local pdate="p$(git log -1 --format=%cs | sed 's/-//g')"
|
|
if [[ "$TERMUX_PKG_VERSION" != *"${pdate}" ]]; then
|
|
echo -n "ERROR: The version string \"$TERMUX_PKG_VERSION\" is"
|
|
echo -n " different from what is expected to be; should end"
|
|
echo " with \"${pdate}\"."
|
|
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_step_make() {
|
|
termux_setup_golang
|
|
|
|
export GOPATH="${TERMUX_PKG_BUILDDIR}"
|
|
mkdir -p "${GOPATH}"/src/github.com/xyproto
|
|
ln -sf "${TERMUX_PKG_SRCDIR}" "${GOPATH}"/src/github.com/xyproto/algernon
|
|
|
|
cd "${GOPATH}"/src/github.com/xyproto/algernon || exit 1
|
|
|
|
go build
|
|
}
|
|
|
|
termux_step_make_install() {
|
|
install -Dm700 \
|
|
"${GOPATH}"/src/github.com/xyproto/algernon/algernon \
|
|
"${TERMUX_PREFIX}"/bin/
|
|
|
|
# Offline samples may be useful to get started with Algernon.
|
|
rm -rf "${TERMUX_PREFIX}"/share/doc/algernon
|
|
mkdir -p "${TERMUX_PREFIX}"/share/doc/algernon
|
|
cp -a "${GOPATH}"/src/github.com/xyproto/algernon/samples \
|
|
"${TERMUX_PREFIX}"/share/doc/algernon/
|
|
}
|