Skip to content

Commit

Permalink
[openal-soft] Add pkgconfig (#19318)
Browse files Browse the repository at this point in the history
* [openal-soft] Add pkgconfig

* Update version files
  • Loading branch information
NancyLi1013 authored Aug 5, 2021
1 parent 8932964 commit 8ac6ffd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
31 changes: 23 additions & 8 deletions ports/openal-soft/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@ if(VCPKG_TARGET_IS_OSX)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DLIBTYPE=${OPENAL_LIBTYPE}
-DALSOFT_UTILS=OFF
-DALSOFT_NO_CONFIG_UTIL=ON
-DALSOFT_EXAMPLES=OFF
-DALSOFT_TESTS=OFF
-DALSOFT_CONFIG=OFF
-DALSOFT_HRTF_DEFS=OFF
-DALSOFT_AMBDEC_PRESETS=OFF
-DALSOFT_BACKEND_ALSA=${ALSOFT_REQUIRE_LINUX}
-DALSOFT_BACKEND_OSS=OFF
-DALSOFT_BACKEND_SOLARIS=OFF
-DALSOFT_BACKEND_SNDIO=OFF
-DALSOFT_BACKEND_QSA=OFF
-DALSOFT_BACKEND_PORTAUDIO=OFF
-DALSOFT_BACKEND_PULSEAUDIO=OFF
-DALSOFT_BACKEND_COREAUDIO=${ALSOFT_REQUIRE_OSX}
Expand All @@ -57,24 +55,41 @@ vcpkg_configure_cmake(
-DALSOFT_REQUIRE_WASAPI=${ALSOFT_REQUIRE_WINDOWS}
-DALSOFT_CPUEXT_NEON=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_WindowsSDK=ON
MAYBE_UNUSED_VARIABLES
ALSOFT_AMBDEC_PRESETS
ALSOFT_BACKEND_ALSA
ALSOFT_BACKEND_COREAUDIO
ALSOFT_BACKEND_JACK
ALSOFT_BACKEND_OPENSL
ALSOFT_BACKEND_OSS
ALSOFT_BACKEND_PORTAUDIO
ALSOFT_BACKEND_PULSEAUDIO
ALSOFT_BACKEND_SNDIO
ALSOFT_BACKEND_SOLARIS
ALSOFT_CONFIG
ALSOFT_CPUEXT_NEON
ALSOFT_HRTF_DEFS
CMAKE_DISABLE_FIND_PACKAGE_WindowsSDK
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenAL)
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/OpenAL")

foreach(HEADER al.h alc.h)
file(READ ${CURRENT_PACKAGES_DIR}/include/AL/${HEADER} AL_H)
file(READ "${CURRENT_PACKAGES_DIR}/include/AL/${HEADER}" AL_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "defined(AL_LIBTYPE_STATIC)" "1" AL_H "${AL_H}")
else()
string(REPLACE "defined(AL_LIBTYPE_STATIC)" "0" AL_H "${AL_H}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/AL/${HEADER} "${AL_H}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/AL/${HEADER}" "${AL_H}")
endforeach()

vcpkg_fixup_pkgconfig()

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)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

vcpkg_copy_pdbs()
3 changes: 2 additions & 1 deletion ports/openal-soft/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "openal-soft",
"version-string": "1.21.1",
"version-semver": "1.21.1",
"port-version": 1,
"description": "OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API.",
"homepage": "https://github.com/kcat/openal-soft",
"supports": "!uwp"
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4570,7 +4570,7 @@
},
"openal-soft": {
"baseline": "1.21.1",
"port-version": 0
"port-version": 1
},
"openblas": {
"baseline": "0.3.15",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openal-soft.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cb266fe5f02b9d2b5cb38343d25083359062bd07",
"version-semver": "1.21.1",
"port-version": 1
},
{
"git-tree": "735740a45f65f166bd693795a7bed3d2ef079baf",
"version-string": "1.21.1",
Expand Down

0 comments on commit 8ac6ffd

Please sign in to comment.