mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 19:09:00 +08:00
[speex] Use native autotools for all triplets (#26502)
* Use autotools build for windows * Fix license * Limit subdirs for vpckg build * Update versions * CI [skip actions]
This commit is contained in:
parent
7e430e3a90
commit
8e3595fad0
@ -1,13 +0,0 @@
|
||||
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}
|
||||
|
@ -1,111 +0,0 @@
|
||||
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)
|
||||
if(USE_SSE)
|
||||
add_definitions(-DUSE_SSE -DFLOATING_POINT)
|
||||
else()
|
||||
add_definitions(-DFIXED_POINT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories(win32 include)
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
|
||||
file(READ "win32/libspeex.def" _contents)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
string(REPLACE "LIBRARY libspeex" "LIBRARY libspeexd" _contents "${_contents}")
|
||||
endif()
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libspeex.def"
|
||||
"${_contents}\n"
|
||||
"speex_nb_mode\n"
|
||||
"speex_wb_mode\n"
|
||||
"speex_uwb_mode\n"
|
||||
"speex_mode_list\n"
|
||||
"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"
|
||||
"libspeex/exc_10_16_table.c"
|
||||
"libspeex/exc_10_32_table.c"
|
||||
"libspeex/exc_20_32_table.c"
|
||||
"libspeex/exc_5_256_table.c"
|
||||
"libspeex/exc_5_64_table.c"
|
||||
"libspeex/exc_8_128_table.c"
|
||||
"libspeex/fftwrap.c"
|
||||
"libspeex/filters.c"
|
||||
"libspeex/gain_table.c"
|
||||
"libspeex/gain_table_lbr.c"
|
||||
"libspeex/hexc_10_32_table.c"
|
||||
"libspeex/hexc_table.c"
|
||||
"libspeex/high_lsp_tables.c"
|
||||
"libspeex/kiss_fft.c"
|
||||
"libspeex/kiss_fftr.c"
|
||||
"libspeex/lpc.c"
|
||||
"libspeex/lsp.c"
|
||||
"libspeex/lsp_tables_nb.c"
|
||||
"libspeex/ltp.c"
|
||||
"libspeex/modes.c"
|
||||
"libspeex/modes_wb.c"
|
||||
"libspeex/nb_celp.c"
|
||||
"libspeex/quant_lsp.c"
|
||||
"libspeex/sb_celp.c"
|
||||
"libspeex/smallft.c"
|
||||
"libspeex/speex.c"
|
||||
"libspeex/speex_callbacks.c"
|
||||
"libspeex/speex_header.c"
|
||||
"libspeex/stereo.c"
|
||||
"libspeex/vbr.c"
|
||||
"libspeex/vq.c"
|
||||
"libspeex/window.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libspeex.def"
|
||||
)
|
||||
|
||||
add_library(libspeex ${SRC})
|
||||
|
||||
install(
|
||||
TARGETS libspeex
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
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)
|
13
ports/speex/fix-vla-check.patch
Normal file
13
ports/speex/fix-vla-check.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d94c2fe..b813148 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -37,7 +37,7 @@ AC_C_RESTRICT
|
||||
|
||||
|
||||
AC_MSG_CHECKING(for C99 variable-size arrays)
|
||||
-+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
||||
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
||||
int foo;
|
||||
foo = 10;
|
||||
int array[foo];
|
@ -1,47 +1,29 @@
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
list(APPEND PATCHES "0001-make-pkg-config-lib-name-configurable.patch")
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO xiph/speex
|
||||
REF 5dceaaf3e23ee7fd17c80cb5f02a838fd6c18e01 #Speex-1.2.1
|
||||
SHA512 d03da906ec26ddcea2e1dc4157ac6dd056e1407381b0f37edd350552a02a7372e9108b4e39ae522f1b165be04b813ee11db0b47d17607e4dad18118b9041636b
|
||||
HEAD_REF master
|
||||
PATCHES ${PATCHES}
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO xiph/speex
|
||||
REF 5dceaaf3e23ee7fd17c80cb5f02a838fd6c18e01 #Speex-1.2.1
|
||||
SHA512 d03da906ec26ddcea2e1dc4157ac6dd056e1407381b0f37edd350552a02a7372e9108b4e39ae522f1b165be04b813ee11db0b47d17607e4dad18118b9041636b
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-vla-check.patch
|
||||
subdirs.patch
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/speex/speex.h"
|
||||
"extern const SpeexMode"
|
||||
"__declspec(dllimport) extern const SpeexMode"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
if(VCPKG_TARGET_IS_OSX)
|
||||
if(VCPKG_TARGET_IS_OSX)
|
||||
message("${PORT} currently requires the following libraries from the system package manager:\n autoconf\n automake\n libtool\n\nIt can be installed with brew install autoconf automake libtool")
|
||||
elseif(VCPKG_TARGET_IS_LINUX)
|
||||
elseif(VCPKG_TARGET_IS_LINUX)
|
||||
message("${PORT} currently requires the following libraries from the system package manager:\n autoconf\n automake\n libtool\n\nIt can be installed with apt-get install autoconf automake libtool")
|
||||
endif()
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
OPTIONS --disable-binaries # no example programs (require libogg)
|
||||
)
|
||||
vcpkg_install_make()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
endif()
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
OPTIONS
|
||||
--disable-binaries # no example programs (GPL, require libogg)
|
||||
)
|
||||
vcpkg_install_make()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
13
ports/speex/subdirs.patch
Normal file
13
ports/speex/subdirs.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index dc90415..3b3c16d 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -14,7 +14,7 @@ pkgconfig_DATA = speex.pc
|
||||
EXTRA_DIST = Speex.spec Speex.spec.in Speex.kdevelop speex.m4 speex.pc.in README.blackfin README.symbian README.TI-DSP
|
||||
|
||||
#Fools KDevelop into including all files
|
||||
-SUBDIRS = libspeex include doc win32 symbian ti
|
||||
+SUBDIRS = libspeex include
|
||||
|
||||
if BUILD_BINARIES
|
||||
SUBDIRS += src
|
@ -1,14 +1,8 @@
|
||||
{
|
||||
"name": "speex",
|
||||
"version": "1.2.1",
|
||||
"port-version": 1,
|
||||
"description": "Speex is an Open Source/Free Software patent-free audio compression format designed for speech.",
|
||||
"homepage": "https://github.com/xiph/speex",
|
||||
"license": "LGPL-2.0-or-later",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true,
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
"license": "BSD-3-Clause"
|
||||
}
|
||||
|
@ -6910,7 +6910,7 @@
|
||||
},
|
||||
"speex": {
|
||||
"baseline": "1.2.1",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"speexdsp": {
|
||||
"baseline": "1.2.1",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "83710ad0fb1dfab0d1de32a44d440abca53f1f6e",
|
||||
"version": "1.2.1",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "0520509fd60e20c5362959a7549dd29f7d04d54b",
|
||||
"version": "1.2.1",
|
||||
|
Loading…
Reference in New Issue
Block a user