# -*- 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
PortGroup compiler_blacklist_versions 1.0
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}gnome1
checksums rmd160 b8815d4e62c36c41dc4e568d44a7430a4da2c86e \
sha256 786647e0ee743ab8ebd67d307ab406f93d50363ead7d7d05e29eeb113ebbf525 \
depends_build port:autoconf213 \
# When modifying this blacklist, also update the gjs blacklist.
# Requires clang-3.6 or equivalent
# While clang-602.0.53 (Xcode 6.4) is based on 3.6, it apparently doesn't pass the configure check
compiler.blacklist *gcc-3.* *gcc-4.* {clang < 700} macports-clang-3.3 macports-clang-3.4
compiler.fallback-append macports-clang-5.0 macports-clang-3.7
if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
depends_build-append port:cctools
configure.env-append AR=${prefix}/bin/ar
# Use absolute path for install_name
reinplace "s|@executable_path|${prefix}/lib|g" ${worksrcpath}/config/rules.mk
configure.perl /usr/bin/perl
configure.python ${prefix}/bin/python2.7
configure.dir ${worksrcpath}/js/src/obj
configure.cmd ../configure
configure.args --with-system-icu \
build.env-append SHELL=/bin/bash
build.dir ${worksrcpath}/js/src/obj
destroot.dir ${worksrcpath}/js/src/obj
variant readline description {Link js shell to system readline library} {
depends_lib-append port:readline
configure.args-replace --disable-readline --enable-readline
variant llvm_hacks description {Enable workarounds required for several LLVM instrumentations} {
configure.args-append --enable-llvm-hacks
variant profiling description {Set compile flags necessary for using sampling profilers (e.g. shark, perf)} {
configure.args-append --enable-profiling
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}"