aboutsummaryrefslogtreecommitdiff
path: root/vcpkg-ports/libvorbis
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg-ports/libvorbis')
-rw-r--r--vcpkg-ports/libvorbis/0001-Dont-export-vorbisenc-functions.patch16
-rw-r--r--vcpkg-ports/libvorbis/0002-Fixup-pkgconfig-libs.patch15
-rw-r--r--vcpkg-ports/libvorbis/0003-def-mingw-compat.patch33
-rw-r--r--vcpkg-ports/libvorbis/portfile.cmake25
-rw-r--r--vcpkg-ports/libvorbis/usage13
-rw-r--r--vcpkg-ports/libvorbis/vcpkg.json19
6 files changed, 121 insertions, 0 deletions
diff --git a/vcpkg-ports/libvorbis/0001-Dont-export-vorbisenc-functions.patch b/vcpkg-ports/libvorbis/0001-Dont-export-vorbisenc-functions.patch
new file mode 100644
index 00000000..f2bab5c6
--- /dev/null
+++ b/vcpkg-ports/libvorbis/0001-Dont-export-vorbisenc-functions.patch
@@ -0,0 +1,16 @@
+diff --git a/win32/vorbis.def b/win32/vorbis.def
+index 9cca64d..a80fff7 100644
+--- a/win32/vorbis.def
++++ b/win32/vorbis.def
+@@ -49,11 +49,4 @@ vorbis_synthesis_idheader
+ ;
+ vorbis_window
+ ;_analysis_output_always
+-vorbis_encode_init
+-vorbis_encode_setup_managed
+-vorbis_encode_setup_vbr
+-vorbis_encode_init_vbr
+-vorbis_encode_setup_init
+-vorbis_encode_ctl
+-;
+ vorbis_version_string
diff --git a/vcpkg-ports/libvorbis/0002-Fixup-pkgconfig-libs.patch b/vcpkg-ports/libvorbis/0002-Fixup-pkgconfig-libs.patch
new file mode 100644
index 00000000..85508f16
--- /dev/null
+++ b/vcpkg-ports/libvorbis/0002-Fixup-pkgconfig-libs.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f377c428..07530304 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -60,6 +60,9 @@ message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
+ # Find math library
+
+ check_library_exists(m floor "" HAVE_LIBM)
++if(HAVE_LIBM)
++ set(VORBIS_LIBS "-lm")
++endif()
+
+ # Find ogg dependency
+ find_package(Ogg REQUIRED)
+
diff --git a/vcpkg-ports/libvorbis/0003-def-mingw-compat.patch b/vcpkg-ports/libvorbis/0003-def-mingw-compat.patch
new file mode 100644
index 00000000..f1622d98
--- /dev/null
+++ b/vcpkg-ports/libvorbis/0003-def-mingw-compat.patch
@@ -0,0 +1,33 @@
+diff --git a/win32/vorbis.def b/win32/vorbis.def
+index 1310b6c..de14385 100644
+--- a/win32/vorbis.def
++++ b/win32/vorbis.def
+@@ -1,6 +1,5 @@
+ ; vorbis.def
+ ;
+-LIBRARY
+ EXPORTS
+ _floor_P
+ _mapping_P
+diff --git a/win32/vorbisenc.def b/win32/vorbisenc.def
+index 79af064..40a3e39 100644
+--- a/win32/vorbisenc.def
++++ b/win32/vorbisenc.def
+@@ -1,6 +1,5 @@
+ ; vorbisenc.def
+ ;
+-LIBRARY
+
+ EXPORTS
+ vorbis_encode_init
+diff --git a/win32/vorbisfile.def b/win32/vorbisfile.def
+index 4dc5549..243795d 100644
+--- a/win32/vorbisfile.def
++++ b/win32/vorbisfile.def
+@@ -1,6 +1,5 @@
+ ; vorbisfile.def
+ ;
+-LIBRARY
+ EXPORTS
+ ov_clear
+ ov_open
diff --git a/vcpkg-ports/libvorbis/portfile.cmake b/vcpkg-ports/libvorbis/portfile.cmake
new file mode 100644
index 00000000..95f2825b
--- /dev/null
+++ b/vcpkg-ports/libvorbis/portfile.cmake
@@ -0,0 +1,25 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xiph/vorbis
+ REF v1.3.7
+ SHA512 bfb6f5dbfd49ed38b2b08b3667c06d02e68f649068a050f21a3cc7e1e56b27afd546aaa3199c4f6448f03f6e66a82f9a9dc2241c826d3d1d4acbd38339b9e9fb
+ HEAD_REF master
+ PATCHES
+ 0001-Dont-export-vorbisenc-functions.patch
+ 0002-Fixup-pkgconfig-libs.patch
+ 0003-def-mingw-compat.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME Vorbis CONFIG_PATH "lib/cmake/Vorbis")
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg-ports/libvorbis/usage b/vcpkg-ports/libvorbis/usage
new file mode 100644
index 00000000..c20766a9
--- /dev/null
+++ b/vcpkg-ports/libvorbis/usage
@@ -0,0 +1,13 @@
+The package libvorbis provides CMake targets:
+
+ # Vorbis reference encoder and decoder, low-level API
+ find_package(Vorbis CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Vorbis::vorbis)
+
+ # Audio stream decoding and basic manipulation, high-level API
+ find_package(Vorbis CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Vorbis::vorbisfile)
+
+ # Convenience API for setting up an encoding environment
+ find_package(Vorbis CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Vorbis::vorbisenc)
diff --git a/vcpkg-ports/libvorbis/vcpkg.json b/vcpkg-ports/libvorbis/vcpkg.json
new file mode 100644
index 00000000..65c5edd8
--- /dev/null
+++ b/vcpkg-ports/libvorbis/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "libvorbis",
+ "version": "1.3.7",
+ "port-version": 2,
+ "description": "Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format",
+ "homepage": "https://github.com/xiph/vorbis",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ "libogg",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}