Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++" |
| 2 | HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey" |
| 3 | LICENSE = "MPL-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf" |
| 5 | |
| 6 | SRC_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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 16 | file://musl-disable-stackwalk.patch \ |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 17 | file://0001-add-arm-to-list-of-mozinline.patch \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 18 | " |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 19 | SRC_URI[sha256sum] = "51534dd2a158d955a2cb67cc1308f100f6c9def0788713ed8b4d743f3ad72457" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/firefox-${PV}" |
| 22 | |
| 23 | inherit pkgconfig perlnative python3native rust |
| 24 | |
| 25 | DEPENDS += "zlib cargo-native python3 icu" |
| 26 | DEPENDS:remove:mipsarch = "icu" |
| 27 | DEPENDS:remove:powerpc:toolchain-clang = "icu" |
| 28 | |
| 29 | B = "${WORKDIR}/build" |
| 30 | |
| 31 | export 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 | |
| 33 | export HOST_CC = "${BUILD_CC}" |
| 34 | export HOST_CXX = "${BUILD_CXX}" |
| 35 | export HOST_CFLAGS = "${BUILD_CFLAGS}" |
| 36 | export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}" |
| 37 | export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 38 | |
| 39 | export AS = "${CC}" |
| 40 | |
| 41 | export RUSTFLAGS |
| 42 | |
| 43 | JIT ?= "" |
| 44 | JIT:mipsarch = "--disable-jit" |
| 45 | ICU ?= "--with-system-icu" |
| 46 | ICU:mipsarch = "" |
| 47 | ICU:powerpc:toolchain-clang = "" |
| 48 | |
| 49 | do_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 | |
| 63 | do_install() { |
| 64 | oe_runmake 'DESTDIR=${D}' install |
| 65 | } |
| 66 | |
| 67 | inherit multilib_script multilib_header |
| 68 | |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 69 | MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}" |
| 70 | MULTILIB_SCRIPTS += "${PN}-dev:${bindir}/js${MAJ_VER}-config" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 71 | |
| 72 | do_install:append() { |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 73 | oe_multilib_header mozjs-${MAJ_VER}/js-config.h |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 74 | sed -e 's@${STAGING_DIR_HOST}@@g' \ |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 75 | -i ${D}${bindir}/js${MAJ_VER}-config |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 76 | rm -f ${D}${libdir}/libjs_static.ajs |
| 77 | } |
| 78 | |
| 79 | PACKAGES =+ "lib${BPN}" |
| 80 | FILES:lib${BPN} += "${libdir}/lib*" |