From 914189b55a45537472692f6735bb553fbeb6dea3 Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Wed, 31 Jan 2024 15:04:54 +0000 Subject: [PATCH] Move bzip2, libffi, openssl, sqlite and xz recipes to https://github.com/beeware/cpython-android-source-deps --- target/build-all.sh | 6 ++-- target/bzip2/build.sh | 27 ----------------- target/libffi/build.sh | 26 ----------------- target/openssl/build.sh | 65 ----------------------------------------- target/sqlite/build.sh | 44 ---------------------------- target/xz/build.sh | 26 ----------------- 6 files changed, 2 insertions(+), 192 deletions(-) delete mode 100755 target/bzip2/build.sh delete mode 100755 target/libffi/build.sh delete mode 100755 target/openssl/build.sh delete mode 100755 target/sqlite/build.sh delete mode 100755 target/xz/build.sh diff --git a/target/build-all.sh b/target/build-all.sh index 58a843be9d..ad3850400d 100755 --- a/target/build-all.sh +++ b/target/build-all.sh @@ -3,10 +3,8 @@ set -eu cd $(dirname $(realpath $0)) -for abi in armeabi-v7a arm64-v8a x86 x86_64; do - # OpenSSL build fails if lib doesn't already exist. - mkdir -p prefix/$abi/{bin,include,lib,share} -done +echo "This script needs to be updated to use https://github.com/beeware/cpython-android-source-deps" +exit 1 # Build libraries shared by all Python versions. ./for-each-abi.sh bzip2/build.sh 1.0.8 diff --git a/target/bzip2/build.sh b/target/bzip2/build.sh deleted file mode 100755 index 08a25e9913..0000000000 --- a/target/bzip2/build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -eu - -recipe_dir=$(dirname $(realpath $0)) -prefix=$(realpath ${1:?}) -version=${2:?} - -cd $recipe_dir -. ../build-common.sh - -version_dir=$recipe_dir/build/$version -mkdir -p $version_dir -cd $version_dir -src_filename=bzip2-$version.tar.gz -wget -c https://sourceware.org/pub/bzip2/$src_filename - -build_dir=$version_dir/$abi -rm -rf $build_dir -mkdir $build_dir -cd $build_dir -tar -xf $version_dir/$src_filename -cd $(basename $src_filename .tar.gz) - -CFLAGS+=" -O2 -fPIC" -# -e is needed to override explicit assignment to CC, CFLAGS etc. in the Makefile. -make -e -j $(nproc) bzip2 bzip2recover -make install PREFIX=$prefix diff --git a/target/libffi/build.sh b/target/libffi/build.sh deleted file mode 100755 index f6b0f22d1b..0000000000 --- a/target/libffi/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -eu - -recipe_dir=$(dirname $(realpath $0)) -prefix=$(realpath ${1:?}) -version=${2:?} - -cd $recipe_dir -. ../build-common.sh - -version_dir=$recipe_dir/build/$version -mkdir -p $version_dir -cd $version_dir -src_filename=libffi-$version.tar.gz -wget -c https://github.com/libffi/libffi/releases/download/v$version/$src_filename - -build_dir=$version_dir/$abi -rm -rf $build_dir -mkdir $build_dir -cd $build_dir -tar -xf $version_dir/$src_filename -cd $(basename $src_filename .tar.gz) - -./configure --host=$host_triplet --prefix=$prefix --disable-shared --with-pic -make -j $(nproc) -make install diff --git a/target/openssl/build.sh b/target/openssl/build.sh deleted file mode 100755 index 2a1d6c0835..0000000000 --- a/target/openssl/build.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -set -eu - -recipe_dir=$(dirname $(realpath $0)) -prefix=$(realpath ${1:?}) -version=${2:?} - -cd $recipe_dir -. ../build-common.sh - -version_dir=$recipe_dir/build/$version -mkdir -p $version_dir -cd $version_dir -src_filename=openssl-$version.tar.gz -wget -c https://www.openssl.org/source/$src_filename - -build_dir=$version_dir/$abi -rm -rf $build_dir -mkdir $build_dir -cd $build_dir -tar -xf $version_dir/$src_filename -cd $(basename $src_filename .tar.gz) - -# CFLAGS environment variable replaces default flags rather than adding to them. -CFLAGS+=" -O2" -export LDLIBS="-latomic" - -if [[ $abi =~ '64' ]]; then - bits="64" -else - bits="32" -fi -./Configure linux-generic$bits shared -make -j $(nproc) - -install_dir="/tmp/openssl-install-$$" -rm -rf $install_dir -make install_sw DESTDIR=$install_dir -tmp_prefix="$install_dir/usr/local" -rm -rf $prefix/include/openssl -cp -af $tmp_prefix/include/* $prefix/include -rm -rf $prefix/lib/lib{crypto,ssl}*.so* -cp -af $tmp_prefix/lib/*.{so*,a} $prefix/lib -rm -r $install_dir - -# We add a _chaquopy suffix in case libraries of the same name are provided by Android -# itself. And we update the SONAME to match, so that anything compiled against the library -# will store the modified name. This is necessary on API 22 and older, where the dynamic -# linker ignores the SONAME attribute and uses the filename instead. -cd $prefix/lib -for name in crypto ssl; do - old_name=$(basename $(realpath lib$name.so)) # Follow symlinks. - new_name="lib${name}_chaquopy.so" - if [ "$name" = "crypto" ]; then - crypto_old_name=$old_name - crypto_new_name=$new_name - fi - - mv "$old_name" "$new_name" - ln -s "$new_name" "$old_name" - patchelf --set-soname "$new_name" "$new_name" - if [ "$name" = "ssl" ]; then - patchelf --replace-needed "$crypto_old_name" "$crypto_new_name" "$new_name" - fi -done diff --git a/target/sqlite/build.sh b/target/sqlite/build.sh deleted file mode 100755 index 6754f7541e..0000000000 --- a/target/sqlite/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -eu - -recipe_dir=$(dirname $(realpath $0)) -prefix=$(realpath ${1:?}) - -# We pass in the version in the same format as the URL. For example, version 3.39.2 -# becomes 3390200. -year=${2:?} -version=${3:?} - -cd $recipe_dir -. ../build-common.sh - -version_dir=$recipe_dir/build/$version -mkdir -p $version_dir -cd $version_dir -src_filename=sqlite-autoconf-$version.tar.gz -wget -c https://www.sqlite.org/$year/$src_filename - -build_dir=$version_dir/$abi -rm -rf $build_dir -mkdir $build_dir -cd $build_dir -tar -xf $version_dir/$src_filename -cd $(basename $src_filename .tar.gz) - -CFLAGS+=" -Os" # This is off by default, but it's recommended in the README. -./configure --host=$host_triplet --disable-static --disable-static-shell --with-pic -make -j $(nproc) -make install prefix=$prefix - -# We add a _chaquopy suffix in case libraries of the same name are provided by Android -# itself. And we update the SONAME to match, so that anything compiled against the library -# will store the modified name. This is necessary on API 22 and older, where the dynamic -# linker ignores the SONAME attribute and uses the filename instead. -cd $prefix/lib -for name in sqlite3; do - old_name=$(basename $(realpath lib$name.so)) # Follow symlinks. - new_name="lib${name}_chaquopy.so" - mv "$old_name" "$new_name" - ln -s "$new_name" "$old_name" - patchelf --set-soname "$new_name" "$new_name" -done diff --git a/target/xz/build.sh b/target/xz/build.sh deleted file mode 100755 index c621dcd97f..0000000000 --- a/target/xz/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -eu - -recipe_dir=$(dirname $(realpath $0)) -prefix=$(realpath ${1:?}) -version=${2:?} - -cd $recipe_dir -. ../build-common.sh - -version_dir=$recipe_dir/build/$version -mkdir -p $version_dir -cd $version_dir -src_filename=xz-$version.tar.gz -wget -c https://github.com/tukaani-project/xz/releases/download/v$version/$src_filename - -build_dir=$version_dir/$abi -rm -rf $build_dir -mkdir $build_dir -cd $build_dir -tar -xf $version_dir/$src_filename -cd xz-$version - -./configure --host=$host_triplet --prefix=$prefix --disable-shared --with-pic -make -j $(nproc) -make install