# Template file for 'wabt'
pkgname=wabt
version=1.0.41
revision=1
build_style=cmake
make_check_target=check
checkdepends="python3-ply"
short_desc="WebAssembly Binary Toolkit"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="https://github.com/WebAssembly/wabt"
_gtest_commit=15460959cbbfa20e66ef0b5ab497367e47fc0a04
_testsuite_commit=d76759e746f3564a03f6106ae19679742f2a1831
_wasm_c_api_commit=b6dd1fb658a282c64b029867845bc50ae59e1497
_picosha2_commit=27fcf6979298949e8a462e16d09a0351c18fcaf2
_simde_commit=71fd833d9666141edcd1d3c109a80e228303d8d7
_uvwasi_commit=55eff19f4c7e69ec151424a037f951e0ad006ed6
distfiles="https://github.com/WebAssembly/wabt/archive/${version}.tar.gz
 https://github.com/google/googletest/archive/${_gtest_commit}.tar.gz
 https://github.com/WebAssembly/testsuite/archive/${_testsuite_commit}.tar.gz
 https://github.com/WebAssembly/wasm-c-api/archive/${_wasm_c_api_commit}.tar.gz
 https://github.com/okdshin/PicoSHA2/archive/${_picosha2_commit}.tar.gz
 https://github.com/simd-everywhere/simde/archive/${_simde_commit}.tar.gz"
checksum="5dcaa5d3ea23827ee62634289cc46cd9baa4847b3831050b9bdf23971c689eb7
 258f33ab1a8ee17adf48ec65e821d0ea9eafcbedeff6110f9eaed78472e73dde
 1a6f74ab546bcccf748012d360b72f584ef3b322441c472d99d4f497aba07601
 2f2cca48d7c093a680461fc80e7ef812f383cdf6e421a718a5292fd42438960b
 18d82bb79c021ccf4ce58125b64691accef54237ba5194462740bacf8b39d8a9
 72b2c14a487560b7eb203795f2c2fead5c7499662e639944cca2a9bb19f09029"

skip_extraction="
 ${_gtest_commit}.tar.gz
 ${_testsuite_commit}.tar.gz
 ${_wasm_c_api_commit}.tar.gz
 ${_picosha2_commit}.tar.gz
 ${_simde_commit}.tar.gz
 ${_uvwasi_commit}.tar.gz"

case "${XBPS_TARGET_MACHINE}" in
i686*)
	export WASM2C_CFLAGS="-msse2 -mfpmath=sse"
	make_check=no # https://github.com/WebAssembly/wabt/issues/1044
	;;
esac

post_extract() {
	vsrcextract -C third_party/gtest "${_gtest_commit}.tar.gz"
	vsrcextract -C third_party/testsuite "${_testsuite_commit}.tar.gz"
	vsrcextract -C third_party/wasm-c-api "${_wasm_c_api_commit}.tar.gz"
	vsrcextract -C third_party/picosha2 "${_picosha2_commit}.tar.gz"
	vsrcextract -C third_party/simde "${_simde_commit}.tar.gz"
}
