From 1b9e65f20bdc2e7445a016865c2542ebe7e74eff Mon Sep 17 00:00:00 2001
From: Michael Hanson <hansonorders@verizon.net>
Date: Wed, 3 Aug 2011 20:50:44 +0000
Subject: js: initial include as dep of gpac. Replaces spidermonkey.

---
 abs/extra/community/js/PKGBUILD                    | 39 ++++++++++++++++++++++
 abs/extra/community/js/js-1.8.5-3.src.tar.gz       |  1 +
 abs/extra/community/js/js185-destdir.patch         | 15 +++++++++
 abs/extra/spidermonkey/PKGBUILD                    | 31 -----------------
 .../spidermonkey/spidermonkey-1.7-threadsafe.patch | 16 ---------
 abs/extra/spidermonkey/spidermonkey-Makefile.patch | 22 ------------
 6 files changed, 55 insertions(+), 69 deletions(-)
 create mode 100644 abs/extra/community/js/PKGBUILD
 create mode 120000 abs/extra/community/js/js-1.8.5-3.src.tar.gz
 create mode 100644 abs/extra/community/js/js185-destdir.patch
 delete mode 100644 abs/extra/spidermonkey/PKGBUILD
 delete mode 100644 abs/extra/spidermonkey/spidermonkey-1.7-threadsafe.patch
 delete mode 100644 abs/extra/spidermonkey/spidermonkey-Makefile.patch

