Browse Source

update to newest version compiles and raco works on host. (#2259)

Needs some testing.
android-5
its-pointless 7 years ago
committed by Fredrik Fornwall
parent
commit
442464c5be
  1. 32
      disabled-packages/racket/build.sh
  2. 10
      disabled-packages/racket/newgc.c.patch
  3. 36
      disabled-packages/racket/port.c.patch
  4. 18
      disabled-packages/racket/rktio_dll.c.patch
  5. 32
      disabled-packages/racket/sconfig.h.patch

32
disabled-packages/racket/build.sh

@ -1,32 +1,13 @@
TERMUX_PKG_HOMEPAGE=https://racket-lang.org TERMUX_PKG_HOMEPAGE=https://racket-lang.org
TERMUX_PKG_DESCRIPTION="Full-spectrum programming language going beyond Lisp and Scheme" TERMUX_PKG_DESCRIPTION="Full-spectrum programming language going beyond Lisp and Scheme"
TERMUX_PKG_VERSION=6.7 TERMUX_PKG_VERSION=6.12
TERMUX_PKG_SRCURL=https://mirror.racket-lang.org/installers/${TERMUX_PKG_VERSION}/racket-minimal-${TERMUX_PKG_VERSION}-src-builtpkgs.tgz TERMUX_PKG_SRCURL=https://mirror.racket-lang.org/installers/${TERMUX_PKG_VERSION}/racket-minimal-${TERMUX_PKG_VERSION}-src-builtpkgs.tgz
TERMUX_PKG_SHA256=4203d9b51a0de7ea549db966cfa49a736f8605ab51e2f198cbdb9cfaf428b0f3
TERMUX_PKG_SHA256=295a422d60af2a3186a18783d033c167eeed07b936c79f404d25123a0209d683
TERMUX_PKG_NO_DEVELSPLIT=true
TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_DEPENDS="libffi, libandroid-support" TERMUX_PKG_DEPENDS="libffi, libandroid-support"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-racket=$TERMUX_PKG_HOSTBUILD_DIR/racket/racketcgc" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-racket=$TERMUX_PKG_HOSTBUILD_DIR/racket/racketcgc --enable-libs --disable-shared --disable-gracket --enable-libffi"
# Building racket hits the 'the wrong gcc-problem' detailed at
# http://www.metastatic.org/text/libtool.html
# due to --tag=CC being used. To avoid that a cross libtool
# built in termux_step_post_extract_package() below and used
# due to this configure argument:
_CROSS_LIBTOOL_DIR=$TERMUX_PKG_CACHEDIR/libtool-cross-2.4.6-${TERMUX_HOST_PLATFORM}
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-lt=$_CROSS_LIBTOOL_DIR/bin/${TERMUX_HOST_PLATFORM}-libtool"
termux_step_post_extract_package () {
if [ ! -d $_CROSS_LIBTOOL_DIR ]; then
LIBTOOL_TARFILE=$TERMUX_PKG_CACHEDIR/libtool-2.4.6.tar.gz
if [ ! -f $LIBTOOL_TARFILE ]; then
curl -L -o $LIBTOOL_TARFILE http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz
fi
cd $TERMUX_PKG_CACHEDIR
tar xf $LIBTOOL_TARFILE
cd libtool-2.4.6
./configure --prefix=$_CROSS_LIBTOOL_DIR --host=$TERMUX_HOST_PLATFORM --program-prefix=${TERMUX_HOST_PLATFORM}-
make install
fi
}
termux_step_host_build () { termux_step_host_build () {
$TERMUX_PKG_SRCDIR/src/configure ${TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS} $TERMUX_PKG_SRCDIR/src/configure ${TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS}
@ -34,9 +15,8 @@ termux_step_host_build () {
} }
termux_step_pre_configure () { termux_step_pre_configure () {
CPPFLAGS+=" -I$TERMUX_PKG_SRCDIR/src/racket/include -I$TERMUX_PKG_BUILDDIR/racket"
# Due to use of syslog. # Due to use of syslog.
LDFLAGS+=" -llog" LDFLAGS+=" -llog"
# Do this after patching:
export TERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/src export TERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/src
} }

10
disabled-packages/racket/newgc.c.patch

@ -0,0 +1,10 @@
--- ../cache/racket-6.11/src/racket/gc2/newgc.c 2017-07-07 19:13:22.000000000 +0000
+++ ./src/racket/gc2/newgc.c 2018-01-05 05:55:28.900376813 +0000
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <strings.h>
#include "platforms.h"
#include "../src/schpriv.h"
#include "gc2.h"

36
disabled-packages/racket/port.c.patch

@ -1,36 +0,0 @@
"The getdtablesize functions has been deprecated by Posix and has been
removed from Android's LB64 ABI. Replace calls to it with the modern
equivalent sysconf(_SC_OPEN_MAX)."
- https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/AXhZapYuHi8
diff -u -r ../../racket-6.4/src/racket/src/port.c ./racket/src/src/port.c
--- ../../racket-6.4/src/racket/src/port.c 2016-01-14 12:11:20.000000000 -0500
+++ ./src/racket/src/port.c 2016-04-10 17:43:40.039414493 -0400
@@ -1090,7 +1090,7 @@
# ifdef USE_ULIMIT
dynamic_fd_size = ulimit(4, 0);
# else
- dynamic_fd_size = getdtablesize();
+ dynamic_fd_size = sysconf(_SC_OPEN_MAX);
# endif
/* divide by bits-per-byte: */
dynamic_fd_size = (dynamic_fd_size + 7) >> 3;
@@ -1365,7 +1365,7 @@
# ifdef FIXED_FD_LIMIT
limit = FIXED_FD_LIMIT;
# else
- limit = getdtablesize();
+ limit = sysconf(_SC_OPEN_MAX);
# endif
# endif
# endif
@@ -10390,7 +10390,7 @@
# ifdef USE_ULIMIT
i = ulimit(4, 0);
# else
- i = getdtablesize();
+ i = sysconf(_SC_OPEN_MAX);
# endif
while (i--) {
int cr;

18
disabled-packages/racket/rktio_dll.c.patch

@ -0,0 +1,18 @@
--- ../cache/racket-6.12/src/rktio/rktio_dll.c 2017-10-12 18:23:27.000000000 +0000
+++ ./src/rktio/rktio_dll.c 2018-03-18 01:22:17.345952252 +0000
@@ -1,5 +1,6 @@
#include "rktio.h"
#include "rktio_private.h"
+#include "scheme.h"
#include <stdlib.h>
#include <string.h>
@@ -63,7 +64,7 @@
return dll;
#ifdef RKTIO_SYSTEM_UNIX
-# if defined(__ANDROID__)
+# if defined(__ANDROID__) && !defined(__x86_64__) && !defined(__aarch64__)
if (!name) handle = RTLD_DEFAULT; else
# elif defined(__CYGWIN32__)
if (!name) { handle = RTLD_DEFAULT; null_ok = 1; } else

32
disabled-packages/racket/sconfig.h.patch

@ -0,0 +1,32 @@
--- ../cache/racket-6.12/src/racket/sconfig.h 2017-10-12 18:23:27.000000000 +0000
+++ ./src/racket/sconfig.h 2018-02-07 01:18:13.911569478 +0000
@@ -124,10 +124,12 @@
# endif
# if defined(__x86_64__)
# define SCHEME_PLATFORM_LIBRARY_SUBPATH "x86_64-"SPLS_LINUX
# define REGISTER_POOR_MACHINE
# define ASM_DBLPREC_CONTROL_87
+#ifndef __ANDROID__
# define MZ_TRY_EXTFLONUMS
# endif
+# endif
# ifndef SCHEME_PLATFORM_LIBRARY_SUBPATH
# define SCHEME_PLATFORM_LIBRARY_SUBPATH "unknown-"SPLS_LINUX
# endif
@@ -147,12 +149,16 @@
#if defined(__i386__)
# define MZ_USE_JIT_I386
# define MZ_JIT_USE_MPROTECT
+#ifndef __ANDROID__
# define MZ_USE_DWARF_LIBUNWIND
#endif
+#endif
#if defined(__x86_64__)
# define MZ_USE_JIT_X86_64
# define MZ_JIT_USE_MPROTECT
+#ifndef __ANDROID__
# define MZ_USE_DWARF_LIBUNWIND
+#endif
#endif
#if defined(__powerpc__) && !defined(__powerpc64__)
# define MZ_USE_JIT_PPC
Loading…
Cancel
Save