mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 11:07:10 +01:00
Merge pull request #1505 from codicodi/add-opusfile
[opusfile] new port
This commit is contained in:
commit
f4817ead06
40
ports/opusfile/CMakeLists.txt
Normal file
40
ports/opusfile/CMakeLists.txt
Normal file
@ -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()
|
4
ports/opusfile/CONTROL
Normal file
4
ports/opusfile/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: opusfile
|
||||
Version: 0.8
|
||||
Description: Stand-alone decoder library for .opus streams
|
||||
Build-Depends: libogg, opus, openssl
|
29
ports/opusfile/portfile.cmake
Normal file
29
ports/opusfile/portfile.cmake
Normal file
@ -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)
|
Loading…
x
Reference in New Issue
Block a user