aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/speexdsp
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/speexdsp')
-rw-r--r--vcpkg/ports/speexdsp/CMakeLists.txt122
-rw-r--r--vcpkg/ports/speexdsp/jitter_ctl.patch14
-rw-r--r--vcpkg/ports/speexdsp/portfile.cmake49
-rw-r--r--vcpkg/ports/speexdsp/vcpkg.json14
4 files changed, 199 insertions, 0 deletions
diff --git a/vcpkg/ports/speexdsp/CMakeLists.txt b/vcpkg/ports/speexdsp/CMakeLists.txt
new file mode 100644
index 0000000..673dbda
--- /dev/null
+++ b/vcpkg/ports/speexdsp/CMakeLists.txt
@@ -0,0 +1,122 @@
+cmake_minimum_required(VERSION 3.1)
+option(USE_SSE "Use SSE" OFF)
+option(USE_NEON "Use NEON" OFF)
+option(FIXED_POINT "Use Fixed Point Arithmetic" OFF)
+
+set(LIBSPEEXDSP_VERSION "1.2.0")
+set(LIBSPEEXDSP_SOVERSION "1")
+project(libspeexdsp)
+
+set(LIBSPEEXDSP_SOURCES
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/buffer.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/fftwrap.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/filterbank.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/jitter.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/mdf.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/preprocess.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/resample.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/scal.c"
+)
+set(LIBSPEEXDSP_HEADERS
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/arch.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/bfin.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/fftwrap.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/filterbank.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/fixed_arm4.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/fixed_arm5e.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/fixed_bfin.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/fixed_debug.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/fixed_generic.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/math_approx.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/misc_bfin.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/os_support.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/pseudofloat.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/resample_neon.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/resample_sse.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/smallft.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/vorbis_psy.h"
+ "${CMAKE_CURRENT_LIST_DIR}/include/speex/speex_buffer.h"
+)
+set(LIBSPEEXDSP_HEADERS_PUBLIC
+ "${CMAKE_CURRENT_LIST_DIR}/include/speex/speex_echo.h"
+ "${CMAKE_CURRENT_LIST_DIR}/include/speex/speex_jitter.h"
+ "${CMAKE_CURRENT_LIST_DIR}/include/speex/speex_preprocess.h"
+ "${CMAKE_CURRENT_LIST_DIR}/include/speex/speex_resampler.h"
+ "${CMAKE_CURRENT_LIST_DIR}/include/speex/speexdsp_types.h"
+)
+
+set(CMAKE_C_VISIBILITY_PRESET hidden)
+if (NOT BUILD_SHARED_LIBS)
+ add_definitions("-DEXPORT=")
+elseif(WIN32)
+ add_definitions("-DEXPORT=")
+ list(APPEND LIBSPEEXDSP_SOURCES "${CMAKE_CURRENT_LIST_DIR}/win32/libspeexdsp.def")
+else()
+ add_definitions("-DEXPORT=__attribute__((visibility(\"default\")))")
+endif()
+
+if (USE_SSE AND NOT FIXED_POINT)
+ add_definitions(-DUSE_SSE -DUSE_SSE2)
+endif()
+if (USE_NEON AND NOT MSVC)
+ add_definitions(-DUSE_NEON)
+endif()
+
+if (FIXED_POINT)
+ add_definitions(-DFIXED_POINT -DUSE_KISS_FFT)
+ list(APPEND LIBSPEEXDSP_SOURCES
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/kiss_fft.c"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/kiss_fftr.c"
+ )
+ list(APPEND LIBSPEEXDSP_HEADERS
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/_kiss_fft_guts.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/kiss_fft.h"
+ "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/kiss_fftr.h"
+ )
+else()
+ add_definitions(-DFLOATING_POINT -DUSE_SMALLFT)
+ list(APPEND LIBSPEEXDSP_SOURCES "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/smallft.c")
+endif()
+
+if (NOT MSVC)
+ add_definitions(-DVAR_ARRAYS)
+endif()
+
+# Basic speexdsp_config_types.h for Linux support
+set(INCLUDE_STDINT "#include <stdint.h>")
+set(SIZE16 "int16_t")
+set(USIZE16 "uint16_t")
+set(SIZE32 "int32_t")
+set(USIZE32 "uint32_t")
+configure_file("${CMAKE_CURRENT_LIST_DIR}/include/speex/speexdsp_config_types.h.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/speexdsp_config_types.h" @ONLY)
+list(APPEND LIBSPEEXDSP_HEADERS_PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/speexdsp_config_types.h")
+
+include_directories("${CMAKE_CURRENT_LIST_DIR}/include")
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+
+add_library(speexdsp ${LIBSPEEXDSP_SOURCES} ${LIBSPEEXDSP_HEADERS})
+set_target_properties(speexdsp PROPERTIES PUBLIC_HEADER "${LIBSPEEXDSP_HEADERS_PUBLIC}")
+set_target_properties(speexdsp PROPERTIES VERSION "${LIBSPEEXDSP_VERSION}")
+set_target_properties(speexdsp PROPERTIES SOVERSION "${LIBSPEEXDSP_SOVERSION}")
+if (WIN32)
+ set_target_properties(speexdsp PROPERTIES RUNTIME_OUTPUT_NAME "libspeexdsp")
+endif()
+
+# pkgconfig file
+set(prefix "${CMAKE_INSTALL_PREFIX}")
+set(exec_prefix \${prefix})
+SET(bindir \${exec_prefix}/${CMAKE_INSTALL_BINDIR})
+SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
+SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
+if(CMAKE_SYSTEM_NAME MATCHES BSD)
+ set(PKG_CONFIG_RPATH "-Wl,-R\${libdir}")
+endif(CMAKE_SYSTEM_NAME MATCHES BSD)
+set(PACKAGE_VERSION "${LIBSPEEXDSP_VERSION}")
+configure_file(speexdsp.pc.in speexdsp.pc @ONLY)
+install(FILES ${PROJECT_BINARY_DIR}/speexdsp.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
+install(TARGETS speexdsp
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ PUBLIC_HEADER DESTINATION "include/speex")
diff --git a/vcpkg/ports/speexdsp/jitter_ctl.patch b/vcpkg/ports/speexdsp/jitter_ctl.patch
new file mode 100644
index 0000000..0fd3971
--- /dev/null
+++ b/vcpkg/ports/speexdsp/jitter_ctl.patch
@@ -0,0 +1,14 @@
+diff --git a/win32/libspeexdsp.def b/win32/libspeexdsp.def
+index 45fc69d9..9b5abbad 100755
+--- a/win32/libspeexdsp.def
++++ b/win32/libspeexdsp.def
+@@ -40,6 +40,8 @@ jitter_buffer_get
+ jitter_buffer_get_pointer_timestamp
+ jitter_buffer_tick
+ jitter_buffer_update_delay
++jitter_buffer_ctl
++jitter_buffer_remaining_span
+
+ ;
+ ; speex_preprocess.h
+ \ No newline at end of file
diff --git a/vcpkg/ports/speexdsp/portfile.cmake b/vcpkg/ports/speexdsp/portfile.cmake
new file mode 100644
index 0000000..7ddc82d
--- /dev/null
+++ b/vcpkg/ports/speexdsp/portfile.cmake
@@ -0,0 +1,49 @@
+if(VCPKG_USE_HEAD_VERSION)
+ vcpkg_from_gitlab(
+ GITLAB_URL "https://gitlab.xiph.org"
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xiph/speexdsp
+ HEAD_REF master
+ )
+else()
+ # Since the github repo is out-dated, use official download URL for release builds to reduce traffic to the Gitlab host
+ vcpkg_download_distfile(ARCHIVE
+ URLS "http://downloads.xiph.org/releases/speex/speexdsp-1.2.1.tar.gz"
+ FILENAME "speexdsp-1.2.1.tar.gz"
+ SHA512 41b5f37b48db5cb8c5a0f6437a4a8266d2627a5b7c1088de8549fe0bf0bb3105b7df8024fe207eef194096e0726ea73e2b53e0a4293d8db8e133baa0f8a3bad3
+ )
+ vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ SOURCE_BASE "1.2.1"
+ PATCHES
+ jitter_ctl.patch
+ )
+endif()
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+set(USE_SSE OFF)
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ set(USE_SSE ON)
+endif()
+set(USE_NEON OFF)
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ set(USE_NEON ON)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DUSE_SSE=${USE_SSE}
+ -DUSE_NEON=${USE_NEON}
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "copyright")
diff --git a/vcpkg/ports/speexdsp/vcpkg.json b/vcpkg/ports/speexdsp/vcpkg.json
new file mode 100644
index 0000000..37ff588
--- /dev/null
+++ b/vcpkg/ports/speexdsp/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "name": "speexdsp",
+ "version": "1.2.1",
+ "port-version": 1,
+ "description": "A patent-free, Open Source/Free Software DSP library.",
+ "homepage": "https://speex.org/",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}