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

[libmysofa] Adding port #38368

Merged
merged 35 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3e03c99
Adding MySOFA port
Honeybunch Apr 23, 2024
972e2ec
Updating port name
Honeybunch Apr 23, 2024
570ed61
Fixing patch so that usage file is correct about how to depend on the…
Honeybunch Apr 23, 2024
fc85f58
Fixing export patch to not require an include that doesn't get installed
Honeybunch Apr 23, 2024
213c2d1
Fixing build on non-windows platforms
Honeybunch Apr 23, 2024
7c846b0
Fixing export on non windows platforms again
Honeybunch Apr 23, 2024
b6ac2e0
Reducing change
Honeybunch Apr 25, 2024
467e78f
Implementing feedback
Honeybunch Apr 29, 2024
f7a2426
Updating version
Honeybunch Apr 29, 2024
6af1d48
Merge branch 'master' of https://github.com/microsoft/vcpkg into mysofa
Honeybunch May 2, 2024
c9d449c
In progress port update
Honeybunch May 2, 2024
4127d55
Tweaking port cmake config fixup
Honeybunch May 2, 2024
b543d5d
Trying to fix config fixup
Honeybunch May 3, 2024
3572fc1
Updating version
Honeybunch May 3, 2024
ef71965
Merge branch 'master' of https://github.com/microsoft/vcpkg into mysofa
Honeybunch Sep 9, 2024
ac5ece6
Updating port to point to patched upstream
Honeybunch Sep 10, 2024
1651b13
Merge branch 'microsoft:master' into mysofa
Honeybunch Sep 10, 2024
94b343a
Removing unnecessary patch
Honeybunch Sep 12, 2024
8aaf358
Merge branch 'mysofa' of https://github.com/Honeybunch/vcpkg into mysofa
Honeybunch Sep 12, 2024
14a0b87
Bringing back patch that skips default file install
Honeybunch Sep 12, 2024
a09c5a7
Updating version
Honeybunch Sep 12, 2024
a612c17
Fixing patch
Honeybunch Sep 12, 2024
1c363f1
Addressing some review feedback
Honeybunch Sep 17, 2024
4bbf66b
Updating zlib dependency in cmake config
Honeybunch Sep 17, 2024
e6fb75f
Updating patch
Honeybunch Sep 17, 2024
ecf5e4e
Update ports/libmysofa/usage
Honeybunch Sep 18, 2024
e54cc54
Update usage
Honeybunch Sep 18, 2024
42d100d
Updating version
Honeybunch Sep 18, 2024
bd93387
Stripping port specific zlib nonsense
Honeybunch Sep 18, 2024
bd402af
Removing patch to skip installing sofa files and instead just deletin…
Honeybunch Sep 26, 2024
cc8105a
Manually resolving symlink
Honeybunch Sep 26, 2024
4cd9b15
Fixing obvious path mistake
Honeybunch Sep 26, 2024
389b1c2
Only removing default.sofa if it exists
Honeybunch Sep 26, 2024
f2a8b74
Changing where we swap out the symlink
Honeybunch Sep 26, 2024
f9a497b
Improving comment
Honeybunch Sep 26, 2024
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
57 changes: 57 additions & 0 deletions ports/libmysofa/fix-exports.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e64623..9fc1fd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,9 +39,9 @@ if(${ADDRESS_SANITIZE} STREQUAL "ON")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -O1 -fno-omit-frame-pointer -g")
endif()

-install(FILES share/default.sofa DESTINATION ${CMAKE_INSTALL_DATADIR}/libmysofa)
-install(FILES share/MIT_KEMAR_normal_pinna.sofa
- DESTINATION ${CMAKE_INSTALL_DATADIR}/libmysofa)
+#install(FILES share/default.sofa DESTINATION ${CMAKE_INSTALL_DATADIR}/libmysofa)
+#install(FILES share/MIT_KEMAR_normal_pinna.sofa
+# DESTINATION ${CMAKE_INSTALL_DATADIR}/libmysofa)

if(BUILD_TESTS)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dcaa92a..4cfce5d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,6 +13,8 @@ use_c99()
configure_file(config.h.in config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

+find_package(ZLIB REQUIRED)
+
if(NOT MSVC)
if(NOT WIN32)
find_library(MATH m)
@@ -81,6 +83,8 @@ set(public-headers
hrtf/mysofa.h
)

+install(FILES "${public-headers}" DESTINATION include)
+
if(BUILD_STATIC_LIBS)
add_library(mysofa-static STATIC ${libsrc})
target_include_directories(mysofa-static
@@ -88,7 +92,7 @@ target_include_directories(mysofa-static
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/hrtf>"
$<INSTALL_INTERFACE:include/>
)
-target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ${ZLIB_LIBRARIES})
+target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ZLIB::ZLIB)
set_target_properties(
mysofa-static
PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE
@@ -120,7 +124,7 @@ if(BUILD_SHARED_LIBS)
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/hrtf>"
$<INSTALL_INTERFACE:include/>
)
- target_link_libraries(mysofa-shared PRIVATE ${MATH} ${ZLIB_LIBRARIES})
+ target_link_libraries(mysofa-shared PRIVATE ${MATH} ZLIB::ZLIB)
set_target_properties(mysofa-shared
PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1)
# Rename the Windows import library (stub) of the DLL to prevent a name clash
29 changes: 29 additions & 0 deletions ports/libmysofa/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO honeybunch/libmysofa
REF "6d475b650a79c1b6bb926f07751d2ddc7ba19504"
SHA512 a26d3f01c7a36975022ded0010a8f4b947ef45a19221ed91fcd4e89595acc2b5a40091cd7b404c8a55fb5c4bd7703886bd7750191e5f6b19d209c794dc2ec60b
HEAD_REF "v${VERSION}"
PATCHES
fix-exports.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
Honeybunch marked this conversation as resolved.
Show resolved Hide resolved
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTS=OFF
-DBUILD_SHARED_LIBS=${BUILD_SHARED}
Honeybunch marked this conversation as resolved.
Show resolved Hide resolved
-DBUILD_STATIC_LIBS=${BUILD_STATIC}
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME mysofa CONFIG_PATH lib/cmake/mysofa)
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
4 changes: 4 additions & 0 deletions ports/libmysofa/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libmysofa provides CMake targets:

find_package(mysofa CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:mysofa::mysofa-shared>,mysofa::mysofa-shared,mysofa::mysofa-static>)
Honeybunch marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 18 additions & 0 deletions ports/libmysofa/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "libmysofa",
"version": "1.3.2",
"description": "Reader for AES SOFA files to get better HRTFs",
Honeybunch marked this conversation as resolved.
Show resolved Hide resolved
"homepage": "https://github.com/hoene/libmysofa",
"license": "BSD-3-Clause",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4688,6 +4688,10 @@
"baseline": "1.23.11",
"port-version": 0
},
"libmysofa": {
"baseline": "1.3.2",
"port-version": 0
},
"libmysql": {
"baseline": "8.0.34",
"port-version": 1
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libmysofa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "65b8b9a807b3c0e02a3d554315b8f91d41a39591",
"version": "1.3.2",
"port-version": 0
}
]
}