Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-lang/spidermonkey/Manifest
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DIST spidermonkey-140.6.0.tar.xz 643086844 BLAKE2B 1613e232f6d423c2758122148eb0575496002dc8bb8ae82ed850275621904f9a50581fc1b82395e57fb4f6ca221d32672c33956a09b87ba4c094aae408a11c0c SHA512 ed66657bd4b2d94791892261d7c0c0d950b4f630d12ab28a777d93393427451a9aa125e5a01ee15f2ac0ff378d0be074a08583dcffd35609112ba4e6f9ada798
DIST spidermonkey-140.8.0.tar.xz 633564864 BLAKE2B dbbf560ae20c6eb384cce577d49fc71152dc3c72dde64efadfa12d975dda2e13aa1c6da7517e435d3e72b0501f440a5cb3a35a75796a42256627620572bf85f3 SHA512 3baca73c5c264884afa4b1d76ded4417119640e1161b8fed4ca406f0ec44e7f685258f5085f473dc9eff9057a6548a9b59cec3c696358dd1032503aa75f91d05
DIST spidermonkey-140.9.0.tar.xz 630445704 BLAKE2B adc5fbbfcb185355bda8055c986033477a64f806b0a7566e24dae1b3ce6bfd5830d08982240e3dec09e3efd37e6364c5495e9f5ebe05f4c06d7c4c7d848c1cab SHA512 bc03fd2a73d00a88bd0a3c9eeaefe618ffb34226fb7bc2fac4a02246ff29fe038423bf77538273ee6fac25fb1e3e4fa98bb522026ae3427a0ad5f41d2ec6ba98
DIST spidermonkey-140.9.1.tar.xz 634745800 BLAKE2B 2a8babb3060867fbc8d7a9656b514d6046ed748a2370d92d08c27d9db86c55858656d5b60ab5b016abd9b5283678c176664a34cdefbf9a90e5523e79cd662498 SHA512 119a4e4e536fd4534adcc4a546a988e553285f9326bf16e9771854ec2dc7d039a729aedc5925623e172260a5e154172c56a011f131068736eb2a89a8de611840
201 changes: 201 additions & 0 deletions dev-lang/spidermonkey/spidermonkey-140.9.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
# Distributed under the terms of the GNU General Public License v2
# Autogen by MARK Devkit

EAPI=7
PYTHON_COMPAT=( python3+ )
inherit check-reqs flag-o-matic multiprocessing toolchain-funcs python-any-r1 xdg

DESCRIPTION="Mozilla's JavaScript engine written in C and C++"
HOMEPAGE="https://spidermonkey.dev"
SRC_URI="https://archive.mozilla.org/pub/firefox/releases/140.9.1esr/source/firefox-140.9.1esr.source.tar.xz -> spidermonkey-140.9.1.tar.xz"
SLOT="0"
KEYWORDS="*"
IUSE="+clang cpu_flags_arm_neon debug +jit icu"
BDEPEND="${PYTHON_DEPS}
app-arch/unzip
app-arch/zip
virtual/rust
|| (
(
sys-devel/clang:20
sys-devel/llvm:20
clang? (
sys-devel/lld
)
)
)
dev-util/cbindgen
virtual/pkgconfig

"
RDEPEND="icu? (
>=dev-libs/icu-76.1:=
)
dev-libs/nspr
sys-libs/readline:=
sys-libs/zlib
!dev-lang/spidermonkey:78

