pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add rtmidi version 5.0.0 to pkgsrc-wip



Module Name:	pkgsrc-wip
Committed By:	Niclas Rosenvik <nros%pkgsrc.org@localhost>
Pushed By:	nros
Date:		Fri Dec 17 22:53:39 2021 +0100
Changeset:	3a2441109e9720fc4c4c878a46889b676e6bb2b7

Modified Files:
	Makefile
Added Files:
	rtmidi/DESCR
	rtmidi/Makefile
	rtmidi/PLIST
	rtmidi/buildlink3.mk
	rtmidi/distinfo
	rtmidi/patches/patch-CMakeLists.txt
	rtmidi/patches/patch-RtMidi.cpp

Log Message:
Add rtmidi version 5.0.0 to pkgsrc-wip

Add rtmidi version 5.0.0 to pkgsrc-wip.
RtMidi is a cross platfrom realtime MIDI input/output library that
simplifies the interaction with MIDI hardware and software.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3a2441109e9720fc4c4c878a46889b676e6bb2b7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                            |  1 +
 rtmidi/DESCR                        |  2 +
 rtmidi/Makefile                     | 29 +++++++++++
 rtmidi/PLIST                        | 11 +++++
 rtmidi/buildlink3.mk                | 13 +++++
 rtmidi/distinfo                     |  7 +++
 rtmidi/patches/patch-CMakeLists.txt | 95 +++++++++++++++++++++++++++++++++++++
 rtmidi/patches/patch-RtMidi.cpp     | 23 +++++++++
 8 files changed, 181 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 809e09b547..c910743aea 100644
--- a/Makefile
+++ b/Makefile
@@ -5040,6 +5040,7 @@ SUBDIR+=	rstudio
 SUBDIR+=	rtcmix
 SUBDIR+=	rte
 SUBDIR+=	rthread
+SUBDIR+=	rtmidi
 SUBDIR+=	rtl-sdr-git
 SUBDIR+=	rtl_433
 SUBDIR+=	rtpbreak
