Skip to content
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
29 changes: 28 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
stages:
- image
- build
- publish

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: publish-packages still pushes to Scribe's GitLab repository, not to the codeonthego-main repository this PR points COTG_REPO at.

The job, outside this diff, clones scribe-oss/core/scribe-packages-repo and commits as "Scribe CI". Once CI is wired up, a green pipeline would publish the CoGo packages there and leave packages.appdevforall.org/apt/codeonthego-main empty, so apt inside the app finds nothing. No pipeline runs today, but it contradicts the description's claim that the config is now correct.

Fix: point the publish job at the CoGo package host, or remove it until CI is wired up.


# ghcr.io/termux/package-builder only publishes :latest, which tracks the newest
# termux-packages and drifts from our pinned submodule (e.g. NDK r30 vs r29,
# python3.14 vs python3.12). Build the builder image from the pinned
# submodule's own Dockerfile instead, cached per submodule commit.
builder-image:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NITPICK: builder-image has no runner tag or timeout, unlike build-packages, which pins saas-linux-xlarge-amd64 and 6h.

On a cache miss this job builds the whole package-builder image (Ubuntu, Android SDK, NDK) in docker:dind on GitLab's default runner and default timeout. I couldn't verify whether that fits; the build job's explicit choice suggests it may not.

Fix: give it the same tag and an explicit timeout.

image: docker:27
stage: image
services:
- docker:27-dind
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1
script:
- SUBMODULE_TAG="$(git -C termux-packages rev-parse --short=12 HEAD)"
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- |
if ! docker pull "$CI_REGISTRY_IMAGE/package-builder:$SUBMODULE_TAG"; then
docker build -t "$CI_REGISTRY_IMAGE/package-builder:$SUBMODULE_TAG" termux-packages/scripts
docker push "$CI_REGISTRY_IMAGE/package-builder:$SUBMODULE_TAG"
fi
# job images can't use runtime variables, so also tag with the pipeline's commit
- docker tag "$CI_REGISTRY_IMAGE/package-builder:$SUBMODULE_TAG" "$CI_REGISTRY_IMAGE/package-builder:$CI_COMMIT_SHA"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NITPICK: On a cache hit, every pipeline still pulls the full builder image only to add a per-commit tag, and those tags are never cleaned up.

Each pipeline spends minutes and runner disk on a multi-GB docker pull, and the registry gains one tag per commit.

Fix: retag at the manifest level (docker buildx imagetools create -t ...:$CI_COMMIT_SHA ...:$SUBMODULE_TAG) and add a cleanup policy for the per-commit tags.

- docker push "$CI_REGISTRY_IMAGE/package-builder:$CI_COMMIT_SHA"

build-packages:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: The build matrix still lists x86_64, which build.sh rejects, so this config still can't produce a full build.

The defect is at .gitlab-ci.yml:44, outside this diff. common.sh only allows aarch64 and arm, so build-packages [x86_64] exits at build.sh:222 with "Unsupported arch", arm is never built, and publish-packages, which needs every build job, never runs. No pipeline runs for this repo today, so nothing hits it yet, but the description says b899e1d makes this config correct.

Fix: change the matrix, and ARCHS in the publish job, to aarch64 and arm, or narrow the claim in the description.

image: ghcr.io/termux/package-builder:latest
image: $CI_REGISTRY_IMAGE/package-builder:$CI_COMMIT_SHA
stage: build
needs:
- job: builder-image
timeout: 6h
tags:
- saas-linux-xlarge-amd64
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Where `<secret-key-id>` is the ID of the GPG secret key to be used for signing.

After signing, the contents of the `output/repo` directory can be published to a web hosting service or a S3-compatible storage server. Ensure that the directory structure is same as the repository URL.

For example, if the repository URL is `https://packages.appdevforall.org/apt/termux-main`, then the contents of the `output/repo` directory must be stored in the `apt/termux-main` directory of `packages.appdevforall.org`'s content root (usually, it's something like `/www/public/html/packages.appdevforall.org` in web hosting environments).
For example, if the repository URL is `https://packages.appdevforall.org/apt/codeonthego-main`, then the contents of the `output/repo` directory must be stored in the `apt/codeonthego-main` directory of `packages.appdevforall.org`'s content root (usually, it's something like `/www/public/html/packages.appdevforall.org` in web hosting environments).

