Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [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://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 Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 18 | file://py-3.11.patch \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 19 | " |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 20 | SRC_URI[sha256sum] = "53be2bcde0b5ee3ec106bd8ba06b8ae95e7d489c484e881dfbe5360e4c920762" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 21 | |
| 22 | S = "${WORKDIR}/firefox-${@d.getVar("PV").replace("esr", "")}" |
| 23 | |
| 24 | inherit pkgconfig perlnative python3native rust |
| 25 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 26 | DEPENDS += "zlib cargo-native python3 icu" |
| 27 | DEPENDS:remove:mipsarch = "icu" |
| 28 | DEPENDS:remove:powerpc:toolchain-clang = "icu" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 29 | |
| 30 | B = "${WORKDIR}/build" |
| 31 | |
| 32 | 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" |
| 33 | |
| 34 | export HOST_CC = "${BUILD_CC}" |
| 35 | export HOST_CXX = "${BUILD_CXX}" |
| 36 | export HOST_CFLAGS = "${BUILD_CFLAGS}" |
| 37 | export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}" |
| 38 | export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 39 | |
| 40 | export AS = "${CC}" |
| 41 | |
| 42 | export RUSTFLAGS |
| 43 | |
| 44 | JIT ?= "" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 45 | JIT:mipsarch = "--disable-jit" |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 46 | ICU ?= "--with-system-icu" |
| 47 | ICU:mipsarch = "" |
| 48 | ICU:powerpc:toolchain-clang = "" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 49 | |
| 50 | do_configure() { |
| 51 | cd ${B} |
| 52 | python3 ${S}/configure.py \ |
| 53 | --enable-project=js \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 54 | --target=${RUST_HOST_SYS} \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 55 | --host=${BUILD_SYS} \ |
| 56 | --prefix=${prefix} \ |
| 57 | --libdir=${libdir} \ |
| 58 | --disable-jemalloc \ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 59 | --disable-strip \ |
| 60 | ${JIT} \ |
| 61 | ${ICU} |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | do_install() { |
| 65 | oe_runmake 'DESTDIR=${D}' install |
| 66 | } |
| 67 | |
| 68 | inherit multilib_script multilib_header |
| 69 | |
| 70 | MULTILIB_SCRIPTS += " ${PN}-dev:${bindir}/js91-config" |
| 71 | |
| 72 | do_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 | |
| 79 | PACKAGES =+ "lib${BPN}" |
| 80 | FILES:lib${BPN} += "${libdir}/lib*" |