community/js185 to 1.0.0-4

This commit is contained in:
Kevin Mihelich 2018-01-11 19:50:44 +00:00
parent b3fb8d4dad
commit 3c14487395
4 changed files with 346 additions and 24 deletions

View file

@ -1,43 +1,63 @@
# $Id$
# Maintainer: Ionut Biru <ibiru@archlinux.org>
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix mozilla stupidity
# - patch to fix mozilla stupidity
# - patch for GCC6
# - two patches for AArch64
pkgname=js185
pkgver=1.0.0
pkgrel=3.1
pkgrel=4
pkgdesc="JavaScript interpreter and libraries (legacy)"
arch=(i686 x86_64)
arch=(x86_64)
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/1.8.5"
license=(MPL)
depends=(nspr gcc-libs)
depends=(nspr libffi)
makedepends=(python2 zip)
options=(!staticlibs)
source=(http://ftp.mozilla.org/pub/mozilla.org/js/$pkgname-$pkgver.tar.gz
source=("https://ftp.mozilla.org/pub/mozilla.org/js/${pkgname}-${pkgver}.tar.gz"
'fix-811665.patch'
'destdir.patch'
'autoconf.patch'
'allow-to-build-against-system-libffi.patch'
ihatemozilla.patch no-neon.patch
fix-811665.patch
Bug-638056-Avoid-The-cacheFlush-support-is-missing-o.patch
mozjs185-tag.patch)
md5sums=('a4574365938222adca0a6bd33329cb32'
'f810f575c855e136fe32302c1167344f'
'27d40e50d8dd25f30e1b71a1902fb7fc'
'2bcd0cc9b7eb268de31410bfd97c1282'
'd2b063b75f30fb4b9a2b1e8958cbeec4'
'9add35f52965e4643b9235307d0d6cc5'
'5d4817fadff71765c9b5d1f7b90f904f'
'f810f575c855e136fe32302c1167344f'
'31d3273a985b88938e229ded36271286'
'a6a40ac37ab66291c68ceeacc6e73a01')
sha256sums=('5d12f7e1f5b4a99436685d97b9b7b75f094d33580227aa998c406bbae6f2a687'
'2b298b8a693865b38e2b0d33277bb5ffe152c6ecf43648e85113fec586aa4752'
'1319d729f382703b3a315c7a1bcc2dc14ed52f1111a194d3531a3503f0d0735e'
'524e11a66f0931dc1affcfcf47a87e086b6006ee9b747e2c7caae82334d6ba6b'
'eea3f80f72cfde52745fbb24b9d3a3506dd2cdbb08fe53a529d7c9a14f0381a6'
'40d3f2778ff111bf75c736018a25c5d5cf02585a1981430d18dd2ec030414771'
'99bc474f881950c3d65b09d7a912115cc209d7fbfb4223a819b75d393bd49586'
'2f3fdaa47825835d3b54453c0cfb201f15aee2d12631a244106243d2ff5594e5'
'90ce234d5223e143cd94f2d2730dd9ec6d96f9fdeee7c4f6754ad4732f202fef')
prepare() {
cd js-1.8.5/js/src
find . -name config.sub -exec chmod +w {} \; -exec cp /usr/share/libtool/build-aux/config.sub {} \;
find . -name config.guess -exec chmod +w {} \; -exec cp /usr/share/libtool/build-aux/config.guess {} \;
cd js-1.8.5
patch -p1 -i ../fix-811665.patch
patch -p1 -i ../destdir.patch
patch -p1 -i ../autoconf.patch
patch -p1 -i ../allow-to-build-against-system-libffi.patch
patch -p3 -i "$srcdir/ihatemozilla.patch"
patch -p3 -i "$srcdir/no-neon.patch"
patch -p3 -i "$srcdir/fix-811665.patch"
patch -p1 -i ../ihatemozilla.patch
patch -p1 -i ../no-neon.patch
if [[ $CARCH == "aarch64" ]]; then
patch -p3 -i "$srcdir/Bug-638056-Avoid-The-cacheFlush-support-is-missing-o.patch"
patch -p3 -i "$srcdir/mozjs185-tag.patch"
patch -p1 -i ../Bug-638056-Avoid-The-cacheFlush-support-is-missing-o.patch
patch -p1 -i ../mozjs185-tag.patch
fi
}
@ -47,21 +67,28 @@ build() {
# _FORTIFY_SOURCE causes configure error
unset CPPFLAGS
./configure --prefix=/usr --with-system-nspr \
--enable-threadsafe
./configure \
--prefix=/usr \
--with-system-nspr \
--disable-tests \
--enable-ctypes \
--enable-threadsafe \
--enable-system-ffi
make
}
package() {
cd js-1.8.5/js/src
make DESTDIR="$pkgdir" install
install -Dm755 shell/js "$pkgdir/usr/bin/js"
find "$pkgdir"/usr/{lib/pkgconfig,include} -type f -exec chmod -x {} +
# Bad symlinks (absolute, including DESTDIR!)
cd "$pkgdir/usr/lib"
ln -sf libmozjs185.so.1.0.0 libmozjs185.so.1.0
ln -sf libmozjs185.so.1.0 libmozjs185.so
make DESTDIR="${pkgdir}" install
install -Dm755 shell/js -t "${pkgdir}"/usr/bin/
find "${pkgdir}"/usr/{lib/pkgconfig,include} -type f -exec chmod -x {} +
# Remove static lib (!staticlibs does not work because name do not match)
rm "${pkgdir}"/usr/lib/libmozjs185-1.0.a
}
# vim:set ts=2 sw=2 et:

View file

@ -0,0 +1,116 @@
From: Mike Hommey <mh@glandium.org>
Date: Tue, 9 Mar 2010 09:44:37 +0100
Subject: Allow to build against system libffi
https://bugzilla.mozilla.org/show_bug.cgi?id=551138
---
js/src/Makefile.in | 16 ++++++++++++++--
js/src/config/autoconf.mk.in | 4 ++++
js/src/configure.in | 14 +++++++++++++-
js/src/shell/Makefile.in | 3 +++
4 files changed, 34 insertions(+), 3 deletions(-)
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -453,11 +453,20 @@ CPPSRCS += \
Library.cpp \
$(NULL)
-LOCAL_INCLUDES = \
- -Ictypes/libffi/include \
+ifdef MOZ_NATIVE_FFI
+LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)
+else
+LOCAL_INCLUDES = -Ictypes/libffi/include
+endif
+
+LOCAL_INCLUDES += \
-I. \
$(NULL)
+
+ifdef MOZ_NATIVE_FFI
+EXTRA_DSO_LDOPTS += $(MOZ_FFI_LIBS)
+else
ifeq ($(OS_ARCH),OS2)
SHARED_LIBRARY_LIBS += \
ctypes/libffi/.libs/ffi.a \
@@ -467,6 +476,7 @@ SHARED_LIBRARY_LIBS += \
ctypes/libffi/.libs/libffi.$(LIB_SUFFIX) \
$(NULL)
endif
+endif
endif # JS_HAS_CTYPES
@@ -546,6 +556,7 @@ endif
include $(topsrcdir)/config/rules.mk
ifdef JS_HAS_CTYPES
+ifndef MOZ_NATIVE_FFI
# Build libffi proper as part of the 'exports' target, so things get built
# in the right order.
export::
@@ -554,6 +565,7 @@ export::
distclean clean::
$(call SUBMAKE,$@,ctypes/libffi)
endif
+endif
ifdef MOZ_SYNC_BUILD_FILES
# Because the SpiderMonkey can be distributed and built independently
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -250,6 +250,10 @@ NSPR_CONFIG = @NSPR_CONFIG@
NSPR_CFLAGS = @NSPR_CFLAGS@
NSPR_LIBS = @NSPR_LIBS@
+MOZ_NATIVE_FFI = @MOZ_NATIVE_FFI@
+MOZ_FFI_LIBS = @MOZ_FFI_LIBS@
+MOZ_FFI_CFLAGS = @MOZ_FFI_CFLAGS@
+
USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@
JS_NATIVE_EDITLINE = @JS_NATIVE_EDITLINE@
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4591,6 +4591,18 @@ if test -n "$MOZ_NATIVE_NSPR"; then
CFLAGS=$_SAVE_CFLAGS
fi
+dnl system libffi Support
+dnl ========================================================
+MOZ_ARG_ENABLE_BOOL(system-ffi,
+[ --enable-system-ffi Use system libffi (located with pkgconfig)],
+ MOZ_NATIVE_FFI=1 )
+
+if test -n "$MOZ_NATIVE_FFI"; then
+ PKG_CHECK_MODULES(MOZ_FFI, libffi)
+fi
+
+AC_SUBST(MOZ_NATIVE_FFI)
+
dnl ========================================================
dnl =
dnl = Application
@@ -6074,7 +6086,7 @@ AC_MSG_RESULT(invoking make to create js
$GMAKE js-config
# Build jsctypes if it's enabled.
-if test "$JS_HAS_CTYPES"; then
+if test "$JS_HAS_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
# Run the libffi 'configure' script.
ac_configure_args="--disable-shared --enable-static --disable-raw-api"
if test "$MOZ_DEBUG"; then
--- a/js/src/shell/Makefile.in
+++ b/js/src/shell/Makefile.in
@@ -53,6 +53,9 @@ CPPSRCS = \
DEFINES += -DEXPORT_JS_API
LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX)
+ifdef MOZ_NATIVE_FFI
+EXTRA_LIBS += $(MOZ_FFI_LIBS)
+endif
LOCAL_INCLUDES += -I$(topsrcdir) -I..

