18e643560d7fe6ff3b64109bd389b36091877cc8
[termux-packages] / packages / elfutils / build.sh
1 TERMUX_PKG_VERSION=0.166
2 TERMUX_PKG_HOMEPAGE=https://fedorahosted.org/elfutils/
3 TERMUX_PKG_DESCRIPTION="ELF object file access library"
4 TERMUX_PKG_SRCURL=https://fedorahosted.org/releases/e/l/elfutils/${TERMUX_PKG_VERSION}/elfutils-${TERMUX_PKG_VERSION}.tar.bz2
5 # libandroid-support for langinfo.
6 TERMUX_PKG_DEPENDS="libandroid-support, liblzma, libbz2"
7 # Use "eu-" as program prefix to avoid conflict with binutils programs.
8 # This is what several linux distributions do.
9 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--program-prefix='eu-'"
10 # The ar.c file is patched away for now:
11 TERMUX_PKG_RM_AFTER_INSTALL="bin/eu-ar"
12
13 LDFLAGS+=" -lintl"
14 CFLAGS+=" -DTERMUX_EXPOSE_MEMPCPY=1 -Wno-error=unused-value -Wno-error=format-nonliteral -Wno-error"
15
16 # Exposes ACCESSPERMS in <sys/stat.h> which elfutils uses:
17 CFLAGS+=" -D__USE_BSD"
18
19 termux_step_pre_configure () {
20 # Install argp lib.
21 ARGP_FILE=$TERMUX_PKG_CACHEDIR/argp-standalone.1.3.tar.gz
22 if [ ! -f $ARGP_FILE ]; then
23 curl -o $ARGP_FILE http://www.lysator.liu.se/~nisse/archive/argp-standalone-1.3.tar.gz
24 fi
25
26 cd $TERMUX_PKG_TMPDIR
27 tar xf $ARGP_FILE
28 cd argp-standalone-1.3
29 ./configure --host=$TERMUX_HOST_PLATFORM
30 make
31
32 cp $TERMUX_PKG_BUILDER_DIR/error.h .
33 cp $TERMUX_PKG_BUILDER_DIR/stdio_ext.h .
34 cp $TERMUX_PKG_BUILDER_DIR/obstack.h .
35 cp $TERMUX_PKG_BUILDER_DIR/qsort_r.h .
36
37 LDFLAGS+=" -L$TERMUX_PKG_TMPDIR/argp-standalone-1.3"
38 CPPFLAGS+=" -isystem $TERMUX_PKG_TMPDIR/argp-standalone-1.3"
39 }
40
41 #termux_step_post_make_install () {
42 #make install-includeHEADERS
43 #}
44
45 termux_step_post_massage () {
46 # Remove to avoid spurios linking to libelf (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=10648):
47 rm -f $TERMUX_PREFIX/lib/libelf*
48 }