"
DEPEND="${RDEPEND}
"
S="${WORKDIR}/firefox-140.9.1"
mozconfig_add_options_ac() {
local reason=${1}
shift
local option
for option in ${@} ; do
echo "ac_add_options ${option} # ${reason}" >>${MOZCONFIG}
done
}
mozconfig_add_options_mk() {
local reason=${1}
shift
local option
for option in ${@} ; do
echo "mk_add_options ${option} # ${reason}" >>${MOZCONFIG}
done
}
mozconfig_use_enable() {
local flag=$(use_enable "${@}")
mozconfig_add_options_ac "$(use ${1} && echo +${1} || echo -${1})" "${flag}"
}
pkg_pretend() {
CHECKREQS_DISK_BUILD="4300M"
check-reqs_pkg_pretend
}
pkg_setup() {
python-any-r1_pkg_setup
# Build system is using /proc/self/oom_score_adj, bug #604394
addpredict /proc/self/oom_score_adj
# Ensure we use C locale when building, bug #746215
export LC_ALL=C
}
src_prepare() {
default
eapply_user
# Make cargo respect MAKEOPTS
export CARGO_BUILD_JOBS="$(makeopts_jobs)"
# sed-in toolchain prefix
sed -i \
-e "s/objdump/${CHOST}-objdump/" \
python/mozbuild/mozbuild/configure/check_debug_ranges.py ||
die "sed failed to set toolchain prefix"
einfo "Removing pre-built binaries ..."
find third_party -type f \( -name '*.so' -o -name '*.o' \) -print -delete || die
# Create build dir
BUILD_DIR="${WORKDIR}/${PN}_build"
mkdir -p "${BUILD_DIR}" || die
xdg_environment_reset
}
src_configure() {
if use clang; then
extra_cflags="-I/usr/lib/clang/20/include/"
export CPPFLAGS="-I/usr/lib/clang/20/include/"
local -x CC=${CHOST}-clang
local -x CXX=${CHOST}-clang++
strip-unsupported-flags
fi
tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
# Pass the correct toolchain paths through cbindgen
if tc-is-cross-compiler ; then
export BINDGEN_CFLAGS="${SYSROOT:+--sysroot=${ESYSROOT}} --target=${CHOST} ${BINDGEN_CFLAGS-}"
fi
# Set MOZILLA_FIVE_HOME
export MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
# python/mach/mach/mixin/process.py fails to detect SHELL
export SHELL="${EPREFIX}/bin/bash"
# Set state path
export MOZBUILD_STATE_PATH="${BUILD_DIR}"
# Set MOZCONFIG
export MOZCONFIG="${S}/.mozconfig"
# Initialize MOZCONFIG
mozconfig_add_options_ac '' --enable-project=js
mozconfig_add_options_ac 'MacaroniOS default' \
--host="${CBUILD:-${CHOST}}" \
--target="${CHOST}" \
--disable-jemalloc \
--disable-strip \
--enable-readline \
--enable-release \
--enable-shared-js \
--libdir="${EPREFIX}/usr/$(get_libdir)" \
--prefix="${EPREFIX}/usr" \
--with-intl-api \
--with-system-nspr \
--with-system-zlib \
--with-toolchain-prefix="${CHOST}-"
if use icu ; then
# Require >=icu-71. Disable by default for now.
mozconfig_add_options_ac 'MacaroniOS default' \
--with-system-icu
fi
mozconfig_use_enable debug
mozconfig_use_enable jit
mozconfig_add_options_ac '' --disable-tests
if use debug ; then
mozconfig_add_options_ac '+debug' --disable-optimize
mozconfig_add_options_ac '+debug' --enable-debug-symbols
else
mozconfig_add_options_ac '-debug' --enable-optimize
mozconfig_add_options_ac '-debug' --disable-debug-symbols
fi
# We always end up disabling this at some point due to newer rust versions. bgo#933372
mozconfig_add_options_ac '--disable-rust-simd' --disable-rust-simd
# Modifications to better support ARM, bug 717344
if use cpu_flags_arm_neon ; then
mozconfig_add_options_ac '+cpu_flags_arm_neon' --with-fpu=neon
if ! tc-is-clang ; then
# thumb options aren't supported when using clang, bug 666966
mozconfig_add_options_ac '+cpu_flags_arm_neon' --with-thumb=yes
mozconfig_add_options_ac '+cpu_flags_arm_neon' --with-thumb-interwork=no
fi
fi
# LTO flag was handled via configure
filter-lto
# Pass MAKEOPTS to build system
export MOZ_MAKE_FLAGS="${MAKEOPTS}"
# Use system's Python environment
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE="none"
export PIP_NETWORK_INSTALL_RESTRICTED_VIRTUALENVS=mach
# Disable notification when build system has finished
export MOZ_NOSPAM=1
# Portage sets XARGS environment variable to "xargs -r" by default which
# breaks build system's check_prog() function which doesn't support arguments
mozconfig_add_options_ac 'MacaroniOS default' "XARGS=${EPREFIX}/usr/bin/xargs"
# Set build dir
mozconfig_add_options_mk 'MacaroniOS default' "MOZ_OBJDIR=${BUILD_DIR}"
# Show flags we will use
einfo "Build BINDGEN_CFLAGS:\t${BINDGEN_CFLAGS:-no value set}"
einfo "Build CFLAGS: ${CFLAGS}"
einfo "Build CXXFLAGS: ${CXXFLAGS}"
einfo "Build LDFLAGS: ${LDFLAGS}"
einfo "Build RUSTFLAGS: ${RUSTFLAGS}"
./mach configure || die
}
src_compile() {
./mach build --verbose || die
}
src_install() {
local mypn="mozjs"
local mymajor="140"
cd "${BUILD_DIR}" || die
default
# fix soname links
pushd "${ED}"/usr/$(get_libdir) &>/dev/null || die
mv lib${mypn}-${mymajor}.so lib${mypn}-${mymajor}.so.0.0.0 || die
ln -s lib${mypn}-${mymajor}.so.0.0.0 lib${mypn}-${mymajor}.so.0 || die
ln -s lib${mypn}-${mymajor}.so.0 lib${mypn}-${mymajor}.so || die
popd &>/dev/null || die
# remove unneeded files
rm \
"${ED}"/usr/bin/js${mymajor}-config \
"${ED}"/usr/$(get_libdir)/libjs_static.ajs || die
# fix permissions
chmod -x \
"${ED}"/usr/$(get_libdir)/pkgconfig/*.pc \
"${ED}"/usr/include/mozjs-${mymajor}/js-config.h || die
}


# vim: filetype=ebuild