diff --git a/abs/extra/community/js/PKGBUILD b/abs/extra/community/js/PKGBUILD
new file mode 100644
index 0000000..35db2db
--- /dev/null
+++ b/abs/extra/community/js/PKGBUILD
@@ -0,0 +1,39 @@
+# $Id$
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+pkgname=js
+pkgver=1.8.5
+pkgrel=3
+pkgdesc="JavaScript interpreter and libraries"
+arch=(i686 x86_64)
+url="https://developer.mozilla.org/En/SpiderMonkey/1.8.5"
+license=('GPL2')
+depends=('nspr' 'gcc-libs')
+makedepends=('python2' 'zip')
+replaces=('spidermonkey')
+conflicts=('spidermonkey')
+source=(http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
+        js185-destdir.patch)
+md5sums=('a4574365938222adca0a6bd33329cb32'
+         '364834a8391888642c53d78c3a949d94')
+build() {
+  cd "$srcdir/$pkgname-$pkgver/js/src"
+
+  patch -Np0 -i $srcdir/js185-destdir.patch
+
+  ./configure --prefix=/usr --with-system-nspr \
+     --enable-threadsafe
+
+  make
+}
+
+package() {
+  cd "$srcdir/$pkgname-$pkgver/js/src"
+  make DESTDIR="$pkgdir" install
+
+  install -m 0755 shell/js ${pkgdir}/usr/bin
+
+  #cleanup
+  rm -f "${pkgdir}/usr/lib/libmozjs185-1.0.a"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/abs/extra/community/js/js-1.8.5-3.src.tar.gz b/abs/extra/community/js/js-1.8.5-3.src.tar.gz
new file mode 120000
index 0000000..c86d2e3
--- /dev/null
+++ b/abs/extra/community/js/js-1.8.5-3.src.tar.gz
@@ -0,0 +1 @@
+/data/pkg_repo/packages/js-1.8.5-3.src.tar.gz
\ No newline at end of file
diff --git a/abs/extra/community/js/js185-destdir.patch b/abs/extra/community/js/js185-destdir.patch
new file mode 100644
index 0000000..87b7b53
--- /dev/null
+++ b/abs/extra/community/js/js185-destdir.patch
@@ -0,0 +1,15 @@
+#https://bugzilla.mozilla.org/show_bug.cgi?id=628723
+
+--- Makefile.in.old	2011-04-10 04:21:19.918608008 -0700
++++ Makefile.in	2011-04-10 04:21:58.088607992 -0700
+@@ -888,8 +888,8 @@
+ 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))
diff --git a/abs/extra/spidermonkey/PKGBUILD b/abs/extra/spidermonkey/PKGBUILD
deleted file mode 100644
index e923cbe..0000000
--- a/abs/extra/spidermonkey/PKGBUILD
+++ /dev/null
@@ -1,31 +0,0 @@
-# $Id: PKGBUILD 55903 2009-10-15 23:18:35Z andrea $
-# Contributor: Aaron Griffin <aaron@archlinux.org>
-
-pkgname=spidermonkey
-pkgver=1.7.0
-pkgrel=3
-pkgdesc="Mozilla's C implementation of JavaScript."
-arch=("i686" "x86_64")
-url="http://www.mozilla.org/js/spidermonkey/"
-license=('MPL' 'GPL' 'LGPL')
-depends=('nspr')
-options=('!makeflags')
-source=("http://ftp.mozilla.org/pub/mozilla.org/js/js-$pkgver.tar.gz" \
-	"spidermonkey-1.7-threadsafe.patch" "spidermonkey-Makefile.patch")
-md5sums=('5571134c3863686b623ebe4e6b1f6fe6'
-	'b2ef9be017b6aa1857354b5223975a4f'
-	'161d4c0f2c604d15cba29dab60b1f7a7')
-
-build() {
-  cd "$srcdir/js/src"
-  patch -p0 < "$srcdir/spidermonkey-Makefile.patch" || return 1
-  sed -i 's|include|include/js|' rules.mk || return 1
-  # fix for the lib location
-  [ "$CARCH" = "x86_64" ] && (sed -i -e "s:lib64:lib:g" config.mk || return 1)
-  # patch Makefile for threadsafe support with native nspr
-  patch -p2 -i "$srcdir/spidermonkey-1.7-threadsafe.patch" || return 1
-  # FS#16673
-  export CFLAGS="${CFLAGS} -DJS_C_STRINGS_ARE_UTF8"
-  # build - threadsafe
-  make -f Makefile.ref BUILD_OPT=1 JS_THREADSAFE=1 DIST="$pkgdir/usr" all export || return 1
-}
diff --git a/abs/extra/spidermonkey/spidermonkey-1.7-threadsafe.patch b/abs/extra/spidermonkey/spidermonkey-1.7-threadsafe.patch
deleted file mode 100644
index da6c78d..0000000
--- a/abs/extra/spidermonkey/spidermonkey-1.7-threadsafe.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- js/src/Makefile.ref.orig	2008-05-28 19:51:32.000000000 -0400
-+++ js/src/Makefile.ref	2008-05-28 19:52:17.000000000 -0400
-@@ -63,11 +63,11 @@
- 
- ifdef JS_THREADSAFE
- DEFINES += -DJS_THREADSAFE
--INCLUDES += -I$(DIST)/include/nspr
-+INCLUDES += -I/usr/include/nspr
- ifdef USE_MSVC
- OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
- else
--OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
-+OTHER_LIBS += -L/usr/$(LIBDIR)/nspr -lnspr${NSPR_LIBSUFFIX}
- endif
- endif
- 
diff --git a/abs/extra/spidermonkey/spidermonkey-Makefile.patch b/abs/extra/spidermonkey/spidermonkey-Makefile.patch
deleted file mode 100644
index abf1f31..0000000
--- a/abs/extra/spidermonkey/spidermonkey-Makefile.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-*** Makefile.ref.orig	2009-02-16 09:56:29.000000000 -0600
---- Makefile.ref	2009-02-16 09:58:59.000000000 -0600
-***************
-*** 169,184 ****
---- 169,185 ----
-  	jstypes.h	\
-  	jsprvtd.h	\
-  	jspubtd.h	\
-  	jsregexp.h	\
-  	jsscan.h	\
-  	jsscope.h	\
-  	jsscript.h	\
-  	jsstr.h		\
-+ 	jsutil.h        \
-  	jsxdrapi.h	\
-  	jsxml.h		\
-  	$(NULL)
-  
-  API_HFILES =		\
-  	jsapi.h		\
-  	jsdbgapi.h	\
-  	$(NULL)
-- 
cgit v0.12