void-packages/srcpkgs/yoshimi/patches/cmake.patch

58 lines
1.5 KiB
Diff
Raw Normal View History

2017-10-20 07:24:55 +00:00
--- src/CMakeLists.txt.orig 2017-10-15 22:35:17.000000000 +0200
2017-10-20 13:20:32 +00:00
+++ src/CMakeLists.txt 2017-10-22 18:09:47.997475553 +0200
@@ -105,7 +105,7 @@
set (BuildOptionsBasic
"-O3 -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer"
- CACHE STRING "basic X86 complier options"
+ CACHE STRING "basic X86 compiler options"
)
set (BuildOptionsDebug
@@ -118,6 +118,34 @@
2017-10-20 07:24:55 +00:00
message(FATAL_ERROR "pkg-config required but not found")
endif (PKG_CONFIG_FOUND)
+include (CheckFunctionExists)
+# musl systems dont have random_r() and also need argp-standalone
2017-10-20 13:20:32 +00:00
+check_function_exists(random_r randomR)
+
+if (randomR)
+ add_definitions(-DHAVE_RANDOM_R)
+endif(randomR)
+
+check_c_source_compiles (
+ "#include <argp.h>
+ int main () {
+ int argc=1;
+ char *argv[]={\"test\"};
+ argp_parse(0,argc,argv,0,0,0);
+ return 0;
+ }" LIBC_HAS_ARGP
+)
+
+if (NOT LIBC_HAS_ARGP)
+ message(STATUS "libc does not have argp")
+ find_library (ARGP_LIB argp REQUIRED)
+ if (ARGP_LIB)
+ message(STATUS "Found libargp")
+ else(ARGP_LIB)
+ message(FATAL_ERROR "libargp required but not found")
+ endif(ARGP_LIB)
+endif(NOT LIBC_HAS_ARGP)
2017-10-20 07:24:55 +00:00
+
# libz
set (CMAKE_REQUIRED_LIBRARIES z)
check_c_source_compiles (
2017-10-20 13:20:32 +00:00
@@ -497,6 +525,10 @@
2017-10-20 07:24:55 +00:00
target_link_libraries (yoshimi ${ExternLibraries})
2017-10-20 13:20:32 +00:00
+if (ARGP_LIB)
+ target_link_libraries (yoshimi ${ARGP_LIB})
+endif(ARGP_LIB)
2017-10-20 07:24:55 +00:00
+
install (TARGETS yoshimi RUNTIME DESTINATION bin)
install (DIRECTORY ../banks DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/yoshimi