diff --git a/srcpkgs/spicy/patches/fix-cross.patch b/srcpkgs/spicy/patches/fix-cross.patch new file mode 100644 index 00000000000..d27777c1fd5 --- /dev/null +++ b/srcpkgs/spicy/patches/fix-cross.patch @@ -0,0 +1,39 @@ +--- a/scripts/precompile-headers.sh ++++ b/scripts/precompile-headers.sh +@@ -27,7 +27,7 @@ + config=$1 + header=$2; + +- for flag in $(${config} --cxxflags); do ++ for flag in $(${CROSSCOMPILE_EMULATOR} ${config} --cxxflags); do + if ! echo "${flag}" | grep -q '^-I'; then + continue + fi +@@ -49,7 +49,7 @@ + LIBSPICY=$(search_header "${SPICY_CONFIG}" spicy/rt/libspicy.h) + + # Extract version from `hilti-config`. It should be identical to the one from `spicy-config`. +-VERSION=$(${HILTI_CONFIG} --version | cut -d ' ' -f1) ++VERSION=$(${CROSSCOMPILE_EMULATOR} ${HILTI_CONFIG} --version | cut -d ' ' -f1) + + # The cache is read from the environment variable `SPICY_CACHE` + # if set; else a patch under the user's home directory is used. +@@ -61,14 +61,14 @@ + # NOTE: The compiler invocations here should be kept in sync + # with what we do in `CMakeLists.txt`. + cp "${LIBHILTI}" "${CACHE}/precompiled_libhilti_debug.h" +-$("${HILTI_CONFIG}" --cxx --cxxflags --debug) -x c++-header "${LIBHILTI}" -o "${CACHE}/precompiled_libhilti_debug.h.gch" ++$(${CROSSCOMPILE_EMULATOR} "${HILTI_CONFIG}" --cxx --cxxflags --debug) -x c++-header "${LIBHILTI}" -o "${CACHE}/precompiled_libhilti_debug.h.gch" + + cp "${LIBHILTI}" "${CACHE}/precompiled_libhilti.h" + +-$("${HILTI_CONFIG}" --cxx --cxxflags) -x c++-header "${LIBHILTI}" -o "${CACHE}/precompiled_libhilti.h.gch" ++$(${CROSSCOMPILE_EMULATOR} "${HILTI_CONFIG}" --cxx --cxxflags) -x c++-header "${LIBHILTI}" -o "${CACHE}/precompiled_libhilti.h.gch" + + cp "${LIBSPICY}" "${CACHE}/precompiled_libspicy_debug.h" +-$("${SPICY_CONFIG}" --cxx --cxxflags --debug) -x c++-header "${LIBSPICY}" -o "${CACHE}/precompiled_libspicy_debug.h.gch" ++$(${CROSSCOMPILE_EMULATOR} "${SPICY_CONFIG}" --cxx --cxxflags --debug) -x c++-header "${LIBSPICY}" -o "${CACHE}/precompiled_libspicy_debug.h.gch" + + cp "${LIBSPICY}" "${CACHE}/precompiled_libspicy.h" +-$("${SPICY_CONFIG}" --cxx --cxxflags) -x c++-header "${LIBSPICY}" -o "${CACHE}/precompiled_libspicy.h.gch" ++$(${CROSSCOMPILE_EMULATOR} "${SPICY_CONFIG}" --cxx --cxxflags) -x c++-header "${LIBSPICY}" -o "${CACHE}/precompiled_libspicy.h.gch" diff --git a/srcpkgs/spicy/template b/srcpkgs/spicy/template new file mode 100644 index 00000000000..b6c2f3a30b5 --- /dev/null +++ b/srcpkgs/spicy/template @@ -0,0 +1,24 @@ +# Template file for 'spicy' +pkgname=spicy +version=1.8.1 +revision=1 +build_style=cmake +build_helper=qemu +hostmakedepends="flex python3" +makedepends="libfl-devel zlib-devel" +short_desc="Generate Robust Parsers for Protocols & File Formats" +maintainer="Andrew Benson " +license="BSD-3-Clause" +homepage="https://docs.zeek.org/projects/spicy/en/latest/" +distfiles="https://github.com/zeek/spicy/releases/download/v${version}/spicy.tar.gz" +checksum=016d2ba6dc7a35e007bc8519afd7dec4ede15a129ce7b268ebd90865d8da9fa8 + +if [ "$CROSS_BUILD" ]; then + export CROSSCOMPILE_EMULATOR="/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static" +else + export CROSSCOMPILE_EMULATOR= +fi + +post_install() { + vlicense LICENSE +}