commit:     37e16f64f8bb38f72a2271c8a01229cfdb746dfe
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Tue Oct  4 02:23:02 2022 +0000
Commit:     Haelwenn Monnier <contact <AT> hacktivis <DOT> me>
CommitDate: Tue Oct  4 02:44:11 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=37e16f64

dev-lang/wabt: Remove *.wasm blobs from $S

Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>

 .../wabt/files/wabt-1.0.29-wasm-blob-tests.patch   | 58 ++++++++++++++++++++++
 dev-lang/wabt/wabt-1.0.29.ebuild                   |  7 +++
 2 files changed, 65 insertions(+)

diff --git a/dev-lang/wabt/files/wabt-1.0.29-wasm-blob-tests.patch 
b/dev-lang/wabt/files/wabt-1.0.29-wasm-blob-tests.patch
new file mode 100644
index 000000000..aacce18fd
--- /dev/null
+++ b/dev-lang/wabt/files/wabt-1.0.29-wasm-blob-tests.patch
@@ -0,0 +1,58 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1fe79b8d..5ebf8f87 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -632,52 +632,7 @@ if (BUILD_TESTS)
+     ${USES_TERMINAL}
+   )
+ 
+-  add_custom_target(run-c-api-tests
+-    COMMAND ${PYTHON_EXECUTABLE} 
${WABT_SOURCE_DIR}/test/run-c-api-examples.py --bindir 
$<TARGET_FILE_DIR:wat2wasm>
+-    WORKING_DIRECTORY ${WABT_SOURCE_DIR}
+-    ${USES_TERMINAL}
+-  )
+-
+-  add_custom_target(check DEPENDS run-unittests run-tests run-c-api-tests)
+-
+-  function(c_api_example NAME)
+-    set(EXENAME wasm-c-api-${NAME})
+-    add_executable(${EXENAME} third_party/wasm-c-api/example/${NAME}.c)
+-    if (COMPILER_IS_MSVC)
+-      set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS "-wd4311")
+-    else ()
+-      set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS "-std=gnu11 
-Wno-pointer-to-int-cast")
+-    endif ()
+-
+-    target_link_libraries(${EXENAME} wasm Threads::Threads)
+-    add_custom_target(${EXENAME}-copy-to-bin ALL
+-      COMMAND ${CMAKE_COMMAND} -E make_directory ${WABT_SOURCE_DIR}/bin
+-      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${EXENAME}> 
${WABT_SOURCE_DIR}/bin/
+-      COMMAND ${CMAKE_COMMAND} -E copy 
${WABT_SOURCE_DIR}/third_party/wasm-c-api/example/${NAME}.wasm 
$<TARGET_FILE_DIR:${EXENAME}>/
+-      COMMAND ${CMAKE_COMMAND} -E copy 
${WABT_SOURCE_DIR}/third_party/wasm-c-api/example/${NAME}.wasm 
${WABT_SOURCE_DIR}/bin/
+-      DEPENDS ${EXENAME}
+-    )
+-    add_dependencies(run-c-api-tests ${EXENAME})
+-  endfunction()
+-
+-  c_api_example(callback)
+-  c_api_example(finalize)
+-  c_api_example(global)
+-  c_api_example(hello)
+-  c_api_example(hostref)
+-  c_api_example(multi)
+-  c_api_example(memory)
+-  c_api_example(reflect)
+-  c_api_example(serialize)
+-  c_api_example(start)
+-  c_api_example(table)
+-  c_api_example(trap)
+-  if (NOT WIN32)
+-    # depends on pthreads
+-    set(THREADS_PREFER_PTHREAD_FLAG ON)
+-    find_package(Threads REQUIRED)
+-    c_api_example(threads)
+-  endif ()
++  add_custom_target(check DEPENDS run-unittests run-tests)
+ endif ()
+ 
+ # install

diff --git a/dev-lang/wabt/wabt-1.0.29.ebuild b/dev-lang/wabt/wabt-1.0.29.ebuild
index 18e045454..ffbff44c8 100644
--- a/dev-lang/wabt/wabt-1.0.29.ebuild
+++ b/dev-lang/wabt/wabt-1.0.29.ebuild
@@ -20,12 +20,19 @@ RESTRICT="!test? ( test )"
 DEPEND="test? ( dev-cpp/gtest )"
 BDEPEND="${PYTHON_DEPS}"
 
+PATCHES=(
+       # Disable tests depending on third_party/wasm-c-api/example/*.wasm
+       "${FILESDIR}/wabt-1.0.29-wasm-blob-tests.patch"
+)
+
 src_prepare() {
        cmake_src_prepare
 
        # Submodules kept: third_party/testsuite third_party/wasm-c-api
        rm -r third_party/gtest third_party/ply third_party/uvwasi || die
 
+       rm third_party/wasm-c-api/example/*.wasm fuzz-in/wasm/stuff.wasm 
wasm2c/examples/fac/fac.wasm || die
+
        sed -i 's;default_compiler =.*;default_compiler = os.getenv("CC", 
"cc");' test/run-spec-wasm2c.py || die
 }
 

Reply via email to