View file

@ -0,0 +1,163 @@
--- a/js/src/configure
+++ b/js/src/configure
@@ -99,6 +99,8 @@ ac_help="$ac_help
--with-nspr-exec-prefix=PFX
Exec prefix where NSPR is installed"
ac_help="$ac_help
+ --enable-system-ffi Use system libffi (located with pkgconfig)"
+ac_help="$ac_help
--with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)"
ac_help="$ac_help
--enable-ui-locale=ab-CD
@@ -13204,19 +13206,128 @@ rm -f conftest*
CFLAGS=$_SAVE_CFLAGS
fi
+# Check whether --enable-system-ffi or --disable-system-ffi was given.
+if test "${enable_system_ffi+set}" = set; then
+ enableval="$enable_system_ffi"
+ if test "$enableval" = "yes"; then
+ MOZ_NATIVE_FFI=1
+ elif test "$enableval" = "no"; then
+ :
+ else
+ { echo "configure: error: Option, system-ffi, does not take an argument ($enableval)." 1>&2; exit 1; }
+ fi
+fi
+
+
+if test -n "$MOZ_NATIVE_FFI"; then
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:13210: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$PKG_CONFIG" in
+ /*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+if test -n "$PKG_CONFIG"; then
+ echo "$ac_t""$PKG_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo $ac_n "checking for libffi""... $ac_c" 1>&6
+echo "configure:13254: checking for libffi" >&5
+
+ if $PKG_CONFIG --exists "libffi" ; then
+ echo "$ac_t""yes" 1>&6
+ succeeded=yes
+
+ echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6
+echo "configure:13261: checking MOZ_FFI_CFLAGS" >&5
+ MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi"`
+ echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6
+
+ echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6
+echo "configure:13266: checking MOZ_FFI_LIBS" >&5
+ ## Remove evil flags like -Wl,--export-dynamic
+ MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi\" |sed s/-Wl,--export-dynamic//g`"
+ echo "$ac_t""$MOZ_FFI_LIBS" 1>&6
+ else
+ MOZ_FFI_CFLAGS=""
+ MOZ_FFI_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ MOZ_FFI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libffi"`
+ echo $MOZ_FFI_PKG_ERRORS
+ fi
+
+
+
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ :
+ else
+ if test "$COMPILE_ENVIRONMENT"; then
+ { echo "configure: error: Library requirements (libffi) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
+ fi
+ fi
+
+fi
+
+
+
# Application
BUILD_STATIC_LIBS=
ENABLE_TESTS=1
MOZ_THUMB2=
USE_ARM_KUSER=
case "${target}" in
arm-android-eabi)
USE_ARM_KUSER=1
MOZ_THUMB2=1
;;
esac
@@ -15741,9 +15851,13 @@ s%@HAVE_GCC3_ABI@%$HAVE_GCC3_ABI%g
s%@NSPR_CFLAGS@%$NSPR_CFLAGS%g
s%@NSPR_LIBS@%$NSPR_LIBS%g
s%@NSPR_CONFIG@%$NSPR_CONFIG%g
+s%@PKG_CONFIG@%$PKG_CONFIG%g
+s%@MOZ_FFI_CFLAGS@%$MOZ_FFI_CFLAGS%g
+s%@MOZ_FFI_LIBS@%$MOZ_FFI_LIBS%g
+s%@MOZ_NATIVE_FFI@%$MOZ_NATIVE_FFI%g
s%@MOZ_UI_LOCALE@%$MOZ_UI_LOCALE%g
s%@MOZ_THUMB2@%$MOZ_THUMB2%g
s%@MOZ_ARM_ARCH@%$MOZ_ARM_ARCH%g
s%@MOZ_OPTIMIZE@%$MOZ_OPTIMIZE%g
s%@MOZ_OPTIMIZE_FLAGS@%$MOZ_OPTIMIZE_FLAGS%g
s%@MOZ_OPTIMIZE_LDFLAGS@%$MOZ_OPTIMIZE_LDFLAGS%g
@@ -16121,7 +16235,7 @@ echo "$ac_t""invoking make to create js-
$GMAKE js-config
# Build jsctypes if it's enabled.
-if test "$JS_HAS_CTYPES"; then
+if test "$JS_HAS_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
# Run the libffi 'configure' script.
ac_configure_args="--disable-shared --enable-static --disable-raw-api"
if test "$MOZ_DEBUG"; then

View file

@ -0,0 +1,16 @@
# See discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=628723
# Patch created by Colin Walters <walters@verbum.org>
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -900,8 +900,8 @@ endif
ifeq (,$(HOST_BIN_SUFFIX))
mv -f $(SHLIB_ANY_VER) $(SHLIB_EXACT_VER)
@[ ! -h $(SHLIB_ABI_VER) ] || rm -f $(SHLIB_ABI_VER)
- ln -s $(SHLIB_EXACT_VER) $(SHLIB_ABI_VER)
- ln -s $(SHLIB_ABI_VER) $(SHLIB_ANY_VER)
+ ln -s $(notdir $(SHLIB_EXACT_VER)) $(SHLIB_ABI_VER)
+ ln -s $(notdir $(SHLIB_ABI_VER)) $(SHLIB_ANY_VER)
endif
endif
ifneq (,$(IMPORT_LIBRARY))