blob: 1269795d205cd23ccefedba3ff14abdc15c90d50 [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 Williamsf52e3dd2024-01-26 13:04:43 -060018 file://armv5.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060019 "
Patrick Williamsb58112e2024-03-07 11:16:36 -060020SRC_URI[sha256sum] = "af8086f23efc8492d286671f6035b1a915de6f4ed5c7897e40be0e1cb6b895ea"
Andrew Geissler517393d2023-01-13 08:55:19 -060021
22S = "${WORKDIR}/firefox-${PV}"
23
24inherit pkgconfig perlnative python3native rust
25
26DEPENDS += "zlib cargo-native python3 icu"
27DEPENDS:remove:mipsarch = "icu"
28DEPENDS:remove:powerpc:toolchain-clang = "icu"
29
30B = "${WORKDIR}/build"
31
Patrick Williams169d7bc2024-01-05 11:33:25 -060032export PYTHONPATH = "${S}/build:\
33${S}/third_party/python/PyYAML/lib3:\
34${S}/testing/mozbase/mozfile:\
35${S}/python/mozboot:\
36${S}/third_party/python/distro:\
37${S}/testing/mozbase/mozinfo:\
38${S}/config:\
39${S}/testing/mozbase/manifestparser:\
40${S}/third_party/python/pytoml:\
41${S}/testing/mozbase/mozprocess:\
42${S}/third_party/python/six:\
43${S}/python/mozbuild:\
44${S}/python/mozbuild/mozbuild:\
45${S}/python/mach:\
46${S}/third_party/python/jsmin:\
47${S}/python/mozversioncontrol"
Andrew Geissler517393d2023-01-13 08:55:19 -060048
49export HOST_CC = "${BUILD_CC}"
50export HOST_CXX = "${BUILD_CXX}"
51export HOST_CFLAGS = "${BUILD_CFLAGS}"
52export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}"
53export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
54
55export AS = "${CC}"
56
57export RUSTFLAGS
58
59JIT ?= ""
60JIT:mipsarch = "--disable-jit"
61ICU ?= "--with-system-icu"
62ICU:mipsarch = ""
63ICU:powerpc:toolchain-clang = ""
64
65do_configure() {
66 cd ${B}
67 python3 ${S}/configure.py \
68 --enable-project=js \
69 --target=${RUST_HOST_SYS} \
70 --host=${BUILD_SYS} \
71 --prefix=${prefix} \
72 --libdir=${libdir} \
73 --disable-jemalloc \
74 --disable-strip \
75 ${JIT} \
76 ${ICU}
77}
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060078do_configure[cleandirs] += "${B}"
Andrew Geissler517393d2023-01-13 08:55:19 -060079
80do_install() {
81 oe_runmake 'DESTDIR=${D}' install
82}
83
84inherit multilib_script multilib_header
85
Andrew Geissler220dafd2023-10-04 10:18:08 -050086MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
87MULTILIB_SCRIPTS += "${PN}-dev:${bindir}/js${MAJ_VER}-config"
Andrew Geissler517393d2023-01-13 08:55:19 -060088
89do_install:append() {
Andrew Geissler220dafd2023-10-04 10:18:08 -050090 oe_multilib_header mozjs-${MAJ_VER}/js-config.h
Andrew Geissler517393d2023-01-13 08:55:19 -060091 sed -e 's@${STAGING_DIR_HOST}@@g' \
Andrew Geissler220dafd2023-10-04 10:18:08 -050092 -i ${D}${bindir}/js${MAJ_VER}-config
Andrew Geissler517393d2023-01-13 08:55:19 -060093 rm -f ${D}${libdir}/libjs_static.ajs
94}
95
Patrick Williams03514f12024-04-05 07:04:11 -050096PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
Andrew Geissler517393d2023-01-13 08:55:19 -060097PACKAGES =+ "lib${BPN}"
98FILES:lib${BPN} += "${libdir}/lib*"