blob: d38ae10b873b1596cccfd66b767f80a2f22bbdbb [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 \
16 file://py-3.11.patch \
17 file://musl-disable-stackwalk.patch \
18 "
19SRC_URI[sha256sum] = "017dd44b1285913f477074802707a4c76ed1a28270ec5a327bbb76574cc057d8"
20
21S = "${WORKDIR}/firefox-${PV}"
22
23inherit pkgconfig perlnative python3native rust
24
25DEPENDS += "zlib cargo-native python3 icu"
26DEPENDS:remove:mipsarch = "icu"
27DEPENDS:remove:powerpc:toolchain-clang = "icu"
28
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 ?= ""
44JIT:mipsarch = "--disable-jit"
45ICU ?= "--with-system-icu"
46ICU:mipsarch = ""
47ICU:powerpc:toolchain-clang = ""
48
49do_configure() {
50 cd ${B}
51 python3 ${S}/configure.py \
52 --enable-project=js \
53 --target=${RUST_HOST_SYS} \
54 --host=${BUILD_SYS} \
55 --prefix=${prefix} \
56 --libdir=${libdir} \
57 --disable-jemalloc \
58 --disable-strip \
59 ${JIT} \
60 ${ICU}
61}
62
63do_install() {
64 oe_runmake 'DESTDIR=${D}' install
65}
66
67inherit multilib_script multilib_header
68
69MULTILIB_SCRIPTS += " ${PN}-dev:${bindir}/js102-config"
70
71do_install:append() {
72 oe_multilib_header mozjs-102/js-config.h
73 sed -e 's@${STAGING_DIR_HOST}@@g' \
74 -i ${D}${bindir}/js102-config
75 rm -f ${D}${libdir}/libjs_static.ajs
76}
77
78PACKAGES =+ "lib${BPN}"
79FILES:lib${BPN} += "${libdir}/lib*"