From 21445878eb79f1af5e6387a5fb1f7deb0c21948a Mon Sep 17 00:00:00 2001 From: wangli28 <47812810+wangli28@users.noreply.github.com> Date: Wed, 29 May 2019 07:09:41 +0000 Subject: [PATCH] [rtmidi] Update to version 4.0.0 (#6635) * [rtmidi] Update to version 4.0.0 * Fix UNIX install failed. --- ports/rtmidi/CONTROL | 2 +- ports/rtmidi/fix-POSIXname.patch | 17 +++++++++++++++++ ports/rtmidi/portfile.cmake | 8 +++++--- 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 ports/rtmidi/fix-POSIXname.patch diff --git a/ports/rtmidi/CONTROL b/ports/rtmidi/CONTROL index 9eaad973511728..2c3d38dd4c1266 100644 --- a/ports/rtmidi/CONTROL +++ b/ports/rtmidi/CONTROL @@ -1,3 +1,3 @@ Source: rtmidi -Version: 2.1.1-2 +Version: 4.0.0 Description: A set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMidi & JACK) and Windows (Multimedia) diff --git a/ports/rtmidi/fix-POSIXname.patch b/ports/rtmidi/fix-POSIXname.patch new file mode 100644 index 00000000000000..a2a5b0ee1c7351 --- /dev/null +++ b/ports/rtmidi/fix-POSIXname.patch @@ -0,0 +1,17 @@ +diff --git a/rtmidi_c.cpp b/rtmidi_c.cpp +index 248c9e5..ec1dd38 100644 +--- a/rtmidi_c.cpp ++++ b/rtmidi_c.cpp +@@ -136,7 +136,11 @@ const char* rtmidi_get_port_name (RtMidiPtr device, unsigned int portNumber) + { + try { + std::string name = ((RtMidi*) device->ptr)->getPortName (portNumber); +- return strdup (name.c_str ()); ++#if defined(_WIN) || defined(WINAPI_FAMILY) //Windows platform ++ return _strdup (name.c_str ()); ++#else // Unix platform ++ return strdup (name.c_str ()); ++#endif + + } catch (const RtMidiError & err) { + device->ok = false; diff --git a/ports/rtmidi/portfile.cmake b/ports/rtmidi/portfile.cmake index cee6e1a73a8d16..8aa949b5a4cea5 100644 --- a/ports/rtmidi/portfile.cmake +++ b/ports/rtmidi/portfile.cmake @@ -3,9 +3,11 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO thestk/rtmidi - REF 2.1.1 - SHA512 4d378720dd0f7c0e1a87741c088756839878ed56465b053040f70a1e039828fe221a6b1669b77b2fdd146cb192934c5719cc934c2c6a6304f44dbee2972c68e8 + REF 4.0.0 + SHA512 39383f121320c9471b31f8b9d283167bfadf4c7328b6664d1d54a4c52e3dd9b76362875258d90363c6044e87fcee31ccce80e19435dc620c88e6d60fc82d0f9d HEAD_REF master + PATCHES + fix-POSIXname.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -17,4 +19,4 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/readme DESTINATION ${CURRENT_PACKAGES_DIR}/share/rtmidi RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/rtmidi RENAME copyright)