git: 0aa2d3e9ead7 - main - audio/soundtouch: Update to 2.3.1

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Mon, 04 Oct 2021 21:44:10 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0aa2d3e9ead7804062491e26ed97c2e82ac22605

commit 0aa2d3e9ead7804062491e26ed97c2e82ac22605
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2021-10-04 21:38:42 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2021-10-04 21:43:54 +0000

    audio/soundtouch: Update to 2.3.1
    
    Switch to CMake
    Enable OpenMP on aarch64 and amd64 by default
    Enable OPTIMIZED_CFLAGS by default
    
    PR:             258730
    Approved by:    port maintainer, arrowd (mentor)
    Differential Revision:  https://reviews.freebsd.org/D32288
---
 audio/soundtouch/Makefile                   | 46 +++++++++++------------------
 audio/soundtouch/distinfo                   |  6 ++--
 audio/soundtouch/files/patch-CMakeLists.txt | 46 +++++++++++++++++++++++++++++
 audio/soundtouch/pkg-plist                  | 10 ++++---
 4 files changed, 72 insertions(+), 36 deletions(-)

diff --git a/audio/soundtouch/Makefile b/audio/soundtouch/Makefile
index 70f0b6b3cf91..527114cc0040 100644
--- a/audio/soundtouch/Makefile
+++ b/audio/soundtouch/Makefile
@@ -1,48 +1,36 @@
 # Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
 
 PORTNAME=	soundtouch
-DISTVERSION=	2.2
-PORTREVISION=	1
+DISTVERSION=	2.3.1
 CATEGORIES=	audio
 
 MAINTAINER=	crees@FreeBSD.org
 COMMENT=	Open-source audio processing library
 
 LICENSE=	LGPL21
+LICENSE_FILE=	${WRKSRC}/COPYING.TXT
 
+USES=		cmake
 USE_GITLAB=	yes
-GL_COMMIT=	762f56024b7ade81f6565903161dffec0ad4741e
-GNU_CONFIGURE=	yes
+GL_COMMIT=	e1f315f5358d9db5cee35a7a2886425489fcefe8
 USE_LDCONFIG=	yes
 
-USES=			autoreconf libtool pathfix
+CMAKE_ON=	BUILD_SHARED_LIBS
 
-OPTIONS_DEFINE=	INTEGER_SAMPLES DOCS OPENMP
+OPTIONS_DEFINE=		INTEGER_SAMPLES OPTIMIZED_CFLAGS
+OPTIONS_DEFINE_aarch64=	NEON OPENMP
+OPTIONS_DEFINE_amd64=	OPENMP
+OPTIONS_DEFINE_armv7=	NEON
 OPTIONS_DEFAULT=	${MACHINE_CPU:Msoftfp:C/.+/INTEGER_SAMPLES/}
-OPTIONS_DEFINE_amd64=	SSE
-OPTIONS_DEFINE_i386=	SSE
-OPTIONS_DEFAULT_amd64=	SSE
-OPTIONS_DEFAULT_i386=	${MACHINE_CPU:tu:MSSE}
+OPTIONS_DEFAULT_aarch64=NEON OPENMP OPTIMIZED_CFLAGS
+OPTIONS_DEFAULT_amd64=	OPENMP OPTIMIZED_CFLAGS
 
 INTEGER_SAMPLES_DESC=	Use integer sample format
-INTEGER_SAMPLES_CONFIGURE_ENABLE=	integer-samples
-OPENMP_CONFIGURE_ENABLE=openmp
-SSE_CONFIGURE_ENABLE=	x86-optimizations
-SSE_USES=		compiler:c++11-lang
-
-post-patch:
-	@${REINPLACE_CMD} -e \
-		'/^dist_doc_DATA/s|COPYING.TXT||' \
-		${WRKSRC}/Makefile.am
-	@${REINPLACE_CMD} -e \
-		's|^INCLUDES|AM_CPPFLAGS| ; \
-		 s|$$(prefix)/doc|$$(datadir)/doc|' \
-		${WRKSRC}/config/am_include.mk
-	@${REINPLACE_CMD} -e \
-		's|-O[0-9]||;s|-fcheck-new||' \
-		${WRKSRC}/source/SoundTouch/Makefile.am
-
-post-install:
-	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libSoundTouch.so.1.0.0
+NEON_DESC=		Use NEON instructions
+
+INTEGER_SAMPLES_CMAKE_BOOL=	INTEGER_SAMPLES
+NEON_CMAKE_BOOL=		NEON
+OPENMP_CMAKE_BOOL=		OPENMP
+OPTIMIZED_CFLAGS_CFLAGS=	-Ofast
 
 .include <bsd.port.mk>
