blob: 4d9bb0e5857f0f47665f7da3334fccb56027c012 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
2HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
3LICENSE = "MPL-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf"
5
6SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}esr/source/firefox-${PV}esr.source.tar.xz \
7 file://0001-Cargo.toml-do-not-abort-on-panic.patch \
8 file://0002-moz.configure-do-not-look-for-llvm-objdump.patch \
9 file://0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch \
10 file://0004-use-asm-sgidefs.h.patch \
11 file://fix-musl-build.patch \
12 file://0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch \
13 file://riscv32.patch \
14 file://0001-util.configure-fix-one-occasionally-reproduced-confi.patch \
15 file://0001-rewrite-cargo-host-linker-in-python3.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060016 file://musl-disable-stackwalk.patch \
Andrew Geisslerc5535c92023-01-27 16:10:19 -060017 file://0001-add-arm-to-list-of-mozinline.patch \
Patrick Williams169d7bc2024-01-05 11:33:25 -060018 file://py3.12.patch \
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060019 file://armv5.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060020 "
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060021SRC_URI[sha256sum] = "66d7e6e5129ac8e6fe83e24227dc7bb8dc42650bc53b21838e614de80d22bc66"
Andrew Geissler517393d2023-01-13 08:55:19 -060022
23S = "${WORKDIR}/firefox-${PV}"
24
25inherit pkgconfig perlnative python3native rust
26
27DEPENDS += "zlib cargo-native python3 icu"
28DEPENDS:remove:mipsarch = "icu"
29DEPENDS:remove:powerpc:toolchain-clang = "icu"
30
31B = "${WORKDIR}/build"
32
Patrick Williams169d7bc2024-01-05 11:33:25 -060033export PYTHONPATH = "${S}/build:\
34${S}/third_party/python/PyYAML/lib3:\
35${S}/testing/mozbase/mozfile:\
36${S}/python/mozboot:\
37${S}/third_party/python/distro:\
38${S}/testing/mozbase/mozinfo:\
39${S}/config:\
40${S}/testing/mozbase/manifestparser:\
41${S}/third_party/python/pytoml:\
42${S}/testing/mozbase/mozprocess:\
43${S}/third_party/python/six:\
44${S}/python/mozbuild:\
45${S}/python/mozbuild/mozbuild:\
46${S}/python/mach:\
47${S}/third_party/python/jsmin:\
48${S}/python/mozversioncontrol"
Andrew Geissler517393d2023-01-13 08:55:19 -060049
50export HOST_CC = "${BUILD_CC}"
51export HOST_CXX = "${BUILD_CXX}"
52export HOST_CFLAGS = "${BUILD_CFLAGS}"
53export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}"
54export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
55
56export AS = "${CC}"
57
58export RUSTFLAGS
59
60JIT ?= ""
61JIT:mipsarch = "--disable-jit"
62ICU ?= "--with-system-icu"
63ICU:mipsarch = ""
64ICU:powerpc:toolchain-clang = ""
65
66do_configure() {
67 cd ${B}
68 python3 ${S}/configure.py \
69 --enable-project=js \
70 --target=${RUST_HOST_SYS} \
71 --host=${BUILD_SYS} \
72 --prefix=${prefix} \
73 --libdir=${libdir} \
74 --disable-jemalloc \
75 --disable-strip \
76 ${JIT} \
77 ${ICU}
78}
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060079do_configure[cleandirs] += "${B}"
Andrew Geissler517393d2023-01-13 08:55:19 -060080
81do_install() {
82 oe_runmake 'DESTDIR=${D}' install
83}
84
85inherit multilib_script multilib_header
86
Andrew Geissler220dafd2023-10-04 10:18:08 -050087MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
88MULTILIB_SCRIPTS += "${PN}-dev:${bindir}/js${MAJ_VER}-config"
Andrew Geissler517393d2023-01-13 08:55:19 -060089
90do_install:append() {
Andrew Geissler220dafd2023-10-04 10:18:08 -050091 oe_multilib_header mozjs-${MAJ_VER}/js-config.h
Andrew Geissler517393d2023-01-13 08:55:19 -060092 sed -e 's@${STAGING_DIR_HOST}@@g' \
Andrew Geissler220dafd2023-10-04 10:18:08 -050093 -i ${D}${bindir}/js${MAJ_VER}-config
Andrew Geissler517393d2023-01-13 08:55:19 -060094 rm -f ${D}${libdir}/libjs_static.ajs
95}
96
97PACKAGES =+ "lib${BPN}"
98FILES:lib${BPN} += "${libdir}/lib*"