blob: 8ade3bb4be6ec3d7bb374d267e39ffcdfbf84c63 [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 \
18 "
Patrick Williams03907ee2022-05-01 06:28:52 -050019SRC_URI[sha256sum] = "d483a853cbf5c7f93621093432e3dc0b7ed847f2a5318b964828d19f9f087f3a"
Andrew Geissler595f6302022-01-24 19:11:47 +000020
21S = "${WORKDIR}/firefox-${@d.getVar("PV").replace("esr", "")}"
22
23inherit pkgconfig perlnative python3native rust
24
Patrick Williams03907ee2022-05-01 06:28:52 -050025DEPENDS += "zlib cargo-native python3 icu"
26DEPENDS:remove:mipsarch = "icu"
27DEPENDS:remove:powerpc:toolchain-clang = "icu"
Andrew Geissler595f6302022-01-24 19:11:47 +000028
29B = "${WORKDIR}/build"
30
31export 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"
32
33export HOST_CC = "${BUILD_CC}"
34export HOST_CXX = "${BUILD_CXX}"
35export HOST_CFLAGS = "${BUILD_CFLAGS}"
36export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}"
37export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
38
39export AS = "${CC}"
40
41export RUSTFLAGS
42
43JIT ?= ""
Andrew Geissler595f6302022-01-24 19:11:47 +000044JIT:mipsarch = "--disable-jit"
Patrick Williams03907ee2022-05-01 06:28:52 -050045ICU ?= "--with-system-icu"
46ICU:mipsarch = ""
47ICU:powerpc:toolchain-clang = ""
Andrew Geissler595f6302022-01-24 19:11:47 +000048
49do_configure() {
50 cd ${B}
51 python3 ${S}/configure.py \
52 --enable-project=js \
Patrick Williams92b42cb2022-09-03 06:53:57 -050053 --target=${RUST_HOST_SYS} \
Andrew Geissler595f6302022-01-24 19:11:47 +000054 --host=${BUILD_SYS} \
55 --prefix=${prefix} \
56 --libdir=${libdir} \
57 --disable-jemalloc \
Patrick Williams03907ee2022-05-01 06:28:52 -050058 --disable-strip \
59 ${JIT} \
60 ${ICU}
Andrew Geissler595f6302022-01-24 19:11:47 +000061}
62
63do_install() {
64 oe_runmake 'DESTDIR=${D}' install
65}
66
67inherit multilib_script multilib_header
68
69MULTILIB_SCRIPTS += " ${PN}-dev:${bindir}/js91-config"
70
71do_install:append() {
72 oe_multilib_header mozjs-91/js-config.h
73 sed -e 's@${STAGING_DIR_HOST}@@g' \
74 -i ${D}${bindir}/js91-config
75 rm -f ${D}${libdir}/libjs_static.ajs
76}
77
78PACKAGES =+ "lib${BPN}"
79FILES:lib${BPN} += "${libdir}/lib*"