If you have SSH access to the web hosting service, then you can use `rsync` for incremental updates :

Expand Down
15 changes: 15 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ declare -a PATCHES=(
# these keyring files are used when we build packages with the -I flag
# since we use a different signing key, we need to update the reference here
"use-our-keys-to-install-deps.patch"

# Codeberg regenerated foot's 1.25.0 source archive, changing its SHA-256
# (ncurses pulls foot's terminfo from it). Contents are identical to the
# 1.25.0 git tag; only the archive packaging differs.
"foot-update-source-checksum.patch"

# dos2unix's upstream host (XS4ALL homepages) is gone and serves an HTML
# "not found" page. Fetch the identical release tarball from SourceForge;
# the pinned SHA-256 is unchanged.
"dos2unix-use-sourceforge-mirror.patch"

# Upstream moved these releases after termux-packages pinned them (old Apache
# releases go to archive.apache.org; nano's dist/latest and giflib's SF folder
# moved on). Same files - pinned SHA-256s unchanged.
"moved-source-urls.patch"
)

# Script configuration
Expand Down
4 changes: 2 additions & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TERMUX_PACKAGE_NAME="com.termux"
export TERMUX_PACKAGE_NAME

# The package name of the intended application
COTG_PACKAGE_NAME="com.itsaky.androidide"
COTG_PACKAGE_NAME="org.appdevforall.codeonthego"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMPORTANT: On a termux-packages tree that was patched before this change, the new package name, repo URL and the three new patches never take effect.

build.sh:249 skips setup_termux_packages whenever termux-packages/.scribe-patched exists. Even without the marker, the package-name sed only matches com.termux, which the earlier run already rewrote to com.itsaky.androidide. So anyone who built before pulls this, runs ./build.sh -a aarch64, and gets packages with the /data/data/com.itsaky.androidide prefix and termux-main sources, with no error. Those packages don't run under the new app id.

Fix: record the package name, repo URL and patch list in .scribe-patched, and fail (or reset the submodule and re-patch) when they differ from the current config.

export COTG_PACKAGE_NAME

# Path to the public key
Expand All @@ -38,7 +38,7 @@ TERMUX_PKG_API_LEVEL=28
export TERMUX_PKG_API_LEVEL

# The URL of the repository where the packages will be published
COTG_REPO="https://packages.appdevforall.org/apt/termux-main"
COTG_REPO="https://packages.appdevforall.org/apt/codeonthego-main"
export COTG_REPO

# All supported CPU ABIs
Expand Down
4 changes: 4 additions & 0 deletions generate-bootstrap-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ if [[ -z "${COTG_REPO}" ]]; then
scribe_error_exit "A package repository URL must be specified."
fi

# generate-bootstraps.sh repacks the JDK's ct.sym with brotli and does not
# check the result: without brotli it deletes ct.sym and still reports success.
scribe_check_command "brotli"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: The brotli check covers only a missing binary; any other failure while repacking ct.sym still deletes it and reports success.

The defect is in patches/scripts-generate-bootstraps-CoGo-changes.patch, outside this diff: the subshell runs rm "$ctsym" before brotli -Zo, and sits in a ( ... ) && ... list, so its status is that of the final rm ct.sym. A failing unzip, zip or brotli (disk full, corrupt input) still prints "ct.sym repacked", and the bootstrap ships without ct.sym, which breaks javac --release on device. With brotli installed no current run hits this, but the check doesn't close it.

Fix: in the patch, fail the subshell on any step (|| exit 1 per step) and only replace ct.sym once brotli has written a complete file.


COTG_VARIANT="debug"

