Skip to content
Closed
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,4 +1,5 @@
DIST firefox-78.15.0esr.source.tar.xz 330819568 BLAKE2B dc8785613c2f72c55d484642c89c2545765a9efbd609bc7c2cf57b4a3a06a2ea22e6959e42b5b8af867db782e8b2097a67dec858796b744e47008a8e575e2316 SHA512 ac3de735b246ce4f0e1619cd2664321ffa374240ce6843e785d79a350dc30c967996bbcc5e3b301cb3d822ca981cbea116758fc4122f1738d75ddfd1165b6378
DIST firefox-78esr-patches-19.tar.xz 88424 BLAKE2B fdc7bf8f28b3e799551a70f1cec7a695f52c4712f3b28733648fcd7dac5a599613f4c3d2cfa169266dc62b65619b7f28c0e06d32317adb8ec0056ca79c87e9f6 SHA512 3c81dadc9bf74207c4e361605127ef6141d77700c5c54f1f9cd5ad3be13df9f73c6eec2f51d779558e4bdad1e7395c6aa8943a93415bd1786d461042bc03550a
DIST spidermonkey-140.6.0.tar.xz 643086844 BLAKE2B 1613e232f6d423c2758122148eb0575496002dc8bb8ae82ed850275621904f9a50581fc1b82395e57fb4f6ca221d32672c33956a09b87ba4c094aae408a11c0c SHA512 ed66657bd4b2d94791892261d7c0c0d950b4f630d12ab28a777d93393427451a9aa125e5a01ee15f2ac0ff378d0be074a08583dcffd35609112ba4e6f9ada798
DIST spidermonkey-140.7.0.tar.xz 641146512 BLAKE2B cd5723595d1fdc0e52ab98fec5205bdc3228d367d2ca512a44a1ae98e1581bc961533a0a0fc57d468a0a10d9a1c480f28baab69def12f834eb51dd98c44cf6fe SHA512 7781b1e203130c1cdf2a0c2ecb05a9cfa824c75d467e7faca78b66bd5568c821324112aecb774883d9f447af7fa4ade36488ff1017255af5510c8f641990e472
DIST spidermonkey-78-patches-04.tar.xz 3408 BLAKE2B f2fdd4882e1e4de1908c458dc8dfedd5665ef7118f19704dabf2b2a80e2fae48813e9bc3d0c3410287e32c21e3f9d09233d8e5d15917f53aa2f60e6190cd9cdb SHA512 87ac83c0ccc05f482913b1fbf043db1878536f935f934362a47283809c0cbfdeff040206a9c18c687384b606ba8a7bd9a7c1fc3c0bcfdd620987990a33ca1fe2
201 changes: 201 additions & 0 deletions dev-lang/spidermonkey/spidermonkey-140.7.0.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.7.0esr/source/firefox-140.7.0esr.source.tar.xz -> spidermonkey-140.7.0.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.7.0"
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