diff --git a/.cvsignore b/.cvsignore index ea39678..2405ba3 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -portmidi-src-184.zip +portmidi-src-200.zip diff --git a/portmidi-cmake.patch b/portmidi-cmake.patch index 5c5ca98..e677d6e 100644 --- a/portmidi-cmake.patch +++ b/portmidi-cmake.patch @@ -1,18 +1,7 @@ -diff -rupN portmidi.old/CMakeLists.txt portmidi/CMakeLists.txt ---- portmidi.old/CMakeLists.txt 2009-10-19 15:36:57.000000000 -0400 -+++ portmidi/CMakeLists.txt 2009-11-27 20:20:22.000000000 -0500 -@@ -8,6 +8,7 @@ if(UNIX) - # allow user to set Release or Debug - set(CMAKE_BUILD_TYPE Release CACHE STRING - "Semicolon-separate list of supported configuration types") -+ set(PROJECT_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) - # set default directories but don't override cached values... - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE} - CACHE STRING "libraries go here") -diff -rupN portmidi.old/pm_common/CMakeLists.txt portmidi/pm_common/CMakeLists.txt ---- portmidi.old/pm_common/CMakeLists.txt 2009-10-19 14:41:21.000000000 -0400 -+++ portmidi/pm_common/CMakeLists.txt 2009-11-27 20:33:36.000000000 -0500 -@@ -65,15 +65,12 @@ if(UNIX) +diff -rupN portmidi.old/pm_common/CMakeLists.txt portmidi.new/pm_common/CMakeLists.txt +--- portmidi.old/pm_common/CMakeLists.txt 2009-11-20 01:18:06.000000000 -0500 ++++ portmidi.new/pm_common/CMakeLists.txt 2010-01-30 00:22:50.000000000 -0500 +@@ -72,11 +72,7 @@ if(UNIX) # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation # because JAVA_INCLUDE_PATH2 is pretty obscure) @@ -22,82 +11,86 @@ diff -rupN portmidi.old/pm_common/CMakeLists.txt portmidi/pm_common/CMakeLists.t - # libjvm.so is found relative to JAVA_INCLUDE_PATH: - set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so) + set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}) -+ set(LINUXSRC pmlinuxalsa pmlinux finddefault) prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) -- list(APPEND LIBSRC ../porttime/ptlinux) -+ set(LIBPTSRC ../porttime/ptlinux) +@@ -125,9 +121,9 @@ set_target_properties(pmjni PROPERTIES E + # install the libraries (Linux and Mac OS X command line) + if(UNIX) + INSTALL(TARGETS portmidi-static pmjni +- LIBRARY DESTINATION /usr/local/lib +- ARCHIVE DESTINATION /usr/local/lib) ++ LIBRARY DESTINATION ${LIB_INSTALL_DIR} ++ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) + # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here + # INSTALL(FILES portmidi.h ../porttime/porttime.h +-# DESTINATION /usr/local/include) ++# DESTINATION ${INCLUDE_INSTALL_DIR}) + endif(UNIX) +diff -rupN portmidi.old/pm_dylib/CMakeLists.txt portmidi.new/pm_dylib/CMakeLists.txt +--- portmidi.old/pm_dylib/CMakeLists.txt 2009-11-20 00:41:09.000000000 -0500 ++++ portmidi.new/pm_dylib/CMakeLists.txt 2010-01-30 00:26:15.000000000 -0500 +@@ -59,7 +59,7 @@ if(UNIX) - set(PM_NEEDED_LIBS pthread asound) - endif(APPLE) -@@ -98,29 +95,29 @@ set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${J - # this completes the list of library sources by adding shared code - list(APPEND LIBSRC pmutil portmidi) + set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework") + set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers) +- set(INSTALL_NAME_DIR "/usr/local/lib") ++ set(INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) + message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) + else(APPLE) + # LINUX settings... +@@ -75,11 +75,7 @@ if(UNIX) + # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH + # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation + # because JAVA_INCLUDE_PATH2 is pretty obscure) +- set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN} +- CACHE STRING "where to find Java SDK include directory") +- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux) +- # libjvm.so is found relative to JAVA_INCLUDE_PATH: +- set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so) ++ set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}) --# now add the shared files to make the complete list of library sources --add_library(portmidi-static ${LIBSRC}) --set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi_s") --target_link_libraries(portmidi-static ${PM_NEEDED_LIBS}) -+add_library(porttime-dynamic SHARED ${LIBPTSRC}) -+set_target_properties(porttime-dynamic PROPERTIES SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "porttime") -+target_link_libraries(porttime-dynamic pthread) + set(LINUXSRC pmlinuxalsa pmlinux finddefault) + prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) +@@ -114,14 +110,14 @@ prepend_path(SHARED_PATHS ../pm_common/ + list(APPEND LIBSRC ${SHARED_PATHS}) add_library(portmidi-dynamic SHARED ${LIBSRC}) -set_target_properties(portmidi-dynamic PROPERTIES OUTPUT_NAME "portmidi") --target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS}) -- -+add_dependencies(portmidi-dynamic porttime-dynamic) -+set_target_properties(portmidi-dynamic PROPERTIES LINK_FLAGS "-L../build/Release" SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "portmidi") -+target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS} porttime) - - # define the jni library - include_directories(${JAVA_INCLUDE_PATHS}) - - set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c) - add_library(pmjni SHARED ${JNISRC}) --target_link_libraries(pmjni ${JNI_EXTRA_LIBS}) --set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib") -+add_dependencies(pmjni porttime-dynamic) -+target_link_libraries(pmjni ${JNI_EXTRA_LIBS} porttime) -+set_target_properties(pmjni PROPERTIES LINK_FLAGS "-L../build/Release" EXECUTABLE_EXTENSION "jnilib") ++set_target_properties(portmidi-dynamic PROPERTIES LINK_FLAGS "-L${CMAKE_CACHEFILE_DIR}/Release" SOVERSION 0 VERSION 0.${VERSION} OUTPUT_NAME "portmidi") + target_link_libraries(portmidi-dynamic ${PM_NEEDED_LIBS}) - # install the libraries (Linux only) - if(UNIX AND NOT APPLE) -- INSTALL(TARGETS portmidi-static portmidi-dynamic pmjni + # install the libraries (Linux and Mac OS X command line) + if(UNIX) + INSTALL(TARGETS portmidi-dynamic - LIBRARY DESTINATION /usr/local/lib - ARCHIVE DESTINATION /usr/local/lib) -+ INSTALL(TARGETS porttime-dynamic portmidi-dynamic pmjni + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) - INSTALL(FILES portmidi.h ../porttime/porttime.h + INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h - DESTINATION /usr/local/include) + DESTINATION ${INCLUDE_INSTALL_DIR}) - endif(UNIX AND NOT APPLE) -diff -rupN portmidi.old/pm_java/CMakeLists.txt portmidi/pm_java/CMakeLists.txt ---- portmidi.old/pm_java/CMakeLists.txt 2009-10-14 14:04:06.000000000 -0400 -+++ portmidi/pm_java/CMakeLists.txt 2009-11-27 20:20:22.000000000 -0500 -@@ -39,9 +39,9 @@ if(UNIX) - - # install the libraries (Linux only) + endif(UNIX) +diff -rupN portmidi.old/pm_java/CMakeLists.txt portmidi.new/pm_java/CMakeLists.txt +--- portmidi.old/pm_java/CMakeLists.txt 2009-11-04 10:20:44.000000000 -0500 ++++ portmidi.new/pm_java/CMakeLists.txt 2010-01-30 00:28:35.000000000 -0500 +@@ -41,7 +41,7 @@ if(UNIX) INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar -- DESTINATION /usr/share/java) -+ DESTINATION ${SHARE_INSTALL_PREFIX}/java) + DESTINATION /usr/share/java) INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults - DESTINATION /usr/local/bin) + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) endif(APPLE) endif(UNIX) # In windows, use pm_java/make.bat -diff -rupN portmidi.old/pm_test/CMakeLists.txt portmidi/pm_test/CMakeLists.txt ---- portmidi.old/pm_test/CMakeLists.txt 2009-10-19 14:41:21.000000000 -0400 -+++ portmidi/pm_test/CMakeLists.txt 2009-11-27 20:20:22.000000000 -0500 -@@ -8,7 +8,8 @@ endif(APPLE) +diff -rupN portmidi.old/pm_test/CMakeLists.txt portmidi.new/pm_test/CMakeLists.txt +--- portmidi.old/pm_test/CMakeLists.txt 2009-11-04 10:20:44.000000000 -0500 ++++ portmidi.new/pm_test/CMakeLists.txt 2010-01-30 00:41:56.000000000 -0500 +@@ -12,7 +12,7 @@ endif(WIN32) macro(make_a_test name) add_executable(${name} ${name}.c) - target_link_libraries(${name} portmidi-static ${PM_NEEDED_LIBS}) -+ set_target_properties(${name} PROPERTIES LINK_FLAGS "-L${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}") + target_link_libraries(${name} portmidi-dynamic ${PM_NEEDED_LIBS}) endmacro(make_a_test) diff --git a/portmidi.spec b/portmidi.spec index 18b28b2..4c40494 100644 --- a/portmidi.spec +++ b/portmidi.spec @@ -1,7 +1,8 @@ +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %global with_gcj %{!?_without_gcj:1}%{?_without_gcj:0} Summary: Real-time Midi I/O Library Name: portmidi -Version: 184 +Version: 200 Release: 1%{?dist} License: MIT Group: System Environment/Libraries @@ -16,6 +17,7 @@ BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: java-devel >= 1.5 BuildRequires: jpackage-utils +BuildRequires: python-devel BuildRequires: doxygen BuildRequires: tex(latex) BuildRequires: java-gcj-compat-devel >= 1.0.31 @@ -39,6 +41,18 @@ implementations for music and other media. PortMidi subproject provides a real-time MIDI input/output library. This package contains the header files and the documentation of PortMidi libraries. +%package -n python-%{name} +Summary: Python wrapper for %{name} +Group: System Environment/Libraries +Requires: %{name} = %{version}-%{release} + +%description -n python-%{name} +PortMedia is a set of simple clean APIs and cross-platform library +implementations for music and other media. PortMidi subproject provides a +real-time MIDI input/output library. This package contains the python +bindings of PortMidi libraries. It can send and receive MIDI data in +real-time from Python. + %package tools Summary: Tools to configure and use %{name} Group: Applications/Multimedia @@ -83,7 +97,7 @@ sed -i -e 's|^java|#!/bin/sh\njava \\\ %build export JAVA_HOME=%{java_home} -%cmake -DVERSION=%{version} . +%cmake -DCMAKE_CACHEFILE_DIR=%{_builddir}/%{name}/build -DVERSION=%{version} . make %{?_smp_flags} # Build the doxygen documentation: @@ -92,6 +106,12 @@ pushd latex make %{?_smp_flags} popd +# Build python modules +pushd pm_python + gcc %{optflags} -fPIC -c -o pypm.o -I../pm_common \ + -I../porttime -I%{_includedir}/python2.6/ pypm.c + gcc -shared -o pypm.so pypm.o -lportmidi -lpython2.6 -L../build/Release +popd %install rm -rf %{buildroot} @@ -99,7 +119,7 @@ make install DESTDIR=%{buildroot} # Install the test applications: install -d %{buildroot}%{_libdir}/%{name} -for app in latency midiclock midithread midithru mm sysex test; do +for app in latency midiclock midithread midithru mm qtest sysex test; do install -m 0755 build/Release/$app %{buildroot}%{_libdir}/%{name}/ done @@ -117,12 +137,16 @@ install -pm 644 pm_java/pmdefaults/pmdefaults-icon.png \ # desktop file mkdir -p %{buildroot}%{_desktopdir}/ desktop-file-install \ - --dir=${RPM_BUILD_ROOT}%{_desktopdir} \ + --dir=%{buildroot}%{_desktopdir} \ %{SOURCE1} # Why don't they install this header file? install -pm 644 pm_common/pmutil.h %{buildroot}%{_includedir}/ +# Install python modules +mkdir -p %{buildroot}%{python_sitearch} +install -pm 755 pm_python/pypm.so %{buildroot}%{python_sitearch}/ + # AOT bits %if %{with_gcj} %{_bindir}/aot-compile-rpm @@ -168,6 +192,10 @@ rm -rf %{buildroot} %{_libdir}/gcj/%{name}/ %endif +%files -n python-%{name} +%defattr(-,root,root,-) +%doc pm_python/README.txt pm_python/test.py pm_python/miniTest.py +%{python_sitearch}/pypm.so %files devel %defattr(-,root,root,-) @@ -177,6 +205,10 @@ rm -rf %{buildroot} %{_libdir}/lib*.so %changelog +* Sat Jan 30 2010 Orcan Ogetbil 200-1 +- Update to 200. +- Add python subpackage + * Fri Nov 27 2009 Orcan Ogetbil 184-1 - Update to 184. Build system uses cmake now. diff --git a/sources b/sources index 59a6efd..72c553d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6d242a5cfe802cace10af733c185d1b6 portmidi-src-184.zip +26053a105d938395227bb6ae1d78643b portmidi-src-200.zip