aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorAdam Johnson <AdamJohnso@gmail.com>2021-01-27 21:22:43 -0500
committerGitHub <noreply@github.com>2021-01-27 18:22:43 -0800
commit7f050e0be87e7850c3977ef37919624c4004dbb9 (patch)
tree81f950a95a1e3a76384064e7ba7371909c5d3dd9 /ports
parent09fbac728383879fa6fec703c5898f2b6c923591 (diff)
downloadvcpkg-7f050e0be87e7850c3977ef37919624c4004dbb9.tar.gz
vcpkg-7f050e0be87e7850c3977ef37919624c4004dbb9.zip
[speex] Add linux and macOS support. (#15855)
* [speex] Add linux and macOS support. * [speex] Improve portfile.cmake * update version record Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Diffstat (limited to 'ports')
-rw-r--r--ports/speex/CONTROL3
-rw-r--r--ports/speex/portfile.cmake43
2 files changed, 28 insertions, 18 deletions
diff --git a/ports/speex/CONTROL b/ports/speex/CONTROL
index 0185b9b07..41157ff23 100644
--- a/ports/speex/CONTROL
+++ b/ports/speex/CONTROL
@@ -1,6 +1,5 @@
Source: speex
Version: 1.2.0
-Port-Version: 7
+Port-Version: 8
Homepage: https://github.com/xiph/speex
Description: Speex is an Open Source/Free Software patent-free audio compression format designed for speech.
-Supports: !(linux | osx) \ No newline at end of file
diff --git a/ports/speex/portfile.cmake b/ports/speex/portfile.cmake
index a8431db76..14a11d813 100644
--- a/ports/speex/portfile.cmake
+++ b/ports/speex/portfile.cmake
@@ -1,4 +1,6 @@
-vcpkg_fail_port_install(ON_TARGET "OSX" "Linux")
+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
@@ -6,26 +8,35 @@ vcpkg_from_github(
REF Speex-1.2.0
SHA512 612dfd67a9089f929b7f2a613ed3a1d2fda3d3ec0a4adafe27e2c1f4542de1870b42b8042f0dcb16d52e08313d686cc35b76940776419c775417f5bad18b448f
HEAD_REF master
- PATCHES
- 0001-make-pkg-config-lib-name-configurable.patch
+ PATCHES ${PATCHES}
)
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
-
-vcpkg_configure_cmake(
- SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
- OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
-)
+if(VCPKG_TARGET_IS_WINDOWS)
+ file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+ vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
+ )
+ vcpkg_install_cmake()
-vcpkg_install_cmake()
+ 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()
+ vcpkg_configure_make(
+ SOURCE_PATH ${SOURCE_PATH}
+ AUTOCONFIG
+ )
+ vcpkg_install_make()
-if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
- file(READ "${CURRENT_PACKAGES_DIR}/include/speex/speex.h" _contents)
- string(REPLACE "extern const SpeexMode" "__declspec(dllimport) extern const SpeexMode" _contents "${_contents}")
- file(WRITE "${CURRENT_PACKAGES_DIR}/include/speex/speex.h" "${_contents}")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif()
vcpkg_fixup_pkgconfig()
-file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)