Fixes for building on a mac
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 10 Jun 2016 23:17:00 +0000 (01:17 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 10 Jun 2016 23:17:00 +0000 (01:17 +0200)
build-package.sh
packages/busybox/build.sh
packages/gifsicle/build.sh
packages/libluajit/Makefile.patch
packages/ncurses/build.sh
scripts/setup-mac.sh [new file with mode: 0755]

index 6ab780c..c1289ef 100755 (executable)
@@ -103,7 +103,7 @@ export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin
 
 # Make $TERMUX_TAR and $TERMUX_TOUCH point at gnu versions:
 export TERMUX_TAR="tar"
-test `uname` = "Darwin" && TERMUX_TAR=gnutar
+test `uname` = "Darwin" && TERMUX_TAR=gtar
 export TERMUX_TOUCH="touch"
 test `uname` = "Darwin" && TERMUX_TOUCH=gtouch
 
index 6785084..684c7d8 100755 (executable)
@@ -8,7 +8,8 @@ TERMUX_PKG_BUILD_IN_SRC=yes
 # We replace env in the old coreutils package:
 TERMUX_PKG_CONFLICTS="coreutils (<< 8.25-4)"
 
-# NOTE: sed on mac does not work for building busybox, install gsed and symlink sed => gsed
+# NOTE: sed on mac does not work for building busybox, install gnu-sed with
+#       homebrew using the --with-default-names option.
 
 CFLAGS+=" -llog -DTERMUX_EXPOSE_MEMPCPY=1" # Android system liblog.so for syslog
 
index d113484..78ff9d5 100644 (file)
@@ -2,3 +2,4 @@ TERMUX_PKG_HOMEPAGE=http://www.lcdf.org/gifsicle/
 TERMUX_PKG_DESCRIPTION="Tool for creating, editing, and getting information about GIF images and animations"
 TERMUX_PKG_VERSION=1.88
 TERMUX_PKG_SRCURL=http://www.lcdf.org/gifsicle/gifsicle-${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-gifview"
index 59f9604..451da02 100644 (file)
@@ -1,9 +1,7 @@
-Link the luajit executable to the shared libraries.
-
-diff -u -r ../LuaJIT-2.0.3/src/Makefile ./src/Makefile
---- ../LuaJIT-2.0.3/src/Makefile       2014-03-12 13:10:00.000000000 +0100
-+++ ./src/Makefile     2014-07-09 02:39:15.344355861 +0200
-@@ -72,14 +72,14 @@
+diff -u -r ../LuaJIT-2.1.0-beta2/src/Makefile ./src/Makefile
+--- ../LuaJIT-2.1.0-beta2/src/Makefile 2016-03-03 12:40:00.000000000 +0100
++++ ./src/Makefile     2016-06-11 00:59:21.000000000 +0200
+@@ -71,14 +71,14 @@
  # as dynamic mode.
  #
  # Mixed mode creates a static + dynamic library and a statically linked luajit.
@@ -20,3 +18,14 @@ diff -u -r ../LuaJIT-2.0.3/src/Makefile ./src/Makefile
  #
  ##############################################################################
  
+@@ -166,10 +166,6 @@
+     HOST_SYS= Windows
+     HOST_MSYS= cygwin
+   endif
+-  # Use Clang for OSX host.
+-  ifeq (Darwin,$(HOST_SYS))
+-    DEFAULT_CC= clang
+-  endif
+ endif
+ ##############################################################################
index e18f907..647789a 100755 (executable)
@@ -38,7 +38,7 @@ termux_step_post_make_install () {
                cd $TERMUX_PREFIX/share/terminfo
                for l in *; do 
                        if [ ${#l} -eq 2 ]; then
-                               char=`echo 0x$l | awk '{printf "%c\n", $1}'`
+                               char=`echo 0x$l | /usr/bin/awk '{printf "%c\n", $1}'`
                                rm -Rf $char
                                mv $l $char
                        fi
diff --git a/scripts/setup-mac.sh b/scripts/setup-mac.sh
new file mode 100755 (executable)
index 0000000..6ce6cb8
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e -u
+
+command -v brew >/dev/null 2>&1 || {
+        echo >&2 "Install homebrew first: http://brew.sh"
+        exit 1
+}
+
+PACKAGES=""
+PACKAGES="$PACKAGES bison"
+PACKAGES="$PACKAGES cmake"
+PACKAGES="$PACKAGES coreutils"
+PACKAGES="$PACKAGES gawk"
+PACKAGES="$PACKAGES gnu-sed --with-default-names"       # For busybox build.
+PACKAGES="$PACKAGES gnu-tar"
+PACKAGES="$PACKAGES lzip"
+PACKAGES="$PACKAGES pkgconfig"
+PACKAGES="$PACKAGES python3"
+brew install $PACKAGES
+
+# bison is keg-only, but we need updated 'bison' in path:
+brew link bison --force
+
+sudo mkdir -p /data/data/com.termux/files/usr
+sudo chown -R `whoami` /data