summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Barker (KWhat) <alex@1stleg.com>2011-05-04 19:16:47 +0000
committerAlex Barker (KWhat) <alex@1stleg.com>2011-05-04 19:16:47 +0000
commitc913ddb13c4066475e7e44f7e4cb6a9bf44ede19 (patch)
tree49ac35a2cf9c0462b4aaf797e7a57adb7cbcb032
parentsci-geosciences/opencpn: Version bumb for opencpn, added gpsd useflag, gpsd d... (diff)
downloadsunrise-c913ddb13c4066475e7e44f7e4cb6a9bf44ede19.tar.gz
sunrise-c913ddb13c4066475e7e44f7e4cb6a9bf44ede19.tar.bz2
sunrise-c913ddb13c4066475e7e44f7e4cb6a9bf44ede19.zip
media-libs/portmidi: New Ebuild for bug 90614 thanks to Gavin Pryke for creating a working ebuild and patches.
svn path=/sunrise/; revision=12041
-rw-r--r--media-libs/portmidi/ChangeLog11
-rw-r--r--media-libs/portmidi/Manifest7
-rw-r--r--media-libs/portmidi/files/portmidi-217-cmake-libdir-java-opts.patch211
-rw-r--r--media-libs/portmidi/files/portmidi-217-java-path.patch17
-rw-r--r--media-libs/portmidi/files/portmidi-217-python-setup.py.patch12
-rw-r--r--media-libs/portmidi/metadata.xml9
-rw-r--r--media-libs/portmidi/portmidi-217.ebuild152
7 files changed, 419 insertions, 0 deletions
diff --git a/media-libs/portmidi/ChangeLog b/media-libs/portmidi/ChangeLog
new file mode 100644
index 000000000..5c515fb1d
--- /dev/null
+++ b/media-libs/portmidi/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for media-libs/portmidi
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 04 May 2011; Alex Barker (KWhat) <alex@1stleg.com> +portmidi-217.ebuild,
+ +files/portmidi-217-cmake-libdir-java-opts.patch,
+ +files/portmidi-217-java-path.patch,
+ +files/portmidi-217-python-setup.py.patch, +metadata.xml:
+ New Ebuild for bug 90614 thanks to Gavin Pryke for creating a working ebuild
+ and patches.
+
diff --git a/media-libs/portmidi/Manifest b/media-libs/portmidi/Manifest
new file mode 100644
index 000000000..4e5e14755
--- /dev/null
+++ b/media-libs/portmidi/Manifest
@@ -0,0 +1,7 @@
+AUX portmidi-217-cmake-libdir-java-opts.patch 8488 RMD160 1406b491ff4f2f4fa37144279a69a13142b007b9 SHA1 6a343969f3a224351e4f1fda49de3c430a6acaef SHA256 d0383ccd61281fc4f5730f48a3cea36c4c309a234ae0ebb04b18c760ace272c9
+AUX portmidi-217-java-path.patch 987 RMD160 ffb9f6f3f92aef32b639acc150d3ba64f20b8f93 SHA1 cbdec7ddd929a21a7d47cd2de18fde26e973a255 SHA256 cbe891a8b4fd9c6be5292e44bbe3ae1d7ffa4b56f520aec48b1564d8c26e2d3a
+AUX portmidi-217-python-setup.py.patch 604 RMD160 785a4ec1e67cf36a7fafa3c4fe9017bef68b9efa SHA1 8cbdcb76ac08f267f95c2a2542dcbe175125fa91 SHA256 46af585e865bb509f4c91b03aa3e39218ba3fc312067587d147c5f217a934f1d
+DIST portmidi-src-217.zip 1030830 RMD160 f83aa8288063690ff60654fa291e2982ba637633 SHA1 f45bf4e247c0d7617deacd6a65d23d9fddae6117 SHA256 08e9a892bd80bdb1115213fb72dc29a7bf2ff108b378180586aa65f3cfd42e0f
+EBUILD portmidi-217.ebuild 4316 RMD160 01879801d2784777ebbb5a66c8e0e759b86171b6 SHA1 22ab0a7f9434ebd5e98e52bab929e514cf97a2ed SHA256 9bddbc48a64c7d3bfb6c710ebd098f873df5ff962303a451521c93015d84cd65
+MISC ChangeLog 441 RMD160 c4bab8f737af0e542650040be324ca22d9811ccb SHA1 82c6eabdc1ea6e2efe3053ab4a80b89fa29457ac SHA256 b24c26c44153c69e7a40f9f611829779e5f5f9c5cdc8860dd00f4998a7ff8bc0
+MISC metadata.xml 332 RMD160 19ba6087644cc5c45f764ec827ee75e86a18141d SHA1 359b7be6940b8406c0cd019dba4a5a8c02d7ae2e SHA256 3370a30b50bf9c134bd29261bbd926ce398b0f5b24658f6d5b40ccc002d064b0
diff --git a/media-libs/portmidi/files/portmidi-217-cmake-libdir-java-opts.patch b/media-libs/portmidi/files/portmidi-217-cmake-libdir-java-opts.patch
new file mode 100644
index 000000000..ced114b50
--- /dev/null
+++ b/media-libs/portmidi/files/portmidi-217-cmake-libdir-java-opts.patch
@@ -0,0 +1,211 @@
+--- portmidi/CMakeLists.txt.old 2010-08-03 21:46:45.000000000 +0100
++++ portmidi/CMakeLists.txt 2010-08-03 21:50:17.000000000 +0100
+@@ -65,6 +65,8 @@
+ endif(CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES ${BAD_DIR})
+ endif(UNIX)
+
++option(PORTMIDI_ENABLE_JAVA "Enable Java bindings support" ON)
++
+ include_directories(pm_common porttime)
+ add_subdirectory(pm_common)
+
+@@ -73,5 +77,9 @@
+ add_subdirectory(pm_dylib)
+
+ # Cannot figure out how to make an xcode Java application with CMake
+-add_subdirectory(pm_java)
++if(PORTMIDI_ENABLE_JAVA)
++ set(JAR_INSTALL_DIR share/java
++ CACHE STRING "Define directory name for jar installation")
++ add_subdirectory(pm_java)
++endif(PORTMIDI_ENABLE_JAVA)
+
+--- portmidi/pm_common/CMakeLists.txt.old 2010-10-01 13:33:52.000000000 +0100
++++ portmidi/pm_common/CMakeLists.txt 2010-10-01 14:02:55.000000000 +0100
+@@ -62,19 +62,23 @@
+ ${COREMIDI_LIB} ${CORESERVICES_LIB}
+ CACHE INTERNAL "")
+
+- set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
+- set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
++ if(PORTMIDI_ENABLE_JAVA)
++ set(JAVAVM_LIB "${FRAMEWORK_PATH}/JavaVM.framework")
++ set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers)
++ endif(PORTMIDI_ENABLE_JAVA)
+ message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
+ else(APPLE)
+ # LINUX settings...
+- include(FindJNI)
+- message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
+- message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
+- message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
+- message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
+- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
+- # libjvm.so is found relative to JAVA_INCLUDE_PATH:
+- set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
++ if(PORTMIDI_ENABLE_JAVA)
++ include(FindJNI)
++ message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
++ message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
++ message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
++ message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
++ set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
++ # libjvm.so is found relative to JAVA_INCLUDE_PATH:
++ set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
++ endif(PORTMIDI_ENABLE_JAVA)
+
+ set(LINUXSRC pmlinuxalsa pmlinux finddefault)
+ prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
+@@ -88,10 +92,12 @@
+ # /MD is multithread DLL, /MT is multithread. Change to static:
+ include(../pm_win/static.cmake)
+
+- include(FindJNI)
++ if(PORTMIDI_ENABLE_JAVA)
++ include(FindJNI)
+
+- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
+- # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
++ set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
++ # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
++ endif(PORTMIDI_ENABLE_JAVA)
+
+ set(WINSRC pmwin pmwinmm)
+ prepend_path(LIBSRC ../pm_win/ ${WINSRC})
+@@ -99,29 +105,39 @@
+ set(PM_NEEDED_LIBS winmm.lib)
+ endif(WIN32)
+ endif(UNIX)
+-set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
++
++if(PORTMIDI_ENABLE_JAVA)
++ set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
++endif(PORTMIDI_ENABLE_JAVA)
+
+ # this completes the list of library sources by adding shared code
+ list(APPEND LIBSRC pmutil portmidi)
+
+ # 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")
++set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi")
+ target_link_libraries(portmidi-static ${PM_NEEDED_LIBS})
+
+-# 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")
++if(PORTMIDI_ENABLE_JAVA)
++ # 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")
++endif(PORTMIDI_ENABLE_JAVA)
+
+ # 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)
++ INSTALL(TARGETS portmidi-static
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX})
++ if(PORTMIDI_ENABLE_JAVA)
++ INSTALL(TARGETS pmjni
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX})
++ endif(PORTMIDI_ENABLE_JAVA)
+ # .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)
+--- portmidi.old/pm_dylib/CMakeLists.txt 2010-10-01 13:33:56.000000000 +0100
++++ portmidi/pm_dylib/CMakeLists.txt 2010-10-11 15:13:47.000000000 +0100
+@@ -63,7 +63,8 @@
+ message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
+ else(APPLE)
+ # LINUX settings...
+- include(FindJNI)
++ if(PORTMIDI_ENABLE_JAVA)
++ include(FindJNI)
+ # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
+ # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
+ # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
+@@ -75,11 +76,8 @@
+ # 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})
++ endif(PORTMIDI_ENABLE_JAVA)
+
+ set(LINUXSRC pmlinuxalsa pmlinux finddefault)
+ prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
+@@ -91,13 +89,15 @@
+ if(WIN32)
+ # /MDd is multithread debug DLL, /MTd is multithread debug
+ # /MD is multithread DLL, /MT is multithread
+-
+- include(FindJNI)
+- # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
+- set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../lib/jvm.lib)
+
+- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
+- # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
++ if(PORTMIDI_ENABLE_JAVA)
++ include(FindJNI)
++ # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
++ set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../lib/jvm.lib)
++
++ set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
++ # message(STATUS "JAVA_INCLUDE_PATHS: " ${JAVA_INCLUDE_PATHS})
++ endif(PORTMIDI_ENABLE_JAVA)
+
+ set(WINSRC pmwin pmwinmm)
+ prepend_path(LIBSRC ../pm_win/ ${WINSRC})
+@@ -106,7 +106,10 @@
+ # message(STATUS "JAVAVM_LIB: " ${JAVAVM_LIB})
+ endif(WIN32)
+ endif(UNIX)
++
++if(PORTMIDI_ENABLE_JAVA)
+ set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVAVM_LIB})
++endif(PORTMIDI_ENABLE_JAVA)
+
+ # this completes the list of library sources by adding shared code
+ set(SHARED_FILES pmutil portmidi)
+@@ -120,8 +123,8 @@
+ # 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)
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX})
+ INSTALL(FILES ../pm_common/portmidi.h ../porttime/porttime.h
+- DESTINATION /usr/local/include)
++ DESTINATION include)
+ endif(UNIX)
+--- portmidi/pm_java/CMakeLists.txt.old 2010-08-03 21:47:24.000000000 +0100
++++ portmidi/pm_java/CMakeLists.txt 2010-08-03 22:03:54.000000000 +0100
+@@ -39,9 +39,9 @@
+
+ # install the libraries (Linux only)
+ INSTALL(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults.jar
+- DESTINATION /usr/share/java)
++ DESTINATION ${JAR_INSTALL_DIR})
+ INSTALL(PROGRAMS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pmdefaults
+- DESTINATION /usr/local/bin)
++ DESTINATION bin)
+ endif(APPLE)
+ endif(UNIX)
+ # In windows, use pm_java/make.bat
diff --git a/media-libs/portmidi/files/portmidi-217-java-path.patch b/media-libs/portmidi/files/portmidi-217-java-path.patch
new file mode 100644
index 000000000..dd0fb864a
--- /dev/null
+++ b/media-libs/portmidi/files/portmidi-217-java-path.patch
@@ -0,0 +1,17 @@
+--- portmidi/pm_java/CMakeLists.txt.old 2011-04-29 13:52:34.000000000 -0700
++++ portmidi/pm_java/CMakeLists.txt 2011-04-29 13:52:13.000000000 -0700
+@@ -13,12 +13,12 @@
+ set(PMDEFAULTS_ALL_CLASSES ${JPORTMIDICLASS2} ${PMDEFAULTSCLASS2})
+ # message(STATUS "PMDEFAULTS_ALL_CLASSES is " ${PMDEFAULTS_ALL_CLASSES})
+ add_custom_command(OUTPUT pmdefaults/PmDefaultsFrame.class
+- COMMAND javac -classpath . pmdefaults/PmDefaultsFrame.java
++ COMMAND javac -classpath ${CMAKE_SOURCE_DIR}/pm_java pmdefaults/PmDefaultsFrame.java
+ MAIN_DEPENDENCY pmdefaults/PmDefaultsFrame.java
+ DEPENDS pmdefaults/PmDefaults.java
+ WORKING_DIRECTORY pm_java)
+ add_custom_command(OUTPUT pmdefaults/PmDefaults.class
+- COMMAND javac -classpath . pmdefaults/PmDefaults.java
++ COMMAND javac -classpath ${CMAKE_SOURCE_DIR}/pm_java pmdefaults/PmDefaults.java
+ MAIN_DEPENDENCY pmdefaults/PmDefaults.java
+ DEPENDS pmdefaults/PmDefaultsFrame.java
+ WORKING_DIRECTORY pm_java)
diff --git a/media-libs/portmidi/files/portmidi-217-python-setup.py.patch b/media-libs/portmidi/files/portmidi-217-python-setup.py.patch
new file mode 100644
index 000000000..b13463b24
--- /dev/null
+++ b/media-libs/portmidi/files/portmidi-217-python-setup.py.patch
@@ -0,0 +1,12 @@
+--- portmidi/pm_python/setup.py.old 2010-11-05 14:43:04.000000000 +0000
++++ portmidi/pm_python/setup.py 2010-11-05 17:40:26.000000000 +0000
+@@ -173,7 +173,8 @@
+ EXTENSION = dict(
+ ext_modules=[
+ Extension("pyportmidi._pyportmidi", [os.path.join("pyportmidi", "_pyportmidi.pyx")],
+- library_dirs=["./linux"],
++ library_dirs=["../build/Release", "../build/Debug"],
++ include_dirs=["../pm_common", "../porttime"],
+ libraries = ["portmidi", "asound", "pthread"]
+ )
+ ]
diff --git a/media-libs/portmidi/metadata.xml b/media-libs/portmidi/metadata.xml
new file mode 100644
index 000000000..0920d10e9
--- /dev/null
+++ b/media-libs/portmidi/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sound</herd>
+ <maintainer><email>maintainer-wanted@gentoo.org</email></maintainer>
+ <use>
+ <flag name='test-programs'>Install tools for testing of various midi functions</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-libs/portmidi/portmidi-217.ebuild b/media-libs/portmidi/portmidi-217.ebuild
new file mode 100644
index 000000000..f5eaf44bc
--- /dev/null
+++ b/media-libs/portmidi/portmidi-217.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=3
+
+inherit cmake-utils eutils multilib java-pkg-opt-2 distutils
+
+DESCRIPTION="A library for real time MIDI input and output"
+HOMEPAGE="http://portmedia.sourceforge.net/"
+SRC_URI="mirror://sourceforge/portmedia/${PN}-src-${PV}.zip"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug java python test-programs"
+
+PYTHON_DEPEND="python? 2:2.6"
+
+CDEPEND="media-libs/alsa-lib"
+RDEPEND="${CDEPEND}
+ java? ( >=virtual/jre-1.6 )"
+DEPEND="${CDEPEND}
+ java? ( >=virtual/jdk-1.6 )
+ python? ( >=dev-python/cython-0.12.1 )
+ app-arch/unzip"
+# build of docs not working
+# doc? ( app-doc/doxygen
+# virtual/latex-base )"
+
+S="${WORKDIR}/${PN}"
+
+# Bug #3295129 reported upstream
+CMAKE_IN_SOURCE_BUILD=1
+
+# seems to be needed, if the default "Gentoo" is used there will be
+# problems. f.e. no midi devices in pmdefaults, maybe even no midi devices at
+# all.
+CMAKE_BUILD_TYPE=$(use debug && echo Debug || echo Release)
+
+src_prepare() {
+ # with this patch the java installation directories can be specified and
+ # allows java to be enabled/disabled
+ epatch "${FILESDIR}/${P}-cmake-libdir-java-opts.patch"
+
+ # find the header and our compiled libs in the distutils setup.py
+ epatch "${FILESDIR}/${P}-python-setup.py.patch"
+
+ if use java ; then
+ # this stuff fixes up the pmdefaults wrapper for locations where
+ # Gentoo prefers to keep jars, it also specifies a library directory
+ cat > pm_java/pmdefaults/pmdefaults <<-EOF
+ #!/bin/sh
+ java -Djava.library.path=/usr/$(get_libdir)/ \\
+ -jar "${EPREFIX}/usr/share/${PN}/lib/pmdefaults.jar"
+ EOF
+ [ "$?" -neq "0" ] && die "cat pmdefaults failed"
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use java PORTMIDI_ENABLE_JAVA)
+
+ # this seems to be needed. if not set there will be a sandbox
+ # violation. if set to ./ the java parts will not build.
+ # one may end up with a blob named Gentoo, Debug or Release. hmmm
+ -DCMAKE_CACHEFILE_DIR="${S}/build"
+ )
+
+ # java stuff, the portmidi wiki says JAVA_JVM_LIBRARY needs to be specified
+ if use java ; then
+ # search for libjvm.so in JAVA_HOME to set JAVA_JVM_LIBRARY
+ local javalib=`find "${JAVA_HOME}" -name "libjvm.so" | head -n 1`
+
+ mycmakeargs+=(-DJAVA_JVM_LIBRARY="${javalib}"
+ # tell cmake where to install the jar, this requires the cmake
+ # patch, can be a relative path from CMAKE_INSTALL_PREFIX or
+ # absolute.
+ -DJAR_INSTALL_DIR="${EPREFIX}/usr/share/${PN}/lib"
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ # parallel make is broken when java is enabled so force -j1 :(
+ cmake-utils_src_compile $(use java && echo "-j1")
+
+ # python modules
+ if use python ; then
+ pushd pm_python || die "pushd python failed"
+ # hack. will error out if these files are not found
+ touch CHANGES.txt TODO.txt
+ distutils_src_compile
+ popd
+ fi
+
+ # make the docs (NOT WORKING)
+ #if use doc ; then
+ # doxygen || die "doxygen failed"
+ # pushd latex || die "pushd latex failed"
+ # VARTEXFONTS="${T}/fonts" make ${MAKEOPTS} || die "make doc failed"
+ # popd
+ #fi
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ dodoc CHANGELOG.txt README.txt pm_linux/README_LINUX.txt || die "dodoc failed"
+
+ # install the python modules
+ if use python ; then
+ pushd pm_python || die "pushd pm_python failed"
+ distutils_src_install
+ popd
+ fi
+
+ # a desktop entry and icon for the pmdefaults java configuration gui
+ if use java ; then
+ newdoc pm_java/README.txt README_JAVA.txt || die "newdoc failed"
+ doicon pm_java/pmdefaults/pmdefaults-icon.png || die "doicon failed"
+ make_desktop_entry pmdefaults Pmdefaults pmdefaults-icon \
+ "AudioVideo;Audio;Midi;"
+ fi
+
+ # some portmidi test apps
+ if use test-programs ; then
+ # maybe a better location can be used
+ exeinto /usr/$(get_libdir)/${PN}
+ local app
+ for app in latency midiclock midithread \
+ midithru mm qtest sysex test ; do
+ doexe ${S}"/build/${CMAKE_BUILD_TYPE}/${app}" \
+ || die "doins test programs failed"
+ done
+ fi
+}
+
+pkg_postinst() {
+ # prevent distutils_pkg_postinst from being called autmatically if
+ # python is disabled
+ use python && distutils_pkg_postinst
+}
+
+pkg_postrm() {
+ # prevent distutils_pkg_postrm from being called autmatically if
+ # python is disabled
+ use python && distutils_pkg_postrm
+}