Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 May 2018 07:32:26 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r470362 - head/audio/moony-lv2/files
Message-ID:  <201805190732.w4J7WQLR030126@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805190732.w4J7WQLR030126>