diff --git a/audio/soundtouch/distinfo b/audio/soundtouch/distinfo
index 2969e5b06d9d..aabf4edb4327 100644
--- a/audio/soundtouch/distinfo
+++ b/audio/soundtouch/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1617884272
-SHA256 (soundtouch-soundtouch-762f56024b7ade81f6565903161dffec0ad4741e_GL0.tar.gz) = b2515ce4a1b8b69e401ca9d442d1913b23b7447157a76939b2f8791118941bd1
-SIZE (soundtouch-soundtouch-762f56024b7ade81f6565903161dffec0ad4741e_GL0.tar.gz) = 523946
+TIMESTAMP = 1631831988
+SHA256 (soundtouch-soundtouch-e1f315f5358d9db5cee35a7a2886425489fcefe8_GL0.tar.gz) = 633ea27250f465533a5ada4ac0ff276a4be01f43e975e42b8507c50dfbbfd7f9
+SIZE (soundtouch-soundtouch-e1f315f5358d9db5cee35a7a2886425489fcefe8_GL0.tar.gz) = 524738
diff --git a/audio/soundtouch/files/patch-CMakeLists.txt b/audio/soundtouch/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..35f9563a43fc
--- /dev/null
+++ b/audio/soundtouch/files/patch-CMakeLists.txt
@@ -0,0 +1,46 @@
+--- CMakeLists.txt.orig	2021-09-07 15:26:53 UTC
++++ CMakeLists.txt
+@@ -6,8 +6,6 @@ include(GNUInstallDirs)
+ if(MSVC)
+   set(COMPILE_DEFINITIONS /O2 /fp:fast)
+   set(COMPILE_OPTIONS )
+-else()
+-  set(COMPILE_OPTIONS -Ofast)
+ endif()
+ 
+ #####################
+@@ -59,7 +57,7 @@ else()
+   target_compile_definitions(SoundTouch PRIVATE SOUNDTOUCH_FLOAT_SAMPLES)
+ endif()
+ 
+-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7.*|armv8.*)$")
++if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7.*|armv8.*|aarch64.*)$")
+   set(NEON_CPU ON)
+ else()
+   set(NEON_CPU OFF)
+@@ -68,9 +66,14 @@ endif()
+ option(NEON "Use ARM Neon SIMD instructions if in ARM CPU" ON)
+ if(${NEON} AND ${NEON_CPU})
+   target_compile_definitions(SoundTouch PRIVATE SOUNDTOUCH_USE_NEON)
+-  target_compile_options(SoundTouch PRIVATE -mfpu=neon)
+ endif()
+ 
++find_package(OpenMP)
++option(OPENMP "Use parallel multicore calculation through OpenMP" ON)
++if(OPENMP AND OPENMP_FOUND)
++  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
++endif()
++
+ install(
+   FILES
+     include/BPMDetect.h
+@@ -105,6 +108,9 @@ if(SOUNDSTRETCH)
+   target_compile_definitions(soundstretch PRIVATE ${COMPILE_DEFINITIONS})
+   target_compile_options(soundstretch PRIVATE ${COMPILE_OPTIONS})
+   target_link_libraries(soundstretch PRIVATE SoundTouch)
++  if(INTEGER_SAMPLES)
++    target_compile_definitions(soundstretch PRIVATE SOUNDTOUCH_INTEGER_SAMPLES)
++  endif()
+ 
+   install(TARGETS soundstretch
+     DESTINATION bin
diff --git a/audio/soundtouch/pkg-plist b/audio/soundtouch/pkg-plist
index 7d8e0eaaabf5..8f22cf4de612 100644
--- a/audio/soundtouch/pkg-plist
+++ b/audio/soundtouch/pkg-plist
@@ -5,9 +5,11 @@ include/soundtouch/FIFOSamplePipe.h
 include/soundtouch/STTypes.h
 include/soundtouch/SoundTouch.h
 include/soundtouch/soundtouch_config.h
+lib/cmake/SoundTouch/SoundTouchConfig.cmake
+lib/cmake/SoundTouch/SoundTouchConfigVersion.cmake
+lib/cmake/SoundTouch/SoundTouchTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/SoundTouch/SoundTouchTargets.cmake
 lib/libSoundTouch.so
-lib/libSoundTouch.so.1
-lib/libSoundTouch.so.1.0.0
+lib/libSoundTouch.so.2
+lib/libSoundTouch.so.2.3.1
 libdata/pkgconfig/soundtouch.pc
-share/aclocal/soundtouch.m4
-%%PORTDOCS%%%%DOCSDIR%%/README.html