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

[portmidi] Add patch that fixes framework linking #32799

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
49 changes: 49 additions & 0 deletions ports/portmidi/framework_link.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From aa375d4fe0bf91ab1edd445baa7912a23a5e6a60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <daschuer@mixxx.org>
Date: Thu, 27 Jul 2023 08:30:44 +0200
Subject: [PATCH] Don't use absolut paths to macOS frameworks

This fixes https://github.com/PortMidi/portmidi/issues/56
---
pm_common/CMakeLists.txt | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/pm_common/CMakeLists.txt b/pm_common/CMakeLists.txt
index 062887b..e474244 100644
--- a/pm_common/CMakeLists.txt
+++ b/pm_common/CMakeLists.txt
@@ -81,21 +81,25 @@ endif()
# first include the appropriate system-dependent file:
if(UNIX AND APPLE)
set(Threads::Threads "" PARENT_SCOPE)
- find_library(COREAUDIO_LIBRARY CoreAudio REQUIRED)
- find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
- find_library(COREMIDI_LIBRARY CoreMIDI REQUIRED)
- find_library(CORESERVICES_LIBRARY CoreServices REQUIRED)
set(PM_LIB_PRIVATE_SRC
${PMDIR}/porttime/ptmacosx_mach.c
${PMDIR}/pm_mac/pmmac.c
${PMDIR}/pm_mac/pmmacosxcm.c
${PMDIR}/pm_mac/finddefault.c
${PMDIR}/pm_mac/readbinaryplist.c)
- set(PM_NEEDED_LIBS ${CMAKE_THREAD_LIBS_INIT} ${COREAUDIO_LIBRARY}
- ${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${CORESERVICES_LIBRARY}
- PARENT_SCOPE)
- target_link_libraries(portmidi PRIVATE Threads::Threads ${COREAUDIO_LIBRARY}
- ${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${CORESERVICES_LIBRARY})
+ set(PM_NEEDED_LIBS
+ ${CMAKE_THREAD_LIBS_INIT}
+ -Wl,-framework,CoreAudio
+ -Wl,-framework,CoreFoundation
+ -Wl,-framework,CoreMidi
+ -Wl,-framework,CoreServices)
+ target_link_libraries(portmidi
+ PRIVATE
+ Threads::Threads
+ -Wl,-framework,CoreAudio
+ -Wl,-framework,CoreFoundation
+ -Wl,-framework,CoreMidi
+ -Wl,-framework,CoreServices)
# set to CMake default; is this right?:
set_target_properties(portmidi PROPERTIES MACOSX_RPATH ON)
elseif(HAIKU)
1 change: 1 addition & 0 deletions ports/portmidi/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
"search-for-threads-in-config.patch"
"framework_link.patch"
)

if(VCPKG_CRT_LINKAGE STREQUAL static)
Expand Down
2 changes: 1 addition & 1 deletion ports/portmidi/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "portmidi",
"version": "2.0.4",
"port-version": 1,
"port-version": 2,
"description": "PortMidi is a cross platform (Windows, macOS, Linux, and BSDs which support alsalib) library for interfacing with operating systems' MIDI I/O APIs.",
"homepage": "https://github.com/PortMidi/portmidi",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6462,7 +6462,7 @@
},
"portmidi": {
"baseline": "2.0.4",
"port-version": 1
"port-version": 2
},
"portsmf": {
"baseline": "239",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/portmidi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "73cae77fb0424c85894d1165fd2cc162bd4cd98a",
"version": "2.0.4",
"port-version": 2
},
{
"git-tree": "b8607f833773d8d45e83a3390c2096d28226c1d2",
"version": "2.0.4",
Expand Down