aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2020-12-30 22:37:04 -0800
committerGitHub <noreply@github.com>2020-12-30 22:37:04 -0800
commit73cfc659193bf83bd22e400a29a213165aa20b40 (patch)
treeb0bd43c6a485d01456836b4a2aa63b1f83b0cc0a
parent6a94f1f8cea7fd9461662dee065757dca3ce33a5 (diff)
downloadvcpkg-73cfc659193bf83bd22e400a29a213165aa20b40.tar.gz
vcpkg-73cfc659193bf83bd22e400a29a213165aa20b40.zip
[libilbc] New port (#15331)
* [libilbc] New port libilbc is an Internet Low Bit Rate Codec (iLBC) / RFC 3951 codec. Closes #14836. * Update ports/libilbc/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/libilbc/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [libilbc] Use vcpkg_copy_tools, update arm-uwp. * [libilbc] More packaging cleanups. Add vcpkg_fixup_pkgconfig after vcpkg_install_cmake. Install docs into $PREFIX/share/libilbc. Remove ilbc_test after a dynamic build and the bin and debug/bin dirs after a static build. Fixup include/ilbc_export.h for static builds. Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
-rw-r--r--ports/libilbc/CONTROL5
-rw-r--r--ports/libilbc/do-not-build-ilbc_test.patch13
-rw-r--r--ports/libilbc/portfile.cmake33
3 files changed, 51 insertions, 0 deletions
diff --git a/ports/libilbc/CONTROL b/ports/libilbc/CONTROL
new file mode 100644
index 000000000..15503b658
--- /dev/null
+++ b/ports/libilbc/CONTROL
@@ -0,0 +1,5 @@
+Source: libilbc
+Version: 3.0.3
+Description: Open source implementation of the Internet Low Bit Rate Codec (iLBC) / RFC 3951 codec from the WebRTC project.
+Homepage: https://github.com/TimothyGu/libilbc
+Supports: !(arm&uwp) \ No newline at end of file
diff --git a/ports/libilbc/do-not-build-ilbc_test.patch b/ports/libilbc/do-not-build-ilbc_test.patch
new file mode 100644
index 000000000..3d67ecbb0
--- /dev/null
+++ b/ports/libilbc/do-not-build-ilbc_test.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 671ded64d1..1d01f737c2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -332,7 +332,7 @@ install(FILES ilbc.h ${CMAKE_CURRENT_BINARY_DIR}/ilbc_export.h
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ install(FILES CONTRIBUTING.md NEWS.md README.md
+ DESTINATION ${CMAKE_INSTALL_DOCDIR})
+-install(TARGETS ilbc ilbc_test
++install(TARGETS ilbc
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/ports/libilbc/portfile.cmake b/ports/libilbc/portfile.cmake
new file mode 100644
index 000000000..c833ebd6f
--- /dev/null
+++ b/ports/libilbc/portfile.cmake
@@ -0,0 +1,33 @@
+set(ILBC_VERSION 3.0.3)
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/TimothyGu/libilbc/releases/download/v${ILBC_VERSION}/libilbc-${ILBC_VERSION}.zip"
+ FILENAME "libilbc-${ILBC_VERSION}.zip"
+ SHA512 a5755db093529f6a3fd8fd47da63b57cffff1d3babef443d92f7c5a250ce8d1585adfba525c4037b142d9f00f1675a5054c172bf936be280dfcc22ed553c94c6
+)
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ REF ${ILBC_VERSION}
+ PATCHES do-not-build-ilbc_test.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DCMAKE_INSTALL_DOCDIR=share/${PORT}
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_pkgconfig()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/ilbc_export.h "#ifdef ILBC_STATIC_DEFINE" "#if 1")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)