f1ef5d2b58027554a52d681aada52731cc83e771
[termux-packages] / packages / glib / build.sh
1 TERMUX_PKG_HOMEPAGE=https://developer.gnome.org/glib/
2 TERMUX_PKG_DESCRIPTION="Library providing core building blocks for libraries and applications written in C"
3 _TERMUX_GLIB_MAJOR_VERSION=2.52
4 TERMUX_PKG_VERSION=${_TERMUX_GLIB_MAJOR_VERSION}.2
5 TERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/gnome/sources/glib/${_TERMUX_GLIB_MAJOR_VERSION}/glib-${TERMUX_PKG_VERSION}.tar.xz
6 TERMUX_PKG_SHA256=f00e5d9e2a2948b1da25fcba734a6b7a40f556de8bc9f528a53f6569969ac5d0
7 # libandroid-support to get langinfo.h in include path.
8 TERMUX_PKG_DEPENDS="libffi, pcre, libandroid-support"
9 TERMUX_PKG_RM_AFTER_INSTALL="share/gtk-doc share/locale share/glib-2.0/gettext share/gdb/auto-load share/glib-2.0/codegen share/glib-2.0/gdb bin/gtester-report bin/glib-mkenums bin/glib-gettextize bin/gdbus-codegen"
10 # Needed by pkg-config for glib-2.0:
11 TERMUX_PKG_DEVPACKAGE_DEPENDS="pcre-dev"
12 TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="lib/glib-2.0/include"
13
14 # --enable-compile-warnings=no to get rid of format strings causing errors.
15 # --disable-znodelete to avoid DF_1_NODELETE which most Android 5.0 linkers does not support.
16 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
17 --cache-file=termux_configure.cache
18 --disable-compile-warnings
19 --disable-gtk-doc
20 --disable-gtk-doc-html
21 --disable-libelf
22 --disable-libmount
23 --disable-znodelete
24 --with-pcre=system
25 "
26
27 termux_step_pre_configure () {
28 # glib checks for __BIONIC__ instead of __ANDROID__:
29 CFLAGS="$CFLAGS -D__BIONIC__=1"
30
31 cd $TERMUX_PKG_BUILDDIR
32
33 # https://developer.gnome.org/glib/stable/glib-cross-compiling.html
34 echo "glib_cv_long_long_format=ll" >> termux_configure.cache
35 echo "glib_cv_stack_grows=no" >> termux_configure.cache
36 echo "glib_cv_uscore=no" >> termux_configure.cache
37 chmod a-w termux_configure.cache
38 }