diff options
-rw-r--r-- | audio/moony-lv2/files/patch-CMakeLists.txt | 20 | ||||
-rw-r--r-- | audio/moony-lv2/files/patch-lcomplex_lcomplex.c | 6 |
2 files changed, 24 insertions, 2 deletions
diff --git a/audio/moony-lv2/files/patch-CMakeLists.txt b/audio/moony-lv2/files/patch-CMakeLists.txt index ba8a88a7a866..7b5599112432 100644 --- a/audio/moony-lv2/files/patch-CMakeLists.txt +++ b/audio/moony-lv2/files/patch-CMakeLists.txt @@ -1,6 +1,24 @@ --- CMakeLists.txt.orig 2017-05-16 21:46:21 UTC +++ CMakeLists.txt -@@ -350,21 +350,21 @@ if(BUILD_TESTING) +@@ -33,6 +33,17 @@ set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-f + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,defs ${CMAKE_MODULE_LINKER_FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}") ++elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ++ # see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221341 ++ include(CheckFunctionExists) ++ check_function_exists(clog FreeBSD_CLOG_EXISTS) ++ check_function_exists(cpow FreeBSD_CPOW_EXISTS) ++ if (FreeBSD_CLOG_EXISTS) ++ set(CMAKE_C_FLAGS "-DFreeBSD_CLOG_EXISTS ${CMAKE_C_FLAGS}") ++ endif() ++ if (FreeBSD_CPOW_EXISTS) ++ set(CMAKE_C_FLAGS "-DFreeBSD_CPOW_EXISTS ${CMAKE_C_FLAGS}") ++ endif() + elseif(WIN32) + set(CMAKE_C_FLAGS "-mstackrealign ${CMAKE_C_FLAGS}") + endif() +@@ -350,21 +361,21 @@ if(BUILD_TESTING) endif() set_target_properties(moony_test PROPERTIES INTERPROCEDURAL_OPTIMIZATION true) # -flto target_link_libraries(moony_test ${LIBS}) diff --git a/audio/moony-lv2/files/patch-lcomplex_lcomplex.c b/audio/moony-lv2/files/patch-lcomplex_lcomplex.c index 364ad360f1ac..e38703204b23 100644 --- a/audio/moony-lv2/files/patch-lcomplex_lcomplex.c +++ b/audio/moony-lv2/files/patch-lcomplex_lcomplex.c @@ -8,12 +8,15 @@ #include "lua.h" #include "lauxlib.h" -@@ -78,6 +79,32 @@ static int Ltostring(lua_State *L) /** +@@ -78,6 +79,36 @@ static int Ltostring(lua_State *L) /** return 1; } ++#if !defined(FreeBSD_CLOG_EXISTS) +// Missing C99 functions clog and cpow: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221341 +static Complex clog(Complex z) {return log(cabs(z)) + I * carg(z);} ++#endif ++#if !defined(FreeBSD_CPOW_EXISTS) +// from https://github.com/eblot/newlib/blob/master/newlib/libm/complex/cpow.c +static Complex +cpow(Complex a, Complex z) @@ -37,6 +40,7 @@ + w = r * cos(theta) + (r * sin(theta)) * I; + return w; +} ++#endif + #define A(f,e) static int L##f(lua_State *L) { return pushcomplex(L,e); } #define B(f) A(f,l_mathop(c##f)(Z(1),Z(2))) |