aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--graphics/seexpr/Makefile6
-rw-r--r--graphics/seexpr/files/patch-CMakeLists.txt19
-rw-r--r--graphics/seexpr/files/patch-src_SeExpr_SeNoise.cpp34
3 files changed, 58 insertions, 1 deletions
diff --git a/graphics/seexpr/Makefile b/graphics/seexpr/Makefile
index f9c72e77afb7..85827a06b4bd 100644
--- a/graphics/seexpr/Makefile
+++ b/graphics/seexpr/Makefile
@@ -3,6 +3,7 @@
PORTNAME= seexpr
DISTVERSION= 1.0.1.2015.08.29
+PORTREVISION= 1
CATEGORIES= graphics math
MAINTAINER= danfe@FreeBSD.org
@@ -23,6 +24,10 @@ WRKSRC= ${WRKDIR}/SeExpr-${GH_TAGNAME_EXTRACT}
CXXFLAGS+= -I${LOCALBASE}/include
+.if ${MACHINE_CPU:Msse41}
+CMAKE_ARGS+= -DUSE_SSE41:BOOL=ON
+.endif
+
.include <bsd.port.pre.mk>
# base flex(1) v2.5.4 is not sufficient
@@ -33,7 +38,6 @@ BUILD_DEPENDS+= ${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex
post-patch:
@${REINPLACE_CMD} -e '/<alloca\.h>/d' ${WRKSRC}/src/SeExpr/SePlatform.h
@${REINPLACE_CMD} -e 's, "dl",,' ${WRKSRC}/src/SeExpr/CMakeLists.txt
- @${REINPLACE_CMD} -e '/tests/d' ${WRKSRC}/CMakeLists.txt
.if ${OSVERSION} < 1000033
@${REINPLACE_CMD} -e '/COMMAND/s,flex,${LOCALBASE}/bin/&,' \
${WRKSRC}/src/build/macros.cmake
diff --git a/graphics/seexpr/files/patch-CMakeLists.txt b/graphics/seexpr/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..74533ac0dc14
--- /dev/null
+++ b/graphics/seexpr/files/patch-CMakeLists.txt
@@ -0,0 +1,19 @@
+--- CMakeLists.txt.orig 2015-08-28 22:32:38 UTC
++++ CMakeLists.txt
+@@ -46,7 +46,10 @@ ELSE(WIN32)
+ ADD_DEFINITIONS (-Wall -Wextra)
+ ADD_DEFINITIONS (-pthread)
+
+- SET( CMAKE_CXX_FLAGS "-fPIC -msse4.1")
++ SET( CMAKE_CXX_FLAGS -fPIC )
++ IF(USE_SSE41)
++ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1" )
++ ENDIF()
+ ENDIF(WIN32)
+
+ ## Choose build options
+@@ -99,4 +102,3 @@ ADD_SUBDIRECTORY (src/SeExpr)
+ ADD_SUBDIRECTORY (src/SeExprEditor)
+ ADD_SUBDIRECTORY (src/doc)
+ ADD_SUBDIRECTORY (src/demos)
+-ADD_SUBDIRECTORY (src/tests)
diff --git a/graphics/seexpr/files/patch-src_SeExpr_SeNoise.cpp b/graphics/seexpr/files/patch-src_SeExpr_SeNoise.cpp
new file mode 100644
index 000000000000..6e500da606dd
--- /dev/null
+++ b/graphics/seexpr/files/patch-src_SeExpr_SeNoise.cpp
@@ -0,0 +1,34 @@
+--- src/SeExpr/SeNoise.cpp.orig 2015-08-28 22:32:38 UTC
++++ src/SeExpr/SeNoise.cpp
+@@ -16,7 +16,9 @@
+ */
+
+ #include <iostream>
++#ifdef __SSE4_1__
+ #include <smmintrin.h>
++#endif
+
+ #include "SeExprBuiltins.h"
+ namespace{
+@@ -25,14 +27,18 @@ namespace{
+ #include "SeNoise.h"
+ namespace SeExpr{
+
++#ifdef __SSE4_1__
+ inline double floorSSE(double val) {
+- return _mm_cvtsd_f64(_mm_floor_sd(_mm_set_sd(0.0), _mm_set_sd(val)));
++ return _mm_floor_sd(_mm_set_sd(0.0), _mm_set_sd(val))[0];
+ }
+
+ inline double roundSSE(double val) {
+- return _mm_cvtsd_f64(_mm_round_sd(_mm_set_sd(0.0), _mm_set_sd(val), _MM_FROUND_TO_NEAREST_INT));
++ return _mm_round_sd(_mm_set_sd(0.0), _mm_set_sd(val), _MM_FROUND_TO_NEAREST_INT)[0];
+ }
+-
++#else
++#define floorSSE floor
++#define roundSSE round
++#endif
+
+ //! This is the Quintic interpolant from Perlin's Improved Noise Paper
+ double s_curve(double t) {