diff --git a/srcpkgs/waifu2x-converter-cpp/patches/fix-cross.patch b/srcpkgs/waifu2x-converter-cpp/patches/fix-cross.patch new file mode 100644 index 00000000000..64118b698ee --- /dev/null +++ b/srcpkgs/waifu2x-converter-cpp/patches/fix-cross.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 12884cc..6139ae2 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -36,7 +36,14 @@ if(UNIX OR MINGW) + set(FILE_SYSTEM_LIB "stdc++fs") + endif() + +-add_executable(conv conv.c) ++add_custom_target("conv") ++add_custom_command( ++ OUTPUT "build/conv" ++ COMMAND cc ++ ARGS -o conv conv.c ++ DEPENDS "build/conv" ++ COMMENT "Generator" ++) + if(UNIX) + set(OPENCV_PREFIX "/usr" CACHE FILEPATH "OpenCV path") + find_package(OpenCV) +@@ -269,7 +276,7 @@ else() # We are on linux and build for linux + target_link_libraries(w2xc ${OpenCV_LIBS} ${CMAKE_DL_LIBS} pthread stdc++fs stdc++) + endif() + +-set(CONV_EXE "$/conv") ++set(CONV_EXE ${CMAKE_BINARY_DIR}/conv) + + add_custom_command( + OUTPUT modelHandler_OpenCL.cl.h + diff --git a/srcpkgs/waifu2x-converter-cpp/template b/srcpkgs/waifu2x-converter-cpp/template index 2d218b80061..fe433d8cba9 100644 --- a/srcpkgs/waifu2x-converter-cpp/template +++ b/srcpkgs/waifu2x-converter-cpp/template @@ -12,7 +12,13 @@ license="MIT" homepage="https://github.com/DeadSix27/waifu2x-converter-cpp" distfiles="${homepage}/archive/v${version}.tar.gz" checksum=fc1f6317dce9ca7a4cb8e36be5c9e18d46e7ac41f7a444eaab2df8be5e44fd43 -nocross="Builds intermediate executable, which should be ran on host, for the target architecture" + +pre_configure() { + # conv is a generator built with add_executable + # build it before so it is built with the correct + # toolchain + cc -o build/conv conv.c +} post_install() { vlicense LICENSE