python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / yoshimi / patches / cmake.patch
blobbc65a54d6191e60e5d6c547792c1f61dc62a3715
1 --- src/CMakeLists.txt.orig 2017-10-15 22:35:17.000000000 +0200
2 +++ src/CMakeLists.txt 2017-10-22 18:09:47.997475553 +0200
3 @@ -105,7 +105,7 @@
5 set (BuildOptionsBasic
6 "-O3 -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer"
7 - CACHE STRING "basic X86 complier options"
8 + CACHE STRING "basic X86 compiler options"
11 set (BuildOptionsDebug
12 @@ -118,6 +118,34 @@
13 message(FATAL_ERROR "pkg-config required but not found")
14 endif (PKG_CONFIG_FOUND)
16 +include (CheckFunctionExists)
17 +# musl systems don’t have random_r() and also need argp-standalone
18 +check_function_exists(random_r randomR)
20 +if (randomR)
21 + add_definitions(-DHAVE_RANDOM_R)
22 +endif(randomR)
24 +check_c_source_compiles (
25 + "#include <argp.h>
26 + int main () {
27 + int argc=1;
28 + char *argv[]={\"test\"};
29 + argp_parse(0,argc,argv,0,0,0);
30 + return 0;
31 + }" LIBC_HAS_ARGP
34 +if (NOT LIBC_HAS_ARGP)
35 + message(STATUS "libc does not have argp")
36 + find_library (ARGP_LIB argp REQUIRED)
37 + if (ARGP_LIB)
38 + message(STATUS "Found libargp")
39 + else(ARGP_LIB)
40 + message(FATAL_ERROR "libargp required but not found")
41 + endif(ARGP_LIB)
42 +endif(NOT LIBC_HAS_ARGP)
44 # libz
45 set (CMAKE_REQUIRED_LIBRARIES z)
46 check_c_source_compiles (
47 @@ -497,6 +525,10 @@
49 target_link_libraries (yoshimi ${ExternLibraries})
51 +if (ARGP_LIB)
52 + target_link_libraries (yoshimi ${ARGP_LIB})
53 +endif(ARGP_LIB)
55 install (TARGETS yoshimi RUNTIME DESTINATION bin)
57 install (DIRECTORY ../banks DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/yoshimi