Fix termux-elf-cleaner breakage
authorFredrik Fornwall <fredrik@fornwall.net>
Thu, 6 Apr 2017 21:33:45 +0000 (23:33 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Thu, 6 Apr 2017 21:33:45 +0000 (23:33 +0200)
When separating out termux-elf-cleaner into its own repository the
way of building a native binary failed. Fixes #906.

build-package.sh
packages/termux-elf-cleaner/build.sh

index 39a4a61..af3d0c5 100755 (executable)
@@ -348,7 +348,12 @@ termux_step_start_build() {
        # scripts can assume that it works on both builder and host later on:
        ln -f -s /bin/sh "$TERMUX_PREFIX/bin/sh"
 
-       TERMUX_ELF_CLEANER_SRC=$TERMUX_SCRIPTDIR/packages/termux-elf-cleaner/termux-elf-cleaner.cpp
+       local TERMUX_ELF_CLEANER_SRC=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner.cpp
+       local TERMUX_ELF_CLEANER_VERSION=$(bash -c ". $TERMUX_SCRIPTDIR/packages/termux-elf-cleaner/build.sh; echo \$TERMUX_PKG_VERSION")
+       termux_download \
+               https://raw.githubusercontent.com/termux/termux-elf-cleaner/v$TERMUX_ELF_CLEANER_VERSION/termux-elf-cleaner.cpp \
+               $TERMUX_ELF_CLEANER_SRC \
+               11a38372f4d0e36b7556382c7ecffecae35cee8b68daaee2dbee025f758e17ee
        if [ "$TERMUX_ELF_CLEANER_SRC" -nt "$TERMUX_ELF_CLEANER" ]; then
                g++ -std=c++11 -Wall -Wextra -pedantic -Os "$TERMUX_ELF_CLEANER_SRC" -o "$TERMUX_ELF_CLEANER"
        fi
index b5bb895..2c94824 100644 (file)
@@ -1,5 +1,8 @@
 TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-elf-cleaner
 TERMUX_PKG_DESCRIPTION="Cleaner of ELF files for Android"
+# NOTE: The termux-elf-cleaner.cpp file is used by build-package.sh
+#       to create a native binary. Bumping this version will need
+#       updating the checksum used there.
 TERMUX_PKG_VERSION=1.1
 TERMUX_PKG_SRCURL=https://github.com/termux/termux-elf-cleaner/archive/v${TERMUX_PKG_VERSION}.tar.gz
 TERMUX_PKG_SHA256=66612b294e197ab7bfac807e497581df58424af6a7c855f89fc12eafa3dc1b8c