diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d9433f2..434e7fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,37 @@ stages: + - image - build - publish +# 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: + 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" + - docker push "$CI_REGISTRY_IMAGE/package-builder:$CI_COMMIT_SHA" + build-packages: - 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 diff --git a/README.md b/README.md index 2539fda..53080c7 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Where `` 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 : diff --git a/build.sh b/build.sh index 32917c4..df9215b 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/common.sh b/common.sh index b670572..66eac40 100644 --- a/common.sh +++ b/common.sh @@ -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" export COTG_PACKAGE_NAME # Path to the public key @@ -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 diff --git a/generate-bootstrap-archive.sh b/generate-bootstrap-archive.sh index f23d02b..3955d08 100755 --- a/generate-bootstrap-archive.sh +++ b/generate-bootstrap-archive.sh @@ -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" + COTG_VARIANT="debug" declare -a COTG_EXTRA_PACKAGES diff --git a/patches/dos2unix-use-sourceforge-mirror.patch b/patches/dos2unix-use-sourceforge-mirror.patch new file mode 100644 index 0000000..d2d285b --- /dev/null +++ b/patches/dos2unix-use-sourceforge-mirror.patch @@ -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" diff --git a/patches/foot-update-source-checksum.patch b/patches/foot-update-source-checksum.patch new file mode 100644 index 0000000..c692d8c --- /dev/null +++ b/patches/foot-update-source-checksum.patch @@ -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 + 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" diff --git a/patches/moved-source-urls.patch b/patches/moved-source-urls.patch new file mode 100644 index 0000000..bf02e39 --- /dev/null +++ b/patches/moved-source-urls.patch @@ -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" diff --git a/utils.sh b/utils.sh index a273fbd..768bd83 100644 --- a/utils.sh +++ b/utils.sh @@ -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 }