diff --git a/rtmidi/DESCR b/rtmidi/DESCR
new file mode 100644
index 0000000000..a5b2af72f0
--- /dev/null
+++ b/rtmidi/DESCR
@@ -0,0 +1,2 @@
+RtMidi is a cross platfrom realtime MIDI input/output library that
+simplifies the interaction with MIDI hardware and software.
diff --git a/rtmidi/Makefile b/rtmidi/Makefile
new file mode 100644
index 0000000000..14634b045d
--- /dev/null
+++ b/rtmidi/Makefile
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+DISTNAME=	rtmidi-5.0.0
+CATEGORIES=	audio
+MASTER_SITES=	http://www.music.mcgill.ca/~gary/rtmidi/release/
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://www.music.mcgill.ca/~gary/rtmidi/
+COMMENT=	Realtime MIDI IO library
+LICENSE=	mit
+
+USE_CMAKE=	yes
+USE_TOOLS+=	pkg-config
+USE_LANGUAGES=	c c++
+
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} != "Linux"
+CMAKE_ARGS+=	-DRTMIDI_API_ALSA=OFF
+.endif
+CMAKE_ARGS+=	-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
+
+PKGCONFIG_OVERRIDE+=	rtmidi.pc.in
+
+.if ${OPSYS} == "Linux"
+.include "../../audio/alsa-lib/buildlink3.mk"
+.endif
+.include "../../audio/jack/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/rtmidi/PLIST b/rtmidi/PLIST
new file mode 100644
index 0000000000..37652f1e67
--- /dev/null
+++ b/rtmidi/PLIST
@@ -0,0 +1,11 @@
+@comment $NetBSD$
+include/rtmidi/RtMidi.h
+include/rtmidi/rtmidi_c.h
+lib/cmake/rtmidi/RtMidiConfig.cmake
+lib/cmake/rtmidi/RtMidiConfigVersion.cmake
+lib/cmake/rtmidi/RtMidiTargets-noconfig.cmake
+lib/cmake/rtmidi/RtMidiTargets.cmake
+lib/librtmidi.so
+lib/librtmidi.so.6
+lib/librtmidi.so.6.0.0
+lib/pkgconfig/rtmidi.pc
diff --git a/rtmidi/buildlink3.mk b/rtmidi/buildlink3.mk
new file mode 100644
index 0000000000..24c7ff660c
--- /dev/null
+++ b/rtmidi/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	rtmidi
+
+.if !defined(RTMIDI_BUILDLINK3_MK)
+RTMIDI_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.rtmidi+=	rtmidi>=5.0.0
+BUILDLINK_PKGSRCDIR.rtmidi?=	../../wip/rtmidi
+
+.endif	# RTMIDI_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-rtmidi
diff --git a/rtmidi/distinfo b/rtmidi/distinfo
new file mode 100644
index 0000000000..842b30d595
--- /dev/null
+++ b/rtmidi/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+BLAKE2s (rtmidi-5.0.0.tar.gz) = c41c51342aad49d0d65f0c13c981dc92f2e811b227bd13b5af772cae99711482
+SHA512 (rtmidi-5.0.0.tar.gz) = d2688b6777c09c213e1f6800c67bca6905ac9a0161480e7c167583322a64be086bb47f1452cc45d4a4e2c1d3d3fe626d57b4a187e79c0a20af4f6e23d4a3530a
+Size (rtmidi-5.0.0.tar.gz) = 528747 bytes
+SHA1 (patch-CMakeLists.txt) = 97f0a99d3bfd32aab01cd68034658176740cde3f
+SHA1 (patch-RtMidi.cpp) = 9eaac880696e3ea95718e4a8b9dfeffb85fc1be4
diff --git a/rtmidi/patches/patch-CMakeLists.txt b/rtmidi/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..2c1a2dd4ac
--- /dev/null
+++ b/rtmidi/patches/patch-CMakeLists.txt
@@ -0,0 +1,95 @@
+$NetBSD$
+
+* Don't force program that use rtmidi to use find_package(Threads)
+  it comes with the so and the public headers don't include pthread.h
+
+* Define GNUIInstallDirs varibles before they are used and remove
+  over inclusion of GNUInstallDirs
+
+* Install cmake package files into the right directory and
+  give them correct names so that they can be found by cmake 
+
+--- CMakeLists.txt.orig	2021-11-16 17:19:37.000000000 +0000
++++ CMakeLists.txt
+@@ -156,7 +156,7 @@ if (NEED_PTHREAD)
+   find_package(Threads REQUIRED
+     CMAKE_THREAD_PREFER_PTHREAD
+     THREADS_PREFER_PTHREAD_FLAG)
+-  list(APPEND PUBLICLINKLIBS Threads::Threads)
++  list(APPEND LINKLIBS Threads::Threads)
+ endif()
+ 
+ # Create library targets.
+@@ -187,11 +187,14 @@ set_target_properties(rtmidi PROPERTIES
+   SOVERSION ${SO_VER}
+   VERSION ${FULL_VER})
+ 
++# Set standard installation directories.
++include(GNUInstallDirs)
++
+ # Set include paths, populate target interface.
+ target_include_directories(rtmidi PRIVATE ${INCDIRS}
+                                   PUBLIC
+                                     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+-                                    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
++                                    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/rtmidi>)
+ 
+ # Set compile-time definitions
+ target_compile_definitions(rtmidi PRIVATE ${API_DEFS})
+@@ -199,9 +202,6 @@ target_compile_definitions(rtmidi PRIVAT
+ target_link_libraries(rtmidi PUBLIC ${PUBLICLINKLIBS} 
+                              PRIVATE ${LINKLIBS})
+ 
+-# Set standard installation directories.
+-include(GNUInstallDirs)
+-
+ # Add tests if requested.
+ option(RTMIDI_BUILD_TESTING "Build test programs" ON)
+ if (NOT DEFINED RTMIDI_BUILD_TESTING OR RTMIDI_BUILD_TESTING STREQUAL "")
+@@ -225,9 +225,6 @@ if (RTMIDI_BUILD_TESTING)
+   add_test(NAME apinames COMMAND apinames)
+ endif()
+ 
+-# Set standard installation directories.
+-include(GNUInstallDirs)
+-
+ # Message
+ string(REPLACE ";" " " apilist "${API_LIST}")
+ message(STATUS "Compiling with support for: ${apilist}")
+@@ -251,7 +248,7 @@ install(TARGETS ${LIB_TARGETS}
+ export(PACKAGE RtMidi)
+ 
+ # Set installation path for CMake files.
+-set(RTMIDI_CMAKE_DESTINATION share/rtmidi)
++set(RTMIDI_CMAKE_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/rtmidi)
+ 
+ # Export library target (build-tree).
+ export(EXPORT RtMidiTargets
+@@ -280,7 +277,7 @@ include(CMakePackageConfigHelpers)
+ 
+ # Write cmake package version file
+ write_basic_package_version_file(
+-    RtMidi-config-version.cmake
++    RtMidiConfigVersion.cmake
+     VERSION ${FULL_VER}
+     COMPATIBILITY SameMajorVersion
+ )
+@@ -288,15 +285,15 @@ write_basic_package_version_file(
+ # Write cmake package config file
+ configure_package_config_file (
+     cmake/RtMidi-config.cmake.in
+-    RtMidi-config.cmake
++    RtMidiConfig.cmake
+     INSTALL_DESTINATION "${RTMIDI_CMAKE_DESTINATION}"
+ )
+ 
+ # Install package files
+ install (
+     FILES
+-        "${CMAKE_CURRENT_BINARY_DIR}/RtMidi-config.cmake"
+-        "${CMAKE_CURRENT_BINARY_DIR}/RtMidi-config-version.cmake"
++        "${CMAKE_CURRENT_BINARY_DIR}/RtMidiConfig.cmake"
++        "${CMAKE_CURRENT_BINARY_DIR}/RtMidiConfigVersion.cmake"
+     DESTINATION
+         "${RTMIDI_CMAKE_DESTINATION}"
+ )
diff --git a/rtmidi/patches/patch-RtMidi.cpp b/rtmidi/patches/patch-RtMidi.cpp
new file mode 100644
index 0000000000..ff1fb45c84
--- /dev/null
+++ b/rtmidi/patches/patch-RtMidi.cpp
@@ -0,0 +1,23 @@
+$NetBSD$
+
+* use posix sched_yield() instead of linux specific pthread_yield()
+
+--- RtMidi.cpp.orig	2021-11-16 17:19:37.000000000 +0000
++++ RtMidi.cpp
+@@ -3092,6 +3092,7 @@ void MidiOutWinMM :: sendMessage( const 
+ #include <jack/midiport.h>
+ #include <jack/ringbuffer.h>
+ #include <pthread.h>
++#include <sched.h>
+ #ifdef HAVE_SEMAPHORE
+   #include <semaphore.h>
+ #endif
+@@ -3608,7 +3609,7 @@ void MidiOutJack :: sendMessage( const u
+       return;
+ 
+   while ( jack_ringbuffer_write_space(data->buff) < sizeof(nBytes) + size )
+-      pthread_yield();
++      sched_yield();
+ 
+   // Write full message to buffer
+   jack_ringbuffer_write( data->buff, ( char * ) &nBytes, sizeof( nBytes ) );


Home | Main Index | Thread Index | Old Index