Mercurial > vanilla
changeset 489:ba543d44b357
lang/mozjs52: initial import, closes #1580
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 07 Apr 2019 14:37:20 +0200 |
parents | a766a7ab4d35 |
children | dbffca6c243e |
files | lang/mozjs52/mozjs52.sh lang/mozjs52/patch-clang.patch |
diffstat | 2 files changed, 80 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lang/mozjs52/mozjs52.sh Sun Apr 07 14:37:20 2019 +0200 @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Copyright (c) 2019 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +PKGNAME=mozjs52 +PKGVERSION=52.9.0 +PKGREVISION=1 +PKGLICENSE="MPLv20" +PKGSUMMARY="Mozilla Javascript engine also know as SpiderMonkey" +PKGDOWNLOAD="http://releases.mozilla.org/pub/firefox/releases/${PKGVERSION}esr/source/firefox-${PKGVERSION}esr.source.tar.xz" +PKGDEPENDS="shells/bash:build python/python2:build lib/libffi lib/icu lib/zlib" + +: ${CC:=clang} +: ${CXX:=clang++} + +build() +{ + rm -rf firefox-${PKGVERSION}esr + tar xvaf firefox-${PKGVERSION}esr.source.tar.xz + pushd firefox-${PKGVERSION}esr + + # credits to FreeBSD. + patch -p0 < ../patch-clang.patch + pushd js/src + CC="$CC" HOST_CC="$CC" \ + CXX="$CXX" HOST_CXX="$CXX" \ + SHELL="/usr/bin/bash" PYTHON="/usr/bin/python2" \ + ./configure \ + --prefix=/usr \ + --disable-tests \ + --disable-jemalloc \ + --enable-shared-js \ + --enable-ctypes \ + --with-system-icu \ + --with-system-nspr \ + --with-system-zlib + SHELL="/usr/bin/bash" PYTHON="/usr/bin/python2" \ + make + make install DESTDIR=$DESTDIR + popd + + popd + rm -rf firefox-${PKGVERSION}esr +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lang/mozjs52/patch-clang.patch Sun Apr 07 14:37:20 2019 +0200 @@ -0,0 +1,23 @@ +Proposed workaround/fix for: +https://bugzilla.mozilla.org/show_bug.cgi?id=1426865 + +diff --git a/js/public/TypeDecls.h b/js/public/TypeDecls.h +index acb93f9..cbd4b04 100644 +--- js/public/TypeDecls.h ++++ js/public/TypeDecls.h +@@ -22,6 +22,8 @@ + + #include "js-config.h" + ++#pragma GCC visibility push(default) ++ + struct JSContext; + class JSFunction; + class JSObject; +@@ -76,4 +78,6 @@ typedef PersistentRooted<Value> PersistentRootedValue; + + } // namespace JS + ++#pragma GCC visibility pop ++ + #endif /* js_TypeDecls_h */