aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodicodi <rob.ceglinski@gmail.com>2017-07-21 15:03:10 +0200
committercodicodi <rob.ceglinski@gmail.com>2017-07-21 15:03:10 +0200
commit7f84fdc48fd2ae58803264b4d395541bbf3b7602 (patch)
treecf2c378d44e752c8ef9b5bacb1aa8f9eb85b5c06
parenta42da34a07187063da297b422a95dbb2d7bd064a (diff)
downloadvcpkg-7f84fdc48fd2ae58803264b4d395541bbf3b7602.tar.gz
vcpkg-7f84fdc48fd2ae58803264b4d395541bbf3b7602.zip
[opusfile] initial commit
-rw-r--r--ports/opusfile/CMakeLists.txt40
-rw-r--r--ports/opusfile/CONTROL4
-rw-r--r--ports/opusfile/portfile.cmake29
3 files changed, 73 insertions, 0 deletions
diff --git a/ports/opusfile/CMakeLists.txt b/ports/opusfile/CMakeLists.txt
new file mode 100644
index 000000000..737adee1a
--- /dev/null
+++ b/ports/opusfile/CMakeLists.txt
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 3.4)
+project(opusfile C)
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244 /wd4090")
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+
+find_path(OGG_INCLUDE_DIR ogg/ogg.h)
+find_library(OGG_LIBRARY ogg)
+
+find_path(OPUS_INCLUDE_DIR opus.h PATH_SUFFIXES opus)
+find_library(OPUS_LIBRARY opus)
+
+find_package(OpenSSL MODULE REQUIRED)
+
+add_library(opusfile
+ src/info.c
+ src/internal.c
+ src/opusfile.c
+ src/stream.c)
+
+target_include_directories(opusfile PRIVATE include PUBLIC ${OGG_INCLUDE_DIR} ${OPUS_INCLUDE_DIR})
+target_link_libraries(opusfile PRIVATE ${OGG_LIBRARY} ${OPUS_LIBRARY})
+
+add_library(opusurl
+ src/http.c
+ src/wincerts.c)
+
+target_compile_definitions(opusurl PRIVATE OP_ENABLE_HTTP)
+target_include_directories(opusurl PRIVATE include)
+target_link_libraries(opusurl PRIVATE opusfile OpenSSL::SSL ws2_32.lib crypt32.lib)
+
+install(TARGETS opusfile opusurl
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+if(NOT OPUSFILE_SKIP_HEADERS)
+ install(FILES include/opusfile.h
+ DESTINATION include/opus)
+endif()
diff --git a/ports/opusfile/CONTROL b/ports/opusfile/CONTROL
new file mode 100644
index 000000000..92acb39f8
--- /dev/null
+++ b/ports/opusfile/CONTROL
@@ -0,0 +1,4 @@
+Source: opusfile
+Version: 0.8
+Description: Stand-alone decoder library for .opus streams
+Build-Depends: libogg, opus, openssl
diff --git a/ports/opusfile/portfile.cmake b/ports/opusfile/portfile.cmake
new file mode 100644
index 000000000..0ba18d849
--- /dev/null
+++ b/ports/opusfile/portfile.cmake
@@ -0,0 +1,29 @@
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
+ message(FATAL_ERROR "UWP builds not supported")
+endif()
+
+include(vcpkg_common_functions)
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xiph/opusfile
+ REF v0.8
+ SHA512 82fcb09c0b77bffb5877c660a268e0c166a1ac314b270799fe5cb4e0fa2cd10fd909b380761031f7dfb60d8b7561e5fe54d93b74d37bb0e6f629bdf9a6384ae1
+ HEAD_REF master)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_DEBUG
+ -DOPUSFILE_SKIP_HEADERS=ON)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+
+# make includes work with MSBuild integration
+file(READ ${CURRENT_PACKAGES_DIR}/include/opus/opusfile.h OPUSFILE_H)
+ string(REPLACE "# include <opus_multistream.h>" "# include \"opus_multistream.h\"" OPUSFILE_H "${OPUSFILE_H}")
+file(WRITE ${CURRENT_PACKAGES_DIR}/include/opus/opusfile.h "${OPUSFILE_H}")
+
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/opusfile)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/opusfile/COPYING ${CURRENT_PACKAGES_DIR}/share/opusfile/copyright)