[rtmidi] Initial import

cheeselee cheeselee at fedoraproject.org
Wed Oct 12 02:05:09 UTC 2011


commit c279ea57a9df544b833d367db8c63f3b4c89aab2
Author: Robin Lee <cheeselee at fedoraproject.org>
Date:   Wed Oct 12 10:04:53 2011 +0800

    Initial import

 .gitignore                            |    1 +
 rtmidi-1.0.15-shared-linux-only.patch |  167 +++++++++++++++++++++++++++++++++
 rtmidi.spec                           |  116 +++++++++++++++++++++++
 sources                               |    1 +
 4 files changed, 285 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..ca030dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/rtmidi-1.0.15.tar.gz
diff --git a/rtmidi-1.0.15-shared-linux-only.patch b/rtmidi-1.0.15-shared-linux-only.patch
new file mode 100644
index 0000000..9a95125
--- /dev/null
+++ b/rtmidi-1.0.15-shared-linux-only.patch
@@ -0,0 +1,167 @@
+diff --git a/Makefile.in b/Makefile.in
+new file mode 100644
+index 0000000..2e67922
+--- /dev/null
++++ b/Makefile.in
+@@ -0,0 +1,38 @@
++### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in
++### RtMidi shared object Makefile - for various flavors of unix
++
++PACKAGE_TARNAME = rtmidi
++prefix = @prefix@
++exec_prefix = @exec_prefix@
++LIBDIR = $(DESTDIR)@libdir@
++INCLUDEDIR = $(DESTDIR)@includedir@
++DOCDIR = $(DESTDIR)@docdir@
++
++RM = /bin/rm
++CP = /bin/cp -p
++MKDIR_P = /bin/mkdir -p
++LN_S = ln -f -s
++CC = @CXX@
++SOURCE = RtMidi.cpp
++LIBS = @LIBS@
++HEADERS = RtMidi.h RtError.h
++PC_FILE = @PC_FILE@
++SONAME = lib at SONAME@.so
++
++ at SONAME@. at VERSION@ : $(SOURCE)
++	$(CC) $(CXXFLAGS) @CPPFLAGS@ -fvisibility=hidden -fPIC -o $(SONAME). at VERSION@ -shared -Wl,-soname=$(SONAME). at SO_VERSION@ $(LIBS) $(SOURCE)
++
++install : $(SONAME). at VERSION@
++	$(MKDIR_P) $(LIBDIR)
++	$(CP) $(SONAME). at VERSION@ $(LIBDIR)
++	$(LN_S) $(SONAME). at VERSION@ $(LIBDIR)/$(SONAME). at SO_VERSION@
++	$(LN_S) $(SONAME). at SO_VERSION@ $(LIBDIR)/$(SONAME)
++	$(MKDIR_P) $(LIBDIR)/pkgconfig
++	$(CP) $(PC_FILE) $(LIBDIR)/pkgconfig
++	$(MKDIR_P) $(INCLUDEDIR)
++	$(CP) $(HEADERS) $(INCLUDEDIR)
++	$(MKDIR_P) $(DOCDIR)
++	$(CP) -R readme doc/* $(DOCDIR)
++
++clean :
++	$(RM) -f $(SONAME)* *.pc config.*
+diff --git a/RtMidi.cpp b/RtMidi.cpp
+index 1cf32d4..959989d 100644
+--- a/RtMidi.cpp
++++ b/RtMidi.cpp
+@@ -69,7 +69,7 @@ void RtMidi :: error( RtError::Type type )
+ //  Common RtMidiIn Definitions
+ //*********************************************************************//
+ 
+-RtMidiIn :: RtMidiIn( const std::string clientName, unsigned int queueSizeLimit ) : RtMidi()
++extern RTMIDI_DLL_PUBLIC RtMidiIn :: RtMidiIn( const std::string clientName, unsigned int queueSizeLimit ) : RtMidi()
+ {
+   this->initialize( clientName );
+ 
+@@ -147,7 +147,7 @@ double RtMidiIn :: getMessage( std::vector<unsigned char> *message )
+ //  Common RtMidiOut Definitions
+ //*********************************************************************//
+ 
+-RtMidiOut :: RtMidiOut( const std::string clientName ) : RtMidi()
++extern RTMIDI_DLL_PUBLIC RtMidiOut :: RtMidiOut( const std::string clientName ) : RtMidi()
+ {
+   this->initialize( clientName );
+ }
+diff --git a/RtMidi.h b/RtMidi.h
+index f0fb8bb..4ae875d 100644
+--- a/RtMidi.h
++++ b/RtMidi.h
+@@ -40,6 +40,16 @@
+ #ifndef RTMIDI_H
+ #define RTMIDI_H
+ 
++#if defined _WIN32 || defined __CYGWIN__
++  #define RTMIDI_DLL_PUBLIC
++#else
++  #if __GNUC__ >= 4
++    #define RTMIDI_DLL_PUBLIC __attribute__( (visibility( "default" )) )
++  #else
++    #define RTMIDI_DLL_PUBLIC
++  #endif
++#endif
++
+ #include "RtError.h"
+ #include <string>
+ 
+@@ -97,7 +107,7 @@ class RtMidi
+ 
+ #include <vector>
+ 
+-class RtMidiIn : public RtMidi
++class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
+ {
+  public:
+ 
+@@ -246,7 +256,7 @@ o      By default, MIDI timing and active sensing messages are ignored
+ */
+ /**********************************************************************/
+ 
+-class RtMidiOut : public RtMidi
++class RTMIDI_DLL_PUBLIC RtMidiOut : public RtMidi
+ {
+  public:
+ 
+diff --git a/configure.ac b/configure.ac
+index c093532..0b390d1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,5 +1,7 @@
+ # Process this file with autoconf to produce a configure script.
+ AC_INIT(RtMidi, 1.0, gary at music.mcgill.ca, rtmidi)
++AC_SUBST(VERSION, [1.0.15])
++AC_SUBST(SO_VERSION, [0])
+ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_SRCDIR(RtMidi.cpp)
+ AC_CONFIG_FILES(tests/Makefile)
+@@ -40,17 +42,28 @@ AC_CANONICAL_HOST
+ AC_MSG_CHECKING(for MIDI API)
+ case $host in
+   *-*-linux*)
++  AC_CONFIG_FILES(Makefile)
+   AC_SUBST( api, [""] )
+   AC_ARG_WITH(jack, [  --with-jack = choose JACK server support (linux only)], [
+   AC_SUBST( api, [-D__LINUX_JACK__] )
+   AC_MSG_RESULT(using JACK)
+-  AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], )
++  AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))
++  AC_SUBST(PC_FILE, [rtmidi-jack.pc])
++  AC_SUBST(api_type, ["Linux JACK"])
++  AC_SUBST(pc_requires, [jack])
++  AC_CONFIG_FILES($PC_FILE:rtmidi.pc.in)
++  AC_SUBST(SONAME, [rtmidi-jack])] , )
+ 
+   if [test "$api" == "";] then
+     AC_SUBST( api, [-D__LINUX_ALSASEQ__] )
+     AC_CHECK_LIB(asound, snd_seq_open, , AC_MSG_ERROR(RtMidi in Linux requires the ALSA asound library!))
+     # Checks for pthread library.
+     AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtMidi requires the pthread library!))
++    AC_SUBST(api_type, ["Linux ALSA"])
++    AC_SUBST(pc_requires, [alsa])
++    AC_SUBST(SONAME, [rtmidi])
++    AC_SUBST(PC_FILE, [rtmidi.pc])
++    AC_CONFIG_FILES(rtmidi.pc)
+   fi
+ 
+   ;;
+diff --git a/rtmidi.pc.in b/rtmidi.pc.in
+new file mode 100644
+index 0000000..8400932
+--- /dev/null
++++ b/rtmidi.pc.in
+@@ -0,0 +1,14 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: @SONAME@
++Description: Library for realtime MIDI input/output (@api_type@ support)
++Version: @VERSION@
++URL: http://www.music.mcgill.ca/~gary/rtmidi/index.html
++Requires: @pc_requires@
++Conflicts:
++Libs: -L${libdir} -l at SONAME@
++Libs.private:  
++Cflags: @api@
diff --git a/rtmidi.spec b/rtmidi.spec
new file mode 100644
index 0000000..bb382ff
--- /dev/null
+++ b/rtmidi.spec
@@ -0,0 +1,116 @@
+Name:       rtmidi
+Version:    1.0.15
+Release:    2%{?dist}
+Summary:    Library for realtime MIDI input/output (ALSA support)
+# Request to send in changes is considered optional.
+License:    MIT
+URL:        http://www.music.mcgill.ca/~gary/rtmidi/index.html
+Source0:    http://www.music.mcgill.ca/~gary/rtmidi/release/%{name}-%{version}.tar.gz
+Patch0:     rtmidi-1.0.15-shared-by-robin.patch
+BuildRequires:  alsa-lib-devel, jack-audio-connection-kit-devel
+BuildRequires:  /usr/bin/autoconf, /usr/bin/dos2unix
+
+%description
+RtMidi is a set of C++ classes (RtMidiIn and RtMidiOut) that provides a common 
+API (Application Programming Interface) for realtime MIDI input/output across 
+Linux (ALSA & Jack), Macintosh OS X, Windows (Multimedia Library), and SGI 
+operating systems. RtMidi significantly simplifies the process of interacting 
+with computer MIDI hardware and software. It was designed with the following 
+goals:
+* object oriented C++ design
+* simple, common API across all supported platforms
+* only two header files and one source file for easy inclusion in programming 
+  projects
+* MIDI device enumeration
+
+This package contains the RtMidi library compiled for ALSA support.
+
+%package devel
+Summary:    Development headers and libraries for rtmidi
+Requires:   %{name}%{?_isa} = %{version}-%{release}
+Requires:   %{name}-jack%{?_isa} = %{version}-%{release}
+Requires:   alsa-lib-devel, jack-audio-connection-kit-devel
+
+%description devel
+Development headers and libraries for rtmidi.
+
+%package jack
+Summary:    Library for realtime MIDI input/output (JACK support)
+
+%description jack
+RtMidi is a set of C++ classes (RtMidiIn and RtMidiOut) that provides a common
+API (Application Programming Interface) for realtime MIDI input/output across
+Linux (ALSA & Jack), Macintosh OS X, Windows (Multimedia Library), and SGI 
+operating systems. RtMidi significantly simplifies the process of interacting 
+with computer MIDI hardware and software. It was designed with the following 
+goals:
+* object oriented C++ design
+* simple, common API across all supported platforms
+* only two header files and one source file for easy inclusion in programming 
+  projects
+* MIDI device enumeration
+
+This package contains the RtMidi library compiled for Jack support.
+
+%prep
+%setup -q
+%patch0 -p1 -b .shared
+autoconf -f
+# fix end of line
+dos2unix doc/release.txt doc/doxygen/tutorial.txt
+
+%build
+# First pass, jack.
+%configure --docdir=%{_docdir}/%{name}-devel-%{version} --with-jack
+make
+mv Makefile Makefile-jack
+
+# Second pass, alsa
+%configure --docdir=%{_docdir}/%{name}-devel-%{version}
+make
+
+%install
+# First pass, jack.
+make -f Makefile-jack install DESTDIR=%{buildroot}
+
+# Second pass, alsa
+make install DESTDIR=%{buildroot}
+
+# Include the readme in non-devel packages
+rm -f %{buildroot}%{_docdir}/%{name}-devel-%{version}/readme
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%post jack -p /sbin/ldconfig
+%postun jack -p /sbin/ldconfig
+
+%files
+%doc readme
+%{_libdir}/lib%{name}.so.*
+
+%files devel
+%{_docdir}/%{name}-devel-%{version}/
+%{_includedir}/RtMidi.h
+%{_includedir}/RtError.h
+%{_libdir}/lib%{name}.so
+%{_libdir}/lib%{name}-jack.so
+%{_libdir}/pkgconfig/%{name}.pc
+%{_libdir}/pkgconfig/%{name}-jack.pc
+
+%files jack
+%doc readme
+%{_libdir}/lib%{name}-jack.so.*
+
+%changelog
+* Fri Sep 23 2011 Robin Lee <cheeselee at fedoraproject.org> - 1.0.15-2
+- Include an enhanced patch
+- Provide Makefile.in, rtmidi.pc.in, rtmidi-jack.pc.in and a patch to
+  configure.ac to generate the required files on configuration
+- Provide a macro instead of hard coding __attribute__ instruction
+- Exclude the test apps
+- Include the documents in the devel package
+- Untabified
+
+* Thu Sep 1 2011 Tom Callaway <spot at fedoraproject.org> - 1.0.15-1
+- initial package
diff --git a/sources b/sources
index e69de29..581e29e 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a500b0a80dbf0a0f4a9b69cd7af134e2  rtmidi-1.0.15.tar.gz


More information about the scm-commits mailing list