From owner-svn-ports-all@freebsd.org Sat May 19 07:32:27 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D08ECEF20BF; Sat, 19 May 2018 07:32:27 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8239784057; Sat, 19 May 2018 07:32:27 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64DFC240E1; Sat, 19 May 2018 07:32:27 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J7WRKF030128; Sat, 19 May 2018 07:32:27 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J7WQLR030126; Sat, 19 May 2018 07:32:26 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <201805190732.w4J7WQLR030126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Sat, 19 May 2018 07:32:26 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r470362 - head/audio/moony-lv2/files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: head/audio/moony-lv2/files X-SVN-Commit-Revision: 470362 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2018 07:32:28 -0000 Author: yuri Date: Sat May 19 07:32:26 2018 New Revision: 470362 URL: https://svnweb.freebsd.org/changeset/ports/470362 Log: audio/moony-lv2: Unbreak on 12 Due to bug#221341 cpow/clog functions are missing, and were implemented ad-hoc in the patch. Recently clog has been added to 12 in r333577, which conflited with the ad-hoc implementation of clog in the patch. To correct this, cmake-level cpow/clog detection were added, and ad-hoc implementations are now added only when cpow/clog aren't present in the system. Modified: head/audio/moony-lv2/files/patch-CMakeLists.txt head/audio/moony-lv2/files/patch-lcomplex_lcomplex.c Modified: head/audio/moony-lv2/files/patch-CMakeLists.txt ============================================================================== --- head/audio/moony-lv2/files/patch-CMakeLists.txt Sat May 19 07:26:17 2018 (r470361) +++ head/audio/moony-lv2/files/patch-CMakeLists.txt Sat May 19 07:32:26 2018 (r470362) @@ -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}) Modified: head/audio/moony-lv2/files/patch-lcomplex_lcomplex.c ============================================================================== --- head/audio/moony-lv2/files/patch-lcomplex_lcomplex.c Sat May 19 07:26:17 2018 (r470361) +++ head/audio/moony-lv2/files/patch-lcomplex_lcomplex.c Sat May 19 07:32:26 2018 (r470362) @@ -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)))