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 \ |
Patrick Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 18 | file://armv5.patch \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 19 | " |
Patrick Williams | b58112e | 2024-03-07 11:16:36 -0600 | [diff] [blame] | 20 | SRC_URI[sha256sum] = "af8086f23efc8492d286671f6035b1a915de6f4ed5c7897e40be0e1cb6b895ea" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 21 | |
| 22 | S = "${WORKDIR}/firefox-${PV}" |
| 23 | |
| 24 | inherit pkgconfig perlnative python3native rust |
| 25 | |
| 26 | DEPENDS += "zlib cargo-native python3 icu" |
| 27 | DEPENDS:remove:mipsarch = "icu" |
| 28 | DEPENDS:remove:powerpc:toolchain-clang = "icu" |
| 29 | |
| 30 | B = "${WORKDIR}/build" |
| 31 | |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 32 | export 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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 48 | |
| 49 | export HOST_CC = "${BUILD_CC}" |
| 50 | export HOST_CXX = "${BUILD_CXX}" |
| 51 | export HOST_CFLAGS = "${BUILD_CFLAGS}" |
| 52 | export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}" |
| 53 | export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 54 | |
| 55 | export AS = "${CC}" |
| 56 | |
| 57 | export RUSTFLAGS |
| 58 | |
| 59 | JIT ?= "" |
| 60 | JIT:mipsarch = "--disable-jit" |
| 61 | ICU ?= "--with-system-icu" |
| 62 | ICU:mipsarch = "" |
| 63 | ICU:powerpc:toolchain-clang = "" |
| 64 | |
| 65 | do_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 Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 78 | do_configure[cleandirs] += "${B}" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 79 | |
| 80 | do_install() { |
| 81 | oe_runmake 'DESTDIR=${D}' install |
| 82 | } |
| 83 | |
| 84 | inherit multilib_script multilib_header |
| 85 | |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 86 | MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}" |
| 87 | MULTILIB_SCRIPTS += "${PN}-dev:${bindir}/js${MAJ_VER}-config" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 88 | |
| 89 | do_install:append() { |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 90 | oe_multilib_header mozjs-${MAJ_VER}/js-config.h |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 91 | sed -e 's@${STAGING_DIR_HOST}@@g' \ |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 92 | -i ${D}${bindir}/js${MAJ_VER}-config |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 93 | rm -f ${D}${libdir}/libjs_static.ajs |
| 94 | } |
| 95 | |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 96 | PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 97 | PACKAGES =+ "lib${BPN}" |
| 98 | FILES:lib${BPN} += "${libdir}/lib*" |