Skip to content

Commit

Permalink
bump(main/bionic-host),addpkg(main/{boringssl,iputils,mksh,toybox}-ho…
Browse files Browse the repository at this point in the history
…st): 9.0.0-r76

Dependencies for termux/termux-docker#72
  • Loading branch information
robertkirkman committed Jan 21, 2025
1 parent d27c1e5 commit 29bc357
Show file tree
Hide file tree
Showing 9 changed files with 451 additions and 115 deletions.
8 changes: 8 additions & 0 deletions packages/bionic-host/boringssl-host.subpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# dependency of:
# /system/bin/ping6 (iputils-host)
# /system/bin/md5sum (toybox-host)
TERMUX_SUBPKG_DESCRIPTION="AOSP-based boringssl for termux-docker"
TERMUX_SUBPKG_INCLUDE="
opt/bionic-host/lib/libcrypto.so
opt/bionic-host/lib64/libcrypto.so
"
44 changes: 31 additions & 13 deletions packages/bionic-host/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
TERMUX_PKG_HOMEPAGE=https://android.googlesource.com/platform/bionic/
TERMUX_PKG_DESCRIPTION="bionic libc, libm, libdl and dynamic linker for ubuntu host"
TERMUX_PKG_HOMEPAGE=https://source.android.com/
TERMUX_PKG_DESCRIPTION="bionic libc, libm, libdl, libz, liblzma, libicuuc, dynamic linker and debugger for ubuntu host and termux-docker"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="8.0.0-r51"
TERMUX_PKG_REVISION=5
TERMUX_PKG_SHA256=6b42a86fc2ec58f86862a8f09a5465af0758ce24f2ca8c3cabb3bb6a81d96525
TERMUX_PKG_VERSION="9.0.0-r76"
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_SKIP_SRC_EXTRACT=true
# Should be handled by AOSP build system so I am disable it here.
TERMUX_PKG_UNDEF_SYMBOLS_FILES="all"
Expand Down Expand Up @@ -76,12 +75,30 @@ termux_step_get_source() {
-u https://android.googlesource.com/platform/manifest \
-b main -m "${TERMUX_PKG_BUILDER_DIR}/default.xml" <<< 'n'
"${TERMUX_PKG_CACHEDIR}"/repo sync -c -j32
}

sed -i '1s|.*|\#!'"${TERMUX_PKG_SRCDIR}"'/prebuilts/python/linux-x86/2.7.5/bin/python2|' "${TERMUX_PKG_SRCDIR}/bionic/libc/fs_config_generator.py"
sed -i '1s|.*|\#!'"${TERMUX_PKG_SRCDIR}"'/prebuilts/python/linux-x86/2.7.5/bin/python2|' "${TERMUX_PKG_SRCDIR}/external/clang/clang-version-inc.py"
sed -i '/selinux/d' "${TERMUX_PKG_SRCDIR}/system/core/debuggerd/Android.bp"
sed -i '/selinux/d' "${TERMUX_PKG_SRCDIR}/system/core/debuggerd/crash_dump.cpp"
sed -i '/selinux/d' "${TERMUX_PKG_SRCDIR}/system/core/debuggerd/debuggerd.cpp"
termux_step_host_build() {
# Correctly-functioning Python 2 seems to be a mandatory build dependency,
# but using the prebuilt Python 2 from AOSP seemed to result in this error,
# in AOSP 9.0.0 but not in AOSP 8.0.0 or 8.1.0:
# /home/builder/.termux-build/bionic-host/src/prebuilts/python/linux-x86/2.7.5/bin/python2:
# can't decompress data; zlib not available
# which only went away when I recompiled Python 2.
PYTHON2_WORKDIR="${TERMUX_PKG_TMPDIR}/python2"
# recreate prefix and re-add prefix bin folder to $PATH so that if the redundant code doing that in
# termux_step_get_source() is ever removed in the future, this block does not break
export PATH="${TERMUX_PKG_SRCDIR}/prefix/usr/bin:${PATH}"
mkdir -p "${PYTHON2_WORKDIR}" "${TERMUX_PKG_SRCDIR}/prefix"
termux_download https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz \
"${TERMUX_PKG_CACHEDIR}/python2.tar.xz" \
b62c0e7937551d0cc02b8fd5cb0f544f9405bafc9a54d3808ed4594812edef43
tar xf "${TERMUX_PKG_CACHEDIR}/python2.tar.xz" --strip-components=1 -C "${PYTHON2_WORKDIR}"
pushd "${PYTHON2_WORKDIR}"
./configure --prefix="${TERMUX_PKG_SRCDIR}/prefix/usr"
make install
popd
python2 -m ensurepip
pip2 install --upgrade setuptools pip
}

