Skip to content
Permalink
Browse files

mozjs60: new port

Installs in parallel with mozjs52 without conflicts.
  • Loading branch information
dbevans committed Apr 27, 2019
1 parent f9fbf4e commit 6fb74a5227bd46999e2c2a08d0081f7cde0713e0
Showing with 113 additions and 0 deletions.
  1. +95 −0 lang/mozjs60/Portfile
  2. +9 −0 lang/mozjs60/files/patch-js-config.in.diff
  3. +9 −0 lang/mozjs60/files/patch-js.pc.in.diff
@@ -0,0 +1,95 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim: fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup muniversal 1.0
PortGroup cxx11 1.1
PortGroup compiler_blacklist_versions 1.0

name mozjs60
version 60.1.0
categories lang
platforms darwin
license {MPL-2 LGPL-2.1+}
maintainers {devans @dbevans} openmaintainer
description JavaScript-C Engine
long_description SpiderMonkey is Mozilla's JavaScript engine written in C/C++. \
It is used in various Mozilla products, including Firefox, \
and is available under the MPL2.

homepage https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
# build from GNOME releng tarball
master_sites http://ftp.gnome.org/pub/GNOME/teams/releng/tarballs-needing-help/mozjs/

distname mozjs-${version}
use_bzip2 yes

checksums rmd160 b9f9c5d77331c4b025f1ae1e80a01a661464aaa1 \
sha256 834ffe877fdbbd81315ae3c101221fa404096c354483a86c1a02ece19fca68fd \
size 32494225

depends_build port:autoconf213 \
port:pkgconfig \
port:python27 \
port:yasm

depends_lib port:nspr \
port:xorg-libX11 \
port:xorg-libXt

# requires C++14 compiler to build
compiler.blacklist *gcc-3.* *gcc-4.* {clang < 700}

if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
depends_build-append port:cctools
configure.env-append AR=${prefix}/bin/ar
}

patchfiles patch-js.pc.in.diff \
patch-js-config.in.diff

# Use absolute path for install_name
post-patch {
reinplace "s|@executable_path|${prefix}/lib|g" ${worksrcpath}/config/rules.mk
}

configure.perl /usr/bin/perl
configure.python ${prefix}/bin/python2.7

configure.env-append \
SHELL=/bin/bash

configure.dir ${worksrcpath}/js/src/obj
configure.cmd ../configure

configure.args --with-system-nspr \
--disable-readline

build.env-append SHELL=/bin/bash
build.dir ${worksrcpath}/js/src/obj
destroot.dir ${worksrcpath}/js/src/obj

post-destroot {
# make static lib name version specific to avoid conflict with other mozjs versions
move ${destroot}${prefix}/lib/libjs_static.ajs ${destroot}${prefix}/lib/libjs60_static.ajs
# mozjs60 builds and links with libmozglue.dylib but fails to install it
xinstall -m 0755 ${worksrcpath}/js/src/obj/mozglue/build/libmozglue.dylib ${destroot}${prefix}/lib
}

if {[variant_isset universal]} {
set merger_host(x86_64) x86_64-apple-${os.platform}${os.major}
set merger_host(i386) i686-apple-${os.platform}${os.major}
set merger_configure_args(x86_64) "--build=x86_64-apple-${os.platform}${os.major} --target=x86_64-apple-${os.platform}${os.major}"
set merger_configure_args(i386) "--build=i686-apple-${os.platform}${os.major} --target=i686-apple-${os.platform}${os.major}"
} else {
if {${build_arch} eq "i386"} {
configure.args-append \
--host=i686-apple-${os.platform}${os.major} \
--target=i686-apple-${os.platform}${os.major}
} elseif {${build_arch} eq "x86_64"} {
configure.args-append \
--host=${build_arch}-apple-${os.platform}${os.major} \
--target=${build_arch}-apple-${os.platform}${os.major}
}
}

livecheck.type none
@@ -0,0 +1,9 @@
--- js/src/build/js-config.in.orig 2019-04-28 17:15:22.000000000 -0700
+++ js/src/build/js-config.in 2019-04-28 17:20:57.000000000 -0700
@@ -112,5 +112,5 @@
fi

if test "$echo_libs" = "yes"; then
- echo "$MOZ_JS_LIBS $JS_CONFIG_LIBS"
+ echo "$MOZ_JS_LIBS $JS_CONFIG_LIBS -lmozglue"
fi
@@ -0,0 +1,9 @@
--- js/src/build/js.pc.in.orig 2019-04-28 16:40:01.000000000 -0700
+++ js/src/build/js.pc.in 2019-04-28 16:41:44.000000000 -0700
@@ -7,5 +7,5 @@
Description: The Mozilla library for JavaScript
Version: @MOZILLA_VERSION@
@PKGCONF_REQUIRES_PRIVATE@
-Libs: -L${libdir} -l@JS_LIBRARY_NAME@
+Libs: -L${libdir} -l@JS_LIBRARY_NAME@ -lmozglue
Cflags: -include ${includedir}/@JS_LIBRARY_NAME@/js/RequiredDefines.h -I${includedir}/@JS_LIBRARY_NAME@

0 comments on commit 6fb74a5

Please sign in to comment.
You can’t perform that action at this time.