Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opusfile] Generate .pc files and modernise portfile #29511

Merged
merged 8 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 29 additions & 16 deletions ports/opusfile/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,45 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO xiph/opusfile
REF a55c164e9891a9326188b7d4d216ec9a88373739 # v0.12
SHA512 cfe90b63b8ec027caf6d472167aba863e62f02650245cf0e4d9a543bb565c9088d38b45f7dc2d42cdfcdac5397c3757f4377c24afee73cac52437c125830c411
REF "v${VERSION}"
SHA512 c134b86a444acc3383b785bf89d02734d955b0547fd2ae55afa821b347d6a312130922893f5a27f48e822a6fddc35301048079e365b64c62cd3c7cadb33233b5
HEAD_REF master)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

if("opusurl" IN_LIST FEATURES)
set(BUILD_OPUSURL ON)
else()
set(BUILD_OPUSURL OFF)
endif()
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
opusurl BUILD_OPUSURL
)

vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_OPUSURL=${BUILD_OPUSURL}
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DOPUSFILE_SKIP_HEADERS=ON)

vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()

# Create the pkg-config files
set(prefix "")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
set(PACKAGE_VERSION "${VERSION}")
set(lrintf_lib "")
configure_file("${SOURCE_PATH}/opusfile.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/opusfile.pc" @ONLY)

if(opusurl IN_LIST FEATURES)
set(openssl "openssl")
configure_file("${SOURCE_PATH}/opusurl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/opusurl.pc" @ONLY)
endif()

vcpkg_fixup_pkgconfig()

# 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}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/opus/opusfile.h" "# include <opus_multistream.h>" "# include \"opus_multistream.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)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
10 changes: 7 additions & 3 deletions ports/opusfile/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "opusfile",
"version-string": "0.12",
"port-version": 1,
"version": "0.12",
"port-version": 2,
"description": "Stand-alone decoder library for .opus streams",
"homepage": "https://github.com/xiph/opusfile",
"supports": "!uwp",
"dependencies": [
"libogg",
"opus"
"opus",
{
"name": "vcpkg-cmake",
"host": true
}
],
"features": {
"opusurl": {
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5754,7 +5754,7 @@
},
"opusfile": {
"baseline": "0.12",
"port-version": 1
"port-version": 2
},
"orc": {
"baseline": "1.7.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opusfile.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8a4420290e5ed76d1e0ce68d08268227d7ff2c92",
"version": "0.12",
"port-version": 2
},
{
"git-tree": "9192001e60ba1f9d34e8f45ecde1139c5d40d474",
"version-string": "0.12",
Expand Down