termux_step_configure() {
Expand All @@ -94,12 +111,13 @@ termux_step_make() {
cd ${TERMUX_PKG_SRCDIR}
source build/envsetup.sh;
lunch aosp_${_ARCH}-eng;
make JAVA_NOT_REQUIRED=true linker libc libm libdl libicuuc debuggerd crash_dump
export ALLOW_MISSING_DEPENDENCIES=true
make linker libc libm libdl libicuuc debuggerd crash_dump
make toybox sh mkshrc ping ping6 tracepath tracepath6 traceroute6 arping
"
}

termux_step_make_install() {
mkdir -p "${TERMUX_PREFIX}/opt/bionic-host/usr/icu"
cp "${TERMUX_PKG_SRCDIR}/external/icu/icu4c/source/stubdata/icudt58l.dat" "${TERMUX_PREFIX}/opt/bionic-host/usr/icu/"
mkdir -p "${TERMUX_PREFIX}/opt/bionic-host/"
cp -r "${TERMUX_PKG_SRCDIR}"/out/target/product/generic*/system/* "${TERMUX_PREFIX}/opt/bionic-host/"
}
20 changes: 14 additions & 6 deletions packages/bionic-host/default.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--This XML file is based on this one: https://android.googlesource.com/platform/manifest/+/refs/heads/android-9.0.0_r61/default.xml -->
<manifest>

<remote name="aosp" fetch=".." review="https://android-review.googlesource.com/" />
<default revision="refs/tags/android-8.0.0_r51" remote="aosp" sync-j="4" />
<default revision="refs/tags/android-security-9.0.0_r76" remote="aosp" sync-j="4" />

<project path="build/make" name="platform/build" groups="pdk" >
<project path="build/make" name="platform/build" groups="pdk">
<copyfile src="core/root.mk" dest="Makefile" />
<linkfile src="CleanSpec.mk" dest="build/CleanSpec.mk" />
<linkfile src="buildspec.mk.default" dest="build/buildspec.mk.default" />
Expand All @@ -15,37 +16,44 @@
</project>
<project path="build/blueprint" name="platform/build/blueprint" groups="pdk,tradefed" />
<project path="build/kati" name="platform/build/kati" groups="pdk,tradefed" />
<project path="build/soong" name="platform/build/soong" groups="pdk,tradefed" >
<project path="build/soong" name="platform/build/soong" groups="pdk,tradefed">
<linkfile src="root.bp" dest="Android.bp" />
<linkfile src="bootstrap.bash" dest="bootstrap.bash" />
</project>
<project path="art" name="platform/art" groups="pdk" />
<project path="bionic" name="platform/bionic" groups="pdk" />
<project path="external/boringssl" name="platform/external/boringssl" groups="pdk" />
<project path="external/clang" name="platform/external/clang" groups="pdk" />
<project path="external/compiler-rt" name="platform/external/compiler-rt" groups="pdk" />
<project path="external/elfutils" name="platform/external/elfutils" groups="pdk" />
<project path="external/icu" name="platform/external/icu" groups="pdk" />
<project path="external/iputils" name="platform/external/iputils" groups="pdk" />
<project path="external/jemalloc" name="platform/external/jemalloc" groups="pdk" />
<project path="external/libcxx" name="platform/external/libcxx" groups="pdk" />
<project path="external/libcxxabi" name="platform/external/libcxxabi" groups="pdk" />
<project path="external/libunwind" name="platform/external/libunwind" groups="pdk" />
<project path="external/libunwind_llvm" name="platform/external/libunwind_llvm" groups="pdk" />
<project path="external/llvm" name="platform/external/llvm" groups="pdk" />
<project path="external/lzma" name="platform/external/lzma" groups="pdk" />
<project path="external/mksh" name="platform/external/mksh" groups="pdk" />
<project path="external/safe-iop" name="platform/external/safe-iop" groups="pdk" />
<project path="external/toybox" name="platform/external/toybox" groups="pdk" />
<project path="external/valgrind" name="platform/external/valgrind" groups="pdk" />
<project path="external/vixl" name="platform/external/vixl" groups="pdk" />
<project path="external/zlib" name="platform/external/zlib" groups="pdk" />
<project path="kernel/tests" name="kernel/tests" />
<project path="libnativehelper" name="platform/libnativehelper" groups="pdk" />
<project path="prebuilts/build-tools" name="platform/prebuilts/build-tools" groups="pdk" clone-depth="1" />
<project path="prebuilts/clang-tools" name="platform/prebuilts/clang-tools" groups="pdk" clone-depth="1" />
<project path="prebuilts/clang/host/linux-x86" name="platform/prebuilts/clang/host/linux-x86" groups="pdk" clone-depth="1" />
<project path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9" groups="pdk,linux,arm" clone-depth="1" />
<project path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" groups="pdk,linux,arm" clone-depth="1" />
<project path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9" groups="pdk,linux,arm" clone-depth="1" />
<project path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8" groups="pdk,linux" clone-depth="1" />
<project path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9" groups="pdk,linux,x86" clone-depth="1" />
<project path="prebuilts/go/linux-x86" name="platform/prebuilts/go/linux-x86" groups="linux,pdk,tradefed" clone-depth="1" />
<project path="prebuilts/misc" name="platform/prebuilts/misc" groups="pdk" clone-depth="1" />
<project path="prebuilts/ndk" name="platform/prebuilts/ndk" groups="pdk" clone-depth="1" />
<project path="prebuilts/python/linux-x86/2.7.5" name="platform/prebuilts/python/linux-x86/2.7.5" groups="linux,pdk,pdk-cw-fs,pdk-fs" clone-depth="1" />
<project path="prebuilts/sdk" name="platform/prebuilts/sdk" groups="pdk" clone-depth="1" />
<project path="prebuilts/tools" name="platform/prebuilts/tools" groups="pdk,tools" clone-depth="1" />
<project path="system/core" name="platform/system/core" groups="pdk" />
<project path="system/timezone" name="platform/system/timezone" groups="pdk" />
</manifest>
25 changes: 0 additions & 25 deletions packages/bionic-host/disable-jdk.patch

This file was deleted.

13 changes: 13 additions & 0 deletions packages/bionic-host/iputils-host.subpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# $PREFIX/bin/ping from termux-tools is a script that depends on /system/bin/ping
# which is implemented in standard Android ROMs by the code that this package is built from.
# The same applies to $PREFIX/bin/ping6.
TERMUX_SUBPKG_DESCRIPTION="AOSP-based iputils for termux-docker"
TERMUX_SUBPKG_DEPENDS="boringssl-host"
TERMUX_SUBPKG_INCLUDE="
opt/bionic-host/bin/arping
opt/bionic-host/bin/ping
opt/bionic-host/bin/ping6
opt/bionic-host/bin/tracepath
opt/bionic-host/bin/tracepath6
opt/bionic-host/bin/traceroute6
"
7 changes: 7 additions & 0 deletions packages/bionic-host/mksh-host.subpackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# it is a little bit different from main/mksh because of
# the binary name, the version, the build settings and patches including prefix, and the mkshrc
TERMUX_SUBPKG_DESCRIPTION="AOSP-based mksh for termux-docker"
TERMUX_SUBPKG_INCLUDE="
opt/bionic-host/bin/sh
opt/bionic-host/etc/mkshrc
"
71 changes: 0 additions & 71 deletions packages/bionic-host/no-undefined-deps.patch

This file was deleted.

Loading

0 comments on commit 29bc357

Please sign in to comment.