summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2020-08-23 22:29:47 +0000
committerhe <he@pkgsrc.org>2020-08-23 22:29:47 +0000
commit36c2e5f06b6aea3ac7dc456a23a86a8a1595e58b (patch)
tree20ec1ceaf9f545fd0b480db6d8e36fc8b81f96d5
parent510c5becd1d2ec9b11375b6d4c0a2477533e26b0 (diff)
downloadpkgsrc-36c2e5f06b6aea3ac7dc456a23a86a8a1595e58b.tar.gz
Make this build on NetBSD/powerpc:
* c++ doesn't predefine __ppc__, only __powerpc__. Compensate. * On NetBSD/powerpc, use libatomic for access to 64-bit atomics. PKGREVISION not bumped; build fix for NetBSD/powerpc, should not affect others.
-rw-r--r--lang/mozjs60/Makefile8
-rw-r--r--lang/mozjs60/distinfo4
-rw-r--r--lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h15
-rw-r--r--lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h15
4 files changed, 40 insertions, 2 deletions
diff --git a/lang/mozjs60/Makefile b/lang/mozjs60/Makefile
index a63dae93066..ffb6b989996 100644
--- a/lang/mozjs60/Makefile
+++ b/lang/mozjs60/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2020/06/02 08:22:45 adam Exp $
+# $NetBSD: Makefile,v 1.10 2020/08/23 22:29:47 he Exp $
DISTNAME= mozjs60_60.8.0.orig
PKGNAME= ${DISTNAME:S/_/-/:S/.orig//}
@@ -56,6 +56,12 @@ post-install:
${CHMOD} -x ${DESTDIR}${PREFIX}/include/mozjs-60/js-config.h
${CHMOD} -x ${DESTDIR}${PREFIX}/lib/pkgconfig/mozjs-60.pc
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc)
+# 64 bit atomics
+.include "../../devel/libatomic/buildlink3.mk"
+.endif
.include "../../devel/zlib/buildlink3.mk"
.include "../../lang/python/tool.mk"
.include "../../textproc/icu/buildlink3.mk"
diff --git a/lang/mozjs60/distinfo b/lang/mozjs60/distinfo
index 31b2fbdf8cc..391ae2c05a8 100644
--- a/lang/mozjs60/distinfo
+++ b/lang/mozjs60/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2020/05/28 15:26:23 triaxx Exp $
+$NetBSD: distinfo,v 1.7 2020/08/23 22:29:47 he Exp $
SHA1 (mozjs60_60.8.0.orig.tar.xz) = b66207ee477c110995029f173e6b026f2e013591
RMD160 (mozjs60_60.8.0.orig.tar.xz) = fef033969a51dc56c84669d33401f60bd499de6d
@@ -9,6 +9,8 @@ SHA1 (patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py) = dda670432
SHA1 (patch-.._.._python_mozbuild_mozbuild_virtualenv.py) = 231d96ae8f66da1db36a4371c28d97a4db4c0f5c
SHA1 (patch-.._public_TypeDecls.h) = 846e0707755cbe7e97cc380f66bfe6da0daf996e
SHA1 (patch-gc_Memory.cpp) = ba865bee4b99ce6298404b41b465b281fd23555f
+SHA1 (patch-js_src_jit_AtomicOperations.h) = fc9ff5be98f045500675a73c34eaa9855cea2bec
+SHA1 (patch-js_src_jit_none_AtomicOperations-feeling-lucky.h) = 06108aad94437a12b2b80491dab917fe4bb0de37
SHA1 (patch-jsdate.cpp) = f9314460476ffbc00fe85a75bddc964807d0153f
SHA1 (patch-threading_posix_Thread.cpp) = c48a642fa98d8112c149142a4af4ac633d3ae332
SHA1 (patch-util_NativeStack.cpp) = 68d2d80291a856c74bac2e6870317f143bb61355
diff --git a/lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h b/lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h
new file mode 100644
index 00000000000..49341175875
--- /dev/null
+++ b/lang/mozjs60/patches/patch-js_src_jit_AtomicOperations.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-js_src_jit_AtomicOperations.h,v 1.1 2020/08/23 22:29:47 he Exp $
+
+Oddly, C++ on NetBSD/powerpc doesn't predefine __ppc__, only __powerpc__.
+
+--- jit/AtomicOperations.h.orig 2019-07-01 09:07:41.000000000 +0000
++++ jit/AtomicOperations.h
+@@ -378,7 +378,7 @@ inline bool AtomicOperations::isLockfree
+ #else
+ #error "No AtomicOperations support for this platform+compiler combination"
+ #endif
+-#elif defined(__ppc__) || defined(__PPC__)
++#elif defined(__ppc__) || defined(__PPC__) || defined(__powerpc__)
+ #include "jit/none/AtomicOperations-feeling-lucky.h"
+ #elif defined(__sparc__)
+ #include "jit/none/AtomicOperations-feeling-lucky.h"
diff --git a/lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h b/lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h
new file mode 100644
index 00000000000..b1af9478fca
--- /dev/null
+++ b/lang/mozjs60/patches/patch-js_src_jit_none_AtomicOperations-feeling-lucky.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-js_src_jit_none_AtomicOperations-feeling-lucky.h,v 1.1 2020/08/23 22:29:47 he Exp $
+
+C++ on NetBSD/powerpc doesn't predefine __ppc__, only __powerpc__. Compensate.
+
+--- jit/none/AtomicOperations-feeling-lucky.h.orig 2019-07-01 09:07:41.000000000 +0000
++++ jit/none/AtomicOperations-feeling-lucky.h
+@@ -39,7 +39,7 @@
+ // want WebAssembly support you can always just lie about the lock-freedom.
+ // After all, you're already feeling lucky.
+
+-#if defined(__ppc__) || defined(__PPC__)
++#if defined(__ppc__) || defined(__PPC__) || defined(__powerpc__)
+ #define GNUC_COMPATIBLE
+ #endif
+