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

bump|addpkg(main/{termux-core,termux-exec,tudo,sudo}) for android-5 #22629

Open
wants to merge 14 commits into
base: android-5
Choose a base branch
from
Open
Show file tree
Hide file tree
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
39 changes: 35 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
### Vim ###
# Vim
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
/debs/
### Vagrant ###
scripts/*.log

# Vagrant
scripts/.vagrant/

# Logs
scripts/*.log
/*.log

# Misc archives
/*\.deb
/*\.zip
/*\.tar
/*\.tar\.*

# Source files.
/sources/

# GitHub Actions build artifacts
debs*
checksum*

# Built *.deb files.
/debs/
/output/

# Preinstalled build tools.
/build-tools/

# Predownloaded packages sources.
/packages/*/cache
/root-packages/*/cache
/x11-packages/*/cache

# Temp .git directories for packages built from local sources "file://"
/*.git
49 changes: 43 additions & 6 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# clean.sh - clean everything.
set -e -u

Expand Down Expand Up @@ -38,10 +38,47 @@ fi
chmod +w -R "$TERMUX_TOPDIR"
fi

if $TERMUX_ON_DEVICE_BUILD; then
# For on-device build cleanup /data shouldn't be erased.
rm -Rf "$TERMUX_TOPDIR"
else
rm -Rf /data/* "$TERMUX_TOPDIR"
# For on-device build cleanup Termux app data directory shouldn't be erased.
if [[ "$TERMUX_ON_DEVICE_BUILD" == "false" ]]; then
for variable_name in TERMUX__PREFIX TERMUX_APP__DATA_DIR; do
variable_value="${!variable_name:-}"
if [[ ! "$variable_value" =~ ^(/[^/]+)+$ ]]; then
echo "The $variable_name '$variable_value' is not an absolute path under rootfs '/' while running 'clean.sh'." 1>&2
exit 1
fi
done

# If `TERMUX__PREFIX` is under `TERMUX_APP__DATA_DIR`, then
# just delete the entire `TERMUX_APP__DATA_DIR`. Otherwise,
# only delete `TERMUX__PREFIX` since its parent directories could
# be a critical directory in `TERMUX_REGEX__INVALID_TERMUX_PREFIX_PATHS`.
# This should not be an issue as package files are only packed
# from `TERMUX_PREFIX` via `termux_step_extract_into_massagedir()`.
if [[ "$TERMUX__PREFIX" == "$TERMUX_APP__DATA_DIR" ]] || \
[[ "$TERMUX__PREFIX" == "$TERMUX_APP__DATA_DIR/"* ]]; then
deletion_dir="$TERMUX_APP__DATA_DIR"
else
deletion_dir="$TERMUX__PREFIX"
fi

if [[ -e "$deletion_dir" ]]; then
if [[ ! -d "$deletion_dir" ]]; then
echo "A non-directory file exists at deletion directory '$deletion_dir' for TERMUX__PREFIX while running 'clean.sh'." 1>&2
exit 1
fi

# If deletion directory is under rootfs `/` or not accessible
# by current user, like the `builder` user in Termux docker
# cannot access root owned directories.
if [[ ! -r "$deletion_dir" ]] || [[ ! -w "$deletion_dir" ]] || [[ ! -x "$deletion_dir" ]]; then
echo "The deletion directory '$deletion_dir' for TERMUX__PREFIX is not readable, writable or searchable while running 'clean.sh'." 1>&2
echo "Try running 'clean.sh' with 'sudo'." 1>&2
exit 1
fi

find "$deletion_dir" -mindepth 1 -delete 2>/dev/null || true
fi
fi

rm -Rf "$TERMUX_TOPDIR"
} 5< "$TERMUX_BUILD_LOCK_FILE"
31 changes: 31 additions & 0 deletions packages/sudo/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
TERMUX_PKG_HOMEPAGE=https://github.com/agnostic-apollo/sudo
TERMUX_PKG_DESCRIPTION="A wrapper script to drop to the supported shells or execute shell script files or their text passed as an argument as the root (superuser) user in the Termux app"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@agnostic-apollo"
TERMUX_PKG_VERSION=1.0.0

# FIXME: Fix urls
TERMUX_PKG_SRCURL=file:///home/builder/termux-packages/sources/sudo
TERMUX_PKG_SHA256=SKIP_CHECKSUM

#TERMUX_PKG_SRCURL=https://github.com/agnostic-apollo/sudo/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
#TERMUX_PKG_SHA256=xxx

TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
TERMUX_PKG_CONFLICTS="tsu"
TERMUX_PKG_REPLACES="tsu"
TERMUX_PKG_EXTRA_MAKE_ARGS="SUDO_PKG__VERSION=${TERMUX_PKG_VERSION} SUDO_PKG__ARCH=${TERMUX_ARCH} \
TERMUX__NAME=${TERMUX__NAME} TERMUX__LNAME=${TERMUX__LNAME} \
TERMUX_APP__NAME=${TERMUX_APP__NAME} TERMUX_APP__PACKAGE_NAME=${TERMUX_APP__PACKAGE_NAME} \
TERMUX__ROOTFS=${TERMUX__ROOTFS} TERMUX__HOME=${TERMUX__HOME} TERMUX__PREFIX=${TERMUX__PREFIX} \
TERMUX_ENV__S_ROOT=${TERMUX_ENV__S_ROOT} \
TERMUX_ENV__SS_TERMUX=${TERMUX_ENV__SS_TERMUX} TERMUX_ENV__S_TERMUX=${TERMUX_ENV__S_TERMUX} \
TERMUX_ENV__SS_TERMUX_APP=${TERMUX_ENV__SS_TERMUX_APP} TERMUX_ENV__S_TERMUX_APP=${TERMUX_ENV__S_TERMUX_APP}"

termux_step_install_license() {
mkdir -p "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/licenses"
mv "$TERMUX_PKG_SRCDIR/LICENSE" "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/copyright"
mv "$TERMUX_PKG_SRCDIR/licenses/"* "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/licenses/"
}
16 changes: 14 additions & 2 deletions packages/termux-am-socket/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-am-socket
TERMUX_PKG_DESCRIPTION="A faster version of am with less features that only works while Termux is running"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.3.0
TERMUX_PKG_VERSION=1.5.0
TERMUX_PKG_SRCURL=https://github.com/termux/termux-am-socket/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=a0ac6f1733b0545b0a71de60615b6d4f781fb9e018d1841160308ed992c77997
TERMUX_PKG_SHA256=5175023c7fd675492451a72d06b75c772f257685b69fe117227bae5a5e6f5494
TERMUX_PKG_DEPENDS="libc++"

termux_step_post_get_source() {

for file in "${TERMUX_PKG_SRCDIR}/"*; do
sed -i'' -E -e "s|^(TERMUX_AM_SOCKET_VERSION=).*|\1$TERMUX_PKG_FULLVERSION|" \
-e "s|\@TERMUX_APP_PACKAGE\@|${TERMUX_APP_PACKAGE}|g" \
-e "s|\@TERMUX_APPS_DIR\@|${TERMUX_APPS_DIR}|g" \
"$file"
done

}
35 changes: 35 additions & 0 deletions packages/termux-core/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-core-package
TERMUX_PKG_DESCRIPTION="Utils for Termux core"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.1.0

# FIXME: Fix urls
TERMUX_PKG_SRCURL=file:///home/builder/termux-packages/sources/termux-core-package
TERMUX_PKG_SHA256=SKIP_CHECKSUM

#TERMUX_PKG_SRCURL=https://github.com/termux/termux-core-package/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
#TERMUX_PKG_SHA256=xxx

# FIXME: uncomment
#TERMUX_PKG_ESSENTIAL=true
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
TERMUX_PKG_EXTRA_MAKE_ARGS="TERMUX_CORE_PKG__VERSION=${TERMUX_PKG_VERSION} TERMUX_CORE_PKG__ARCH=${TERMUX_ARCH} \
TERMUX__NAME=${TERMUX__NAME} TERMUX__LNAME=${TERMUX__LNAME} \
TERMUX__REPOS_HOST_ORG_NAME=${TERMUX__REPOS_HOST_ORG_NAME} TERMUX__REPOS_HOST_ORG_URL=${TERMUX__REPOS_HOST_ORG_URL} \
TERMUX_APP__PACKAGE_NAME=${TERMUX_APP__PACKAGE_NAME} TERMUX_APP__DATA_DIR=${TERMUX_APP__DATA_DIR} \
TERMUX__ROOTFS=${TERMUX__ROOTFS} TERMUX__HOME=${TERMUX__HOME} TERMUX__PREFIX=${TERMUX__PREFIX} \
TERMUX_ENV__S_ROOT=${TERMUX_ENV__S_ROOT} \
TERMUX_ENV__SS_TERMUX=${TERMUX_ENV__SS_TERMUX} TERMUX_ENV__S_TERMUX=${TERMUX_ENV__S_TERMUX} \
TERMUX_ENV__SS_TERMUX_APP=${TERMUX_ENV__SS_TERMUX_APP} TERMUX_ENV__S_TERMUX_APP=${TERMUX_ENV__S_TERMUX_APP} \
TERMUX_ENV__SS_TERMUX_CORE__TESTS=${TERMUX_ENV__SS_TERMUX_CORE__TESTS} TERMUX_ENV__S_TERMUX_CORE__TESTS=${TERMUX_ENV__S_TERMUX_CORE__TESTS} \
TERMUX_PKGS__REPO_NAME=${TERMUX_PKGS__REPO_NAME} TERMUX_PKGS__REPO_URL=${TERMUX_PKGS__REPO_URL} \
TERMUX_PKGS__BUILD__REPO_ROOT_DIR=${TERMUX_PKGS__BUILD__REPO_ROOT_DIR} \
TERMUX_CORE_PKG__REPO_NAME=${TERMUX_CORE_PKG__REPO_NAME} TERMUX_CORE_PKG__REPO_URL=${TERMUX_CORE_PKG__REPO_URL}"

termux_step_install_license() {
mkdir -p "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/licenses"
mv "$TERMUX_PKG_SRCDIR/LICENSE" "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/copyright"
mv "$TERMUX_PKG_SRCDIR/licenses/"* "$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/licenses/"
}
Loading