aboutsummaryrefslogtreecommitdiff
path: root/ports/speex
diff options
context:
space:
mode:
authorMatthew Oliver <protogonoi@gmail.com>2020-08-19 05:58:14 +1000
committerGitHub <noreply@github.com>2020-08-18 12:58:14 -0700
commit272269583c80a4ba626d405e79a88a2ddd6d950d (patch)
treeaca2bd4c6ea94d1656e983492752ea33c2b0bb1e /ports/speex
parentbc8807963282a6b01f0e7ba94b732c5ec028d6a1 (diff)
downloadvcpkg-272269583c80a4ba626d405e79a88a2ddd6d950d.tar.gz
vcpkg-272269583c80a4ba626d405e79a88a2ddd6d950d.zip
[ffmpeg] Add feature support for zlib, iconv, fdk-aac, mp3lame, opus, soxr, theora. (#11277)
Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>
Diffstat (limited to 'ports/speex')
-rw-r--r--ports/speex/0001-make-pkg-config-lib-name-configurable.patch13
-rw-r--r--ports/speex/CMakeLists.txt31
-rw-r--r--ports/speex/CONTROL3
-rw-r--r--ports/speex/portfile.cmake4
4 files changed, 50 insertions, 1 deletions
diff --git a/ports/speex/0001-make-pkg-config-lib-name-configurable.patch b/ports/speex/0001-make-pkg-config-lib-name-configurable.patch
new file mode 100644
index 000000000..72b61f4cc
--- /dev/null
+++ b/ports/speex/0001-make-pkg-config-lib-name-configurable.patch
@@ -0,0 +1,13 @@
+diff --git a/speex.pc.in b/speex.pc.in
+index 97bba4f..52a1d3c 100644
+--- a/speex.pc.in
++++ b/speex.pc.in
+@@ -10,6 +10,6 @@ Description: Speex is an audio codec tuned for speech
+ Version: @SPEEX_VERSION@
+ Requires:
+ Conflicts:
+-Libs: -L${libdir} -lspeex
++Libs: -L${libdir} -l@SPEEXLIB@
+ Libs.private: @LIBM@
+ Cflags: -I${includedir}
+
diff --git a/ports/speex/CMakeLists.txt b/ports/speex/CMakeLists.txt
index bdce0b3c3..b151b2439 100644
--- a/ports/speex/CMakeLists.txt
+++ b/ports/speex/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required (VERSION 3.8.0)
project (libspeex C)
+include(GNUInstallDirs)
+include(CheckLibraryExists)
+
option(USE_SSE "USE_SSE used Note: USE_SSE and FIXED_POINT are mutually exclusive." ON)
if(MSVC)
add_definitions(-DHAVE_CONFIG_H)
@@ -28,6 +31,15 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libspeex.def"
"speex_header_free\n"
)
+file(STRINGS "configure.ac"
+ _speex_version_defines REGEX "SPEEX_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$")
+foreach(ver ${_speex_version_defines})
+ if(ver MATCHES "SPEEX_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$")
+ set(SPEEX_${CMAKE_MATCH_1}_VERSION "${CMAKE_MATCH_2}" CACHE INTERNAL "")
+ endif()
+endforeach()
+set(SPEEX_VERSION ${SPEEX_MAJOR_VERSION}.${SPEEX_MINOR_VERSION}.${SPEEX_MICRO_VERSION})
+
set(SRC
"libspeex/bits.c"
"libspeex/cb_search.c"
@@ -78,3 +90,22 @@ install(
if(NOT DISABLE_INSTALL_HEADERS)
install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h")
endif()
+
+# pkgconfig file
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
+set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
+set(LIBM )
+check_library_exists(m ceil "" LIBMEXIST)
+if(LIBMEXIST)
+ list(APPEND LIBM -lm)
+endif()
+set(SPEEXLIB "${CMAKE_PROJECT_NAME}")
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(SPEEXLIB "${CMAKE_PROJECT_NAME}d")
+endif()
+configure_file(speex.pc.in speex.pc @ONLY)
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/speex.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
diff --git a/ports/speex/CONTROL b/ports/speex/CONTROL
index 3291927c2..1a6b9d149 100644
--- a/ports/speex/CONTROL
+++ b/ports/speex/CONTROL
@@ -1,4 +1,5 @@
Source: speex
-Version: 1.2.0-4
+Version: 1.2.0
+Port-Version: 6
Homepage: https://github.com/xiph/speex
Description: Speex is an Open Source/Free Software patent-free audio compression format designed for speech.
diff --git a/ports/speex/portfile.cmake b/ports/speex/portfile.cmake
index 271c2bc88..f1deabc79 100644
--- a/ports/speex/portfile.cmake
+++ b/ports/speex/portfile.cmake
@@ -6,6 +6,8 @@ vcpkg_from_github(
REF Speex-1.2.0
SHA512 612dfd67a9089f929b7f2a613ed3a1d2fda3d3ec0a4adafe27e2c1f4542de1870b42b8042f0dcb16d52e08313d686cc35b76940776419c775417f5bad18b448f
HEAD_REF master
+ PATCHES
+ 0001-make-pkg-config-lib-name-configurable.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
@@ -24,4 +26,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/speex/speex.h" "${_contents}")
endif()
+vcpkg_fixup_pkgconfig()
+
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/speex RENAME copyright)