declare -a COTG_EXTRA_PACKAGES
Expand Down
13 changes: 13 additions & 0 deletions patches/dos2unix-use-sourceforge-mirror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/packages/dos2unix/build.sh b/packages/dos2unix/build.sh
index b4d2fa40..d30052a0 100644
--- a/packages/dos2unix/build.sh
+++ b/packages/dos2unix/build.sh
@@ -5,7 +5,7 @@ TERMUX_PKG_LICENSE_FILE="COPYING.txt"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=7.5.2
TERMUX_PKG_REVISION=1
-TERMUX_PKG_SRCURL=https://waterlan.home.xs4all.nl/dos2unix/dos2unix-${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/dos2unix/dos2unix/${TERMUX_PKG_VERSION}/dos2unix-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=264742446608442eb48f96c20af6da303cb3a92b364e72cb7e24f88239c4bf3a
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_DEPENDS="libandroid-support"
13 changes: 13 additions & 0 deletions patches/foot-update-source-checksum.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/x11-packages/foot/build.sh b/x11-packages/foot/build.sh
index 77969a23..d361311e 100644
--- a/x11-packages/foot/build.sh
+++ b/x11-packages/foot/build.sh
@@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.25.0"
TERMUX_PKG_SRCURL=https://codeberg.org/dnkl/foot/archive/${TERMUX_PKG_VERSION}.tar.gz
-TERMUX_PKG_SHA256=442a42d576ec72dd50f2d3faea8a664230a47bac79dc1eb6e7c9125ee76c130f
+TERMUX_PKG_SHA256=ee9d0e51295945157ecb33119cb2c79b276093d0fd342d959d78d772d505571c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NITPICK: This checksum pins an archive Codeberg generates on demand, and it has already been regenerated once.

The next regeneration breaks foot again, and ncurses, which takes foot's terminfo from the same tarball, with it.

Fix: if foot publishes a release tarball for 1.25.0, point SRCURL there; otherwise say in the patch comment that this checksum may drift again.

TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="libandroid-support, fontconfig, freetype, libfcft, libpixman, libwayland, libxkbcommon, utf8proc"
TERMUX_PKG_BUILD_DEPENDS="libtllist, libwayland-protocols, libwayland-cross-scanner, scdoc, xdg-utils"
39 changes: 39 additions & 0 deletions patches/moved-source-urls.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/packages/apr-util/build.sh b/packages/apr-util/build.sh
index d6fa52a5..0f3e8071 100644
--- a/packages/apr-util/build.sh
+++ b/packages/apr-util/build.sh
@@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.6.3
TERMUX_PKG_REVISION=3
-TERMUX_PKG_SRCURL=https://downloads.apache.org/apr/apr-util-${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_SRCURL=https://archive.apache.org/dist/apr/apr-util-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=2b74d8932703826862ca305b094eef2983c27b39d5c9414442e9976a9acf1983
TERMUX_PKG_DEPENDS="apr, libcrypt, libexpat, libiconv, libuuid"
TERMUX_PKG_BREAKS="apr-util-dev"
diff --git a/packages/giflib/build.sh b/packages/giflib/build.sh
index 99328807..e32835b5 100644
--- a/packages/giflib/build.sh
+++ b/packages/giflib/build.sh
@@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="5.2.2"
TERMUX_PKG_REVISION=1
-TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/giflib/giflib-${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/giflib/giflib-${TERMUX_PKG_VERSION%%.*}.x/giflib-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=be7ffbd057cadebe2aa144542fd90c6838c6a083b5e8a9048b8ee3b66b29d5fb
TERMUX_PKG_BREAKS="giflib-dev"
TERMUX_PKG_REPLACES="giflib-dev"
diff --git a/packages/nano/build.sh b/packages/nano/build.sh
index 646e14b8..b1d3c13a 100644
--- a/packages/nano/build.sh
+++ b/packages/nano/build.sh
@@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Small, free and friendly text editor"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="8.7"
-TERMUX_PKG_SRCURL=https://nano-editor.org/dist/latest/nano-$TERMUX_PKG_VERSION.tar.xz
+TERMUX_PKG_SRCURL=https://nano-editor.org/dist/v${TERMUX_PKG_VERSION%%.*}/nano-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=afd287aa672c48b8e1a93fdb6c6588453d527510d966822b687f2835f0d986e9
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="libandroid-support, ncurses"
2 changes: 1 addition & 1 deletion utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ scribe_check_command() {
fi

if ! [[ "$(command -v "$1")" ]]; then
err "'$1' command is not available in PATH. Please install $1."
scribe_error "'$1' command is not available in PATH. Please install $1."
exit 1
fi
}