blob: 4c1aa3447ad3123bccd509bdc5e7981161237668 [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "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://0005-nojit-32bit-arch-fix.patch \
15 file://0006-Fix-build-on-powerpc.patch \
16 file://0001-util.configure-fix-one-occasionally-reproduced-confi.patch \
17 file://0001-rewrite-cargo-host-linker-in-python3.patch \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050018 file://py-3.11.patch \
Andrew Geissler595f6302022-01-24 19:11:47 +000019 "
Andrew Geissler87f5cff2022-09-30 13:13:31 -050020SRC_URI[sha256sum] = "53be2bcde0b5ee3ec106bd8ba06b8ae95e7d489c484e881dfbe5360e4c920762"
Andrew Geissler595f6302022-01-24 19:11:47 +000021
22S = "${WORKDIR}/firefox-${@d.getVar("PV").replace("esr", "")}"
23
24inherit pkgconfig perlnative python3native rust
25
Patrick Williams03907ee2022-05-01 06:28:52 -050026DEPENDS += "zlib cargo-native python3 icu"
27DEPENDS:remove:mipsarch = "icu"
28DEPENDS:remove:powerpc:toolchain-clang = "icu"
Andrew Geissler595f6302022-01-24 19:11:47 +000029
30B = "${WORKDIR}/build"
31
32export PYTHONPATH = "${S}/build:${S}/third_party/python/PyYAML/lib3:${S}/testing/mozbase/mozfile:${S}/python/mozboot:${S}/third_party/python/distro:${S}/testing/mozbase/mozinfo:${S}/config:${S}/testing/mozbase/manifestparser:${S}/third_party/python/pytoml:${S}/testing/mozbase/mozprocess:${S}/third_party/python/six:${S}/python/mozbuild:${S}/python/mozbuild/mozbuild:${S}/python/mach:${S}/third_party/python/jsmin:${S}/python/mozversioncontrol"
33
34export HOST_CC = "${BUILD_CC}"
35export HOST_CXX = "${BUILD_CXX}"
36export HOST_CFLAGS = "${BUILD_CFLAGS}"
37export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}"
38export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
39
40export AS = "${CC}"
41
42export RUSTFLAGS
43
44JIT ?= ""
Andrew Geissler595f6302022-01-24 19:11:47 +000045JIT:mipsarch = "--disable-jit"
Patrick Williams03907ee2022-05-01 06:28:52 -050046ICU ?= "--with-system-icu"
47ICU:mipsarch = ""
48ICU:powerpc:toolchain-clang = ""
Andrew Geissler595f6302022-01-24 19:11:47 +000049
50do_configure() {
51 cd ${B}
52 python3 ${S}/configure.py \
53 --enable-project=js \
Patrick Williams92b42cb2022-09-03 06:53:57 -050054 --target=${RUST_HOST_SYS} \
Andrew Geissler595f6302022-01-24 19:11:47 +000055 --host=${BUILD_SYS} \
56 --prefix=${prefix} \
57 --libdir=${libdir} \
58 --disable-jemalloc \
Patrick Williams03907ee2022-05-01 06:28:52 -050059 --disable-strip \
60 ${JIT} \
61 ${ICU}
Andrew Geissler595f6302022-01-24 19:11:47 +000062}
63
64do_install() {
65 oe_runmake 'DESTDIR=${D}' install
66}
67
68inherit multilib_script multilib_header
69
70MULTILIB_SCRIPTS += " ${PN}-dev:${bindir}/js91-config"
71
72do_install:append() {
73 oe_multilib_header mozjs-91/js-config.h
74 sed -e 's@${STAGING_DIR_HOST}@@g' \
75 -i ${D}${bindir}/js91-config
76 rm -f ${D}${libdir}/libjs_static.ajs
77}
78
79PACKAGES =+ "lib${BPN}"
80FILES:lib${BPN} += "${libdir}/lib*"