citadel/meta-gnome/recipes-support/mozjs68/mozjs68_68.4.2.bb

115 lines
4.4 KiB
BlitzBasic
Raw Normal View History

SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf"
SRC_URI = "http://ftp.acc.umu.se/pub/GNOME/teams/releng/tarballs-needing-help/mozjs/mozjs-68.4.2.tar.bz2;downloadfilename=mozjs68-68.4.2.tar.bz2 \
file://avoid-running-autoconf2.13.patch \
file://0001-Yocto-build-fixes.patch \
"
SRC_URI[md5sum] = "cb1ab1983f72d45c737069747c088aa5"
SRC_URI[sha256sum] = "097fb482aa0e57fb117fde6816fbabfedcb862ee81906990363954f47ce93227"
S = "${WORKDIR}/mozjs-68.4.2"
inherit autotools pkgconfig perlnative pythonnative
inherit rust-common
inherit distro_features_check
CONFLICT_DISTRO_FEATURES_mipsarchn32 = "ld-is-gold"
TOOLCHAIN = "clang"
DEPENDS += "nspr zlib rust-native cargo-native clang-native cbindgen-native nasm-native yasm-native"
# Disable null pointer optimization in gcc >= 6
# https://bugzilla.redhat.com/show_bug.cgi?id=1328045
CFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks"
CXXFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks"
# nspr's package-config is ignored so set libs manually
EXTRA_OECONF = " \
--target=${TARGET_SYS} \
--host=${BUILD_SYS} \
--prefix=${prefix} \
--libdir=${libdir} \
--disable-tests \
--disable-jemalloc \
--with-nspr-libs='-lplds4 -lplc4 -lnspr4' \
${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "--enable-gold", '--disable-gold', d)} \
"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
PACKAGECONFIG[x11] = "--x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--x-includes=no --x-libraries=no,virtual/libx11"
EXTRA_OEMAKE_task-compile += "OS_LDFLAGS='-Wl,-latomic ${LDFLAGS}'"
EXTRA_OEMAKE_task-install += "STATIC_LIBRARY_NAME=js_static"
do_configure() {
export SHELL="/bin/sh"
export TMP="${B}"
export RUSTC="${WORKDIR}/recipe-sysroot-native/usr/bin/rustc"
export RUST_HOST="${BUILD_SYS}"
export RUST_TARGET="${TARGET_SYS}"
export RUST_TARGET_PATH="${STAGING_LIBDIR_NATIVE}/rustlib"
export BINDGEN_MFLOAT="${@bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', '-mfloat-abi=hard', '', d)}"
export BINDGEN_CFLAGS="--target=${TARGET_SYS} --sysroot=${RECIPE_SYSROOT} ${BINDGEN_MFLOAT}"
export INSTALL_SDK=0
${S}/js/src/configure ${EXTRA_OECONF}
}
do_compile_prepend() {
export SHELL="/bin/sh"
export S
export PYTHONPATH
cd ${S}
for sub_dir in python testing/mozbase third_party/python; do
for module_dir in `ls $sub_dir -1`;do
[ $module_dir = "virtualenv" ] && continue
if [ -d "${S}/$sub_dir/$module_dir" ];then
PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir"
fi
done
done
PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build"
cd -
}
do_install_prepend() {
export SHELL="/bin/sh"
export S
export PYTHONPATH
cd ${S}
for sub_dir in python testing/mozbase third_party/python; do
for module_dir in `ls $sub_dir -1`;do
[ $module_dir = "virtualenv" ] && continue
if [ -d "${S}/$sub_dir/$module_dir" ];then
PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir"
fi
done
done
PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build"
cd -
}
do_install_append() {
rm -f ${D}/${libdir}/libjs.a
}
PACKAGES =+ "lib${BPN}"
FILES_lib${BPN} += "${libdir}/lib*.so"
FILES_${PN}-dev += "${bindir}/js68-config"
RPROVIDES_lib${BPN} += "libmozjs-68"
# Fails to build with thumb-1 (qemuarm)
#| {standard input}: Assembler messages:
#| {standard input}:2172: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r2,r1,LSR#20'
#| {standard input}:2173: Error: unshifted register required -- `bic r2,r2,#(1<<11)'
#| {standard input}:2174: Error: unshifted register required -- `orr r1,r1,#(1<<20)'
#| {standard input}:2176: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#0x300'
#| {standard input}:2178: Error: instruction not supported in Thumb16 mode -- `subs r5,r2,#52'
ARM_INSTRUCTION_SET_armv5 = "arm"
ARM_INSTRUCTION_SET_armv4 = "arm"
DISABLE_STATIC = ""