zlib: add package
This commit is contained in:
parent
22487229d2
commit
5170610f52
@ -11,7 +11,7 @@ TERMUX_PKG_CONFLICTS="libutil-dev, libgcc, libandroid-support-dev"
|
||||
TERMUX_PKG_REPLACES="libutil-dev, libgcc, libandroid-support-dev, ndk-stl"
|
||||
|
||||
termux_step_extract_into_massagedir() {
|
||||
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/pkgconfig \
|
||||
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib \
|
||||
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include
|
||||
|
||||
cp -Rf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/* \
|
||||
@ -22,9 +22,6 @@ termux_step_extract_into_massagedir() {
|
||||
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/*.o \
|
||||
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib
|
||||
|
||||
cp "$PKG_CONFIG_LIBDIR/zlib.pc" \
|
||||
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/pkgconfig/zlib.pc
|
||||
|
||||
local LIBATOMIC_PATH=$TERMUX_STANDALONE_TOOLCHAIN/$TERMUX_HOST_PLATFORM/lib
|
||||
if [ $TERMUX_ARCH_BITS = 64 ]; then LIBATOMIC_PATH+="64"; fi
|
||||
if [ $TERMUX_ARCH = "arm" ]; then LIBATOMIC_PATH+="/armv7-a"; fi
|
||||
|
10
packages/zlib/build.sh
Normal file
10
packages/zlib/build.sh
Normal file
@ -0,0 +1,10 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://www.zlib.net/
|
||||
TERMUX_PKG_DESCRIPTION="Compression library implementing the deflate compression method found in gzip and PKZIP"
|
||||
TERMUX_PKG_LICENSE="ZLIB"
|
||||
TERMUX_PKG_VERSION=1.2.11
|
||||
TERMUX_PKG_SHA256=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
|
||||
TERMUX_PKG_SRCURL=https://www.zlib.net/zlib-$TERMUX_PKG_VERSION.tar.xz
|
||||
|
||||
termux_step_configure() {
|
||||
"$TERMUX_PKG_SRCDIR/configure" --prefix=$TERMUX_PREFIX
|
||||
}
|
@ -138,20 +138,14 @@ termux_step_setup_toolchain() {
|
||||
# Remove <sys/sem.h> as it doesn't work for non-root.
|
||||
# Remove <glob.h> as we currently provide it from libandroid-glob.
|
||||
# Remove <spawn.h> as it's only for future (later than android-27).
|
||||
rm usr/include/sys/{capability.h,shm.h,sem.h} usr/include/{glob.h,spawn.h}
|
||||
# Remove <zlib.h> and <zconf.h> as we build our own zlib
|
||||
rm usr/include/sys/{capability.h,shm.h,sem.h} usr/include/{glob.h,spawn.h,zlib.h,zconf.h}
|
||||
|
||||
sed -i "s/define __ANDROID_API__ __ANDROID_API_FUTURE__/define __ANDROID_API__ $TERMUX_PKG_API_LEVEL/" \
|
||||
usr/include/android/api-level.h
|
||||
|
||||
$TERMUX_ELF_CLEANER usr/lib/*/*/*.so
|
||||
|
||||
# zlib is really version 1.2.8 in the Android platform (at least
|
||||
# starting from Android 5), not older as the NDK headers claim.
|
||||
for file in zconf.h zlib.h; do
|
||||
curl -o usr/include/$file \
|
||||
https://raw.githubusercontent.com/madler/zlib/v1.2.8/$file
|
||||
done
|
||||
unset file
|
||||
grep -lrw $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/c++/v1 -e '<version>' | xargs -n 1 sed -i 's/<version>/\"version\"/g'
|
||||
mv $_TERMUX_TOOLCHAIN_TMPDIR $TERMUX_STANDALONE_TOOLCHAIN
|
||||
fi
|
||||
|
@ -128,16 +128,7 @@ termux_step_start_build() {
|
||||
|
||||
# Avoid exporting PKG_CONFIG_LIBDIR until after termux_step_host_build.
|
||||
export TERMUX_PKG_CONFIG_LIBDIR=$TERMUX_PREFIX/lib/pkgconfig
|
||||
# Add a pkg-config file for the system zlib.
|
||||
mkdir -p "$TERMUX_PKG_CONFIG_LIBDIR"
|
||||
cat > "$TERMUX_PKG_CONFIG_LIBDIR/zlib.pc" <<-HERE
|
||||
Name: zlib
|
||||
Description: zlib compression library
|
||||
Version: 1.2.8
|
||||
Requires:
|
||||
Libs: -lz
|
||||
HERE
|
||||
ln -sf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libz.so $TERMUX_PREFIX/lib/libz.so
|
||||
|
||||
# Keep track of when build started so we can see what files have been created.
|
||||
# We start by sleeping so that any generated files above (such as zlib.pc) get
|
||||
# an older timestamp than the TERMUX_BUILD_TS_FILE.
|
||||
|
Loading…
Reference in New Issue
Block a user