2019-05-11 17:27:56 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://gitea.io
|
|
|
|
TERMUX_PKG_DESCRIPTION="Git with a cup of tea, painless self-hosted git service"
|
|
|
|
TERMUX_PKG_LICENSE="MIT"
|
2022-01-31 19:18:51 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2022-03-24 07:19:15 +01:00
|
|
|
TERMUX_PKG_VERSION=1.16.5
|
2019-05-11 17:27:56 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/go-gitea/gitea/archive/v$TERMUX_PKG_VERSION.tar.gz
|
2022-03-24 07:19:15 +01:00
|
|
|
TERMUX_PKG_SHA256=ff21873f62028ac22618c36df46608bdfc1a70fba2786ab1e5033110aa8d6e3d
|
2022-03-01 09:04:10 +01:00
|
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
2019-05-11 17:27:56 +02:00
|
|
|
TERMUX_PKG_DEPENDS="dash, git"
|
2019-12-31 16:38:52 +01:00
|
|
|
TERMUX_PKG_CONFFILES="etc/gitea/app.ini"
|
2019-05-11 17:27:56 +02:00
|
|
|
|
2022-03-01 09:04:10 +01:00
|
|
|
termux_step_pre_configure() {
|
|
|
|
termux_setup_nodejs
|
2019-05-11 17:27:56 +02:00
|
|
|
termux_setup_golang
|
2022-03-01 09:04:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make() {
|
2019-05-11 17:27:56 +02:00
|
|
|
export GOPATH=$TERMUX_PKG_BUILDDIR
|
|
|
|
|
|
|
|
mkdir -p "$GOPATH"/src/code.gitea.io
|
|
|
|
cp -a "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/code.gitea.io/gitea
|
|
|
|
cd "$GOPATH"/src/code.gitea.io/gitea
|
|
|
|
|
2022-03-03 06:58:23 +01:00
|
|
|
go mod init || :
|
|
|
|
go mod tidy
|
|
|
|
|
|
|
|
# Effectively a backport of https://github.com/lib/pq/commit/6a102c04ac8dc082f1684b0488275575c374cb4c.
|
|
|
|
for f in "$GOPATH"/pkg/mod/github.com/lib/pq@*/user_posix.go; do
|
|
|
|
chmod 0755 "$(dirname "$f")"
|
|
|
|
chmod 0644 "$f"
|
|
|
|
sed -i '/^\/\/ +build /s/ linux / linux,!android /g' "$f"
|
|
|
|
done
|
|
|
|
|
2020-02-17 17:38:11 +01:00
|
|
|
LDFLAGS=""
|
|
|
|
LDFLAGS+=" -X code.gitea.io/gitea/modules/setting.CustomConf=$TERMUX_PREFIX/etc/gitea/app.ini"
|
|
|
|
LDFLAGS+=" -X code.gitea.io/gitea/modules/setting.AppWorkPath=$TERMUX_PREFIX/var/lib/gitea"
|
|
|
|
LDFLAGS+=" -X code.gitea.io/gitea/modules/setting.CustomPath=$TERMUX_PREFIX/var/lib/gitea"
|
2022-03-03 06:58:23 +01:00
|
|
|
GITEA_VERSION=v"$TERMUX_PKG_VERSION" TAGS="bindata sqlite sqlite_unlock_notify" make all
|
2019-05-11 17:27:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make_install() {
|
|
|
|
install -Dm700 \
|
|
|
|
"$GOPATH"/src/code.gitea.io/gitea/gitea \
|
|
|
|
"$TERMUX_PREFIX"/bin/gitea
|
|
|
|
|
|
|
|
mkdir -p "$TERMUX_PREFIX"/etc/gitea
|
|
|
|
sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" \
|
|
|
|
"$TERMUX_PKG_BUILDER_DIR"/app.ini > "$TERMUX_PREFIX"/etc/gitea/app.ini
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_post_massage() {
|
2019-12-31 16:38:52 +01:00
|
|
|
mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"/var/lib/gitea
|
2019-05-11 17:27:56 +02:00
|
|
|
mkdir -p "$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX"/var/log/gitea
|
|
|
|
}
|