aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authoryuri <yuri@FreeBSD.org>2019-03-07 11:40:34 +0800
committeryuri <yuri@FreeBSD.org>2019-03-07 11:40:34 +0800
commit35854bc1235ec22eddc552ed689ebae121ee46d2 (patch)
treefda02469523695bdadb120dc2b99ed2dc51928df /audio
parentb81ef5d84de954c342df576031fbc13beeb4c841 (diff)
downloadfreebsd-ports-gnome-35854bc1235ec22eddc552ed689ebae121ee46d2.tar.gz
freebsd-ports-gnome-35854bc1235ec22eddc552ed689ebae121ee46d2.tar.zst
freebsd-ports-gnome-35854bc1235ec22eddc552ed689ebae121ee46d2.zip
audio/csound: fix build on powerpc*
PR: 236315 Submitted by: Piotr Kubaj <pkubaj@anongoth.pl>
Diffstat (limited to 'audio')
-rw-r--r--audio/csound/Makefile3
-rw-r--r--audio/csound/files/patch-CMakeLists.txt8
-rw-r--r--audio/csound/files/patch-OOps_pffft.c32
3 files changed, 36 insertions, 7 deletions
diff --git a/audio/csound/Makefile b/audio/csound/Makefile
index 8fce5dd13a6d..6a6e4b387b93 100644
--- a/audio/csound/Makefile
+++ b/audio/csound/Makefile
@@ -23,6 +23,9 @@ USES= alias bison cmake compiler:c++11-lib eigen:3 localbase ncurses python:2.7
USE_GITHUB= yes
USE_LDCONFIG= yes
+CFLAGS_powerpc= -maltivec
+CFLAGS_powerpcspe= -DPFFFT_SIMD_DISABLE
+CFLAGS_powerpc64= -maltivec
CMAKE_ARGS= -DBUILD_CSOUNDVST:BOOL=OFF \
-DBUILD_PD_CLASS:BOOL=OFF \
-DPYTHON_MODULE_INSTALL_DIR:PATH="${PYTHONPREFIX_SITELIBDIR}" \
diff --git a/audio/csound/files/patch-CMakeLists.txt b/audio/csound/files/patch-CMakeLists.txt
index 17afbd946d21..d5bade0b4f47 100644
--- a/audio/csound/files/patch-CMakeLists.txt
+++ b/audio/csound/files/patch-CMakeLists.txt
@@ -20,13 +20,7 @@
set(JAVA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR} CACHE PATH "Java module install dir")
set(LUA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR} CACHE PATH "Lua module install dir")
-@@ -373,12 +373,12 @@ endif()
-
- endif(WIN32)
-
--if(APPLE)
-+if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "${OPSYS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+@@ -378,7 +378,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc+
set_target_properties(${CSOUNDLIB} PROPERTIES CXX_COMPILE_FLAGS "-std=c++11")
endif()
diff --git a/audio/csound/files/patch-OOps_pffft.c b/audio/csound/files/patch-OOps_pffft.c
new file mode 100644
index 000000000000..101639a99992
--- /dev/null
+++ b/audio/csound/files/patch-OOps_pffft.c
@@ -0,0 +1,32 @@
+--- OOps/pffft.c.orig 2019-03-05 17:24:02 UTC
++++ OOps/pffft.c
+@@ -63,6 +63,9 @@
+ #include <stdio.h>
+ #include <assert.h>
+ #include <stdint.h>
++#if !defined(PFFFT_SIMD_DISABLE) && (defined(__ppc__) || defined(__ppc64__))
++#include <altivec.h>
++#endif
+
+ /* detect compiler flavour */
+ #if defined(_MSC_VER)
+@@ -114,8 +117,8 @@ inline v4sf ld_ps1(const float *p) { v4sf v=vec_lde(0,
+ # define LD_PS1(p) ld_ps1(&p)
+ # define INTERLEAVE2(in1, in2, out1, out2) { v4sf tmp__ = vec_mergeh(in1, in2); out2 = vec_mergel(in1, in2); out1 = tmp__; }
+ # define UNINTERLEAVE2(in1, in2, out1, out2) { \
+- vector unsigned char vperm1 = (vector unsigned char)(0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27); \
+- vector unsigned char vperm2 = (vector unsigned char)(4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31); \
++ vector unsigned char vperm1 = (vector unsigned char){0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27}; \
++ vector unsigned char vperm2 = (vector unsigned char){4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31}; \
+ v4sf tmp__ = vec_perm(in1, in2, vperm1); out2 = vec_perm(in1, in2, vperm2); out1 = tmp__; \
+ }
+ # define VTRANSPOSE4(x0,x1,x2,x3) { \
+@@ -128,7 +131,7 @@ inline v4sf ld_ps1(const float *p) { v4sf v=vec_lde(0,
+ x2 = vec_mergeh(y1, y3); \
+ x3 = vec_mergel(y1, y3); \
+ }
+-# define VSWAPHL(a,b) vec_perm(a,b, (vector unsigned char)(16,17,18,19,20,21,22,23,8,9,10,11,12,13,14,15))
++# define VSWAPHL(a,b) vec_perm(a,b, (vector unsigned char){16,17,18,19,20,21,22,23,8,9,10,11,12,13,14,15})
+ # define VALIGNED(ptr) ((((uintptr_t)(ptr)) & 0xF) == 0)
+
+ /*