From b4b0e51c3d581e4d271d58e445fdfeeb728c04bc Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Sat, 6 Aug 2011 23:53:15 -0500
Subject: js: Roll back to v1.7.0 for perl-javascript dep of shepherd. refs
 #383

---
 abs/extra/community/js/PKGBUILD                    | 60 ++++++++++------------
 abs/extra/community/js/js185-destdir.patch         | 15 ------
 .../community/js/spidermonkey-1.7-threadsafe.patch | 16 ++++++
 abs/extra/community/js/spidermonkey-Makefile.patch | 22 ++++++++
 4 files changed, 64 insertions(+), 49 deletions(-)
 delete mode 100644 abs/extra/community/js/js185-destdir.patch
 create mode 100644 abs/extra/community/js/spidermonkey-1.7-threadsafe.patch
 create mode 100644 abs/extra/community/js/spidermonkey-Makefile.patch

diff --git a/abs/extra/community/js/PKGBUILD b/abs/extra/community/js/PKGBUILD
index 35db2db..d55295c 100644
--- a/abs/extra/community/js/PKGBUILD
+++ b/abs/extra/community/js/PKGBUILD
@@ -1,39 +1,31 @@
-# $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')
+pkgver=1.7.0
+pkgrel=1
+epoch=1
+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')
 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
-}
+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')
 
-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"
+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
 }
-
-# vim:set ts=2 sw=2 et:
diff --git a/abs/extra/community/js/js185-destdir.patch b/abs/extra/community/js/js185-destdir.patch
deleted file mode 100644
index 87b7b53..0000000
--- a/abs/extra/community/js/js185-destdir.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-#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/community/js/spidermonkey-1.7-threadsafe.patch b/abs/extra/community/js/spidermonkey-1.7-threadsafe.patch
new file mode 100644
index 0000000..da6c78d
--- /dev/null
+++ b/abs/extra/community/js/spidermonkey-1.7-threadsafe.patch
@@ -0,0 +1,16 @@
+--- 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/community/js/spidermonkey-Makefile.patch b/abs/extra/community/js/spidermonkey-Makefile.patch
new file mode 100644
index 0000000..abf1f31
--- /dev/null
+++ b/abs/extra/community/js/spidermonkey-Makefile.patch
@@ -0,0 +1,22 @@
+*** 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


From 504fe7ac25d218a6f2f0064386ffb76ad1a7b0ae Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Sun, 7 Aug 2011 00:08:34 -0500
Subject: perl-javascript: Change js dep version to stop breakage. refs #383

---
 abs/core/perl_modules/perl-javascript/PKGBUILD | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/abs/core/perl_modules/perl-javascript/PKGBUILD b/abs/core/perl_modules/perl-javascript/PKGBUILD
index 615d90d..5be227c 100644
--- a/abs/core/perl_modules/perl-javascript/PKGBUILD
+++ b/abs/core/perl_modules/perl-javascript/PKGBUILD
@@ -2,7 +2,7 @@ pkgname=perl-javascript
 pkgver=1.16
 pkgrel=2
 pkgdesc="Perl extension for executing embedded JavaScript"
-depends=('perl>=5.10.0' 'glibc' 'perl-test-exception' 'js' 'xulrunner' 'nspr')
+depends=('perl>=5.10.0' 'glibc' 'perl-test-exception' 'js<=1:1.7.0' 'xulrunner' 'nspr')
 license=('GPL' 'PerlArtistic')
 url="http://search.cpan.org/dist/JavaScript/"
 source=(http://search.cpan.org/CPAN/authors/id/C/CL/CLAESJAC/JavaScript-$pkgver.tar.gz)
-- 
cgit v0.12


From 3c5fe5191d2541cbbd804b52e427d6a5f5722561 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Sun, 7 Aug 2011 00:29:46 -0500
Subject: shepherd: Bump to latest

---
 abs/extra/shepherd/PKGBUILD | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/abs/extra/shepherd/PKGBUILD b/abs/extra/shepherd/PKGBUILD
index 34f45ff..735fef5 100644
--- a/abs/extra/shepherd/PKGBUILD
+++ b/abs/extra/shepherd/PKGBUILD
@@ -1,16 +1,17 @@
 # $Id: PKGBUILD 23123 2009-01-03 02:43:02Z kevin $
 # Maintainer: Greg Frost <gregfrost1@bigpond.com>
 pkgname=shepherd
-pkgver=1.45
+pkgver=1.5.1
 pkgrel=1
 pkgdesc="Australian EPG Grabber."
 license=('unknown')
 arch=('i686')
-depends=(perl-pathtools perl-digest-sha1 perl-algorithm-diff perl-javascript perl-list-compare)
+depends=('perl-pathtools' 'perl-digest-sha1' 'perl-algorithm-diff' 
+         'perl-javascript' 'perl-list-compare')
 source=(http://www.whuffy.com/shepherd/shepherd)
 
 build() {
     mkdir -p ${pkgdir}/usr/bin/
     install -m 0755 shepherd ${pkgdir}/usr/bin/
 }
-md5sums=('09d201253e0a41ed28999a97845001f0')
+md5sums=('ca37aff5606acfebc341525eac825449')
-- 
cgit v0.12


From f6cb11445db39ac6c33047426893107a54520bb9 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Sun, 7 Aug 2011 00:43:29 -0500
Subject: perl-pathtools: Bump to latest

---
 abs/core/perl_modules/perl-pathtools/PKGBUILD | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/abs/core/perl_modules/perl-pathtools/PKGBUILD b/abs/core/perl_modules/perl-pathtools/PKGBUILD
index db11a6f..a88a231 100644
--- a/abs/core/perl_modules/perl-pathtools/PKGBUILD
+++ b/abs/core/perl_modules/perl-pathtools/PKGBUILD
@@ -1,8 +1,8 @@
 
 pkgname=perl-pathtools
-pkgver=3.29
-pkgrel=2
-pkgdesc="get name of current working directory"
+pkgver=3.33
+pkgrel=1
+pkgdesc="Current working directory (CWD) and File::Spec perl modules"
 arch=('i686' 'x86_64')
 url="http://search.cpan.org/~KWILLIAMS/Path-Class"
 
@@ -20,3 +20,4 @@ build() {
   find $startdir/pkg -name '*.pod' -delete
 }
 
+md5sums=('92f0df032c399fadef2e2e647ebc3111')
-- 
cgit v0.12

