1 { lib, stdenv, fetchurl, unzip, cmake, /*jdk,*/ alsaLib }:
3 stdenv.mkDerivation rec {
8 url = "mirror://sourceforge/portmedia/portmidi-src-${version}.zip";
9 sha256 = "03rfsk7z6rdahq2ihy5k13qjzgx757f75yqka88v3gc0pn9ais88";
13 #base = "${jdk}/jre/lib/${jdk.architecture}";
15 "-DPORTMIDI_ENABLE_JAVA=0"
16 /* TODO: Fix Java support.
17 "-DJAVA_AWT_LIBRARY=${base}/libawt.so"
18 "-DJAVA_JVM_LIBRARY=${base}/server/libjvm.so"
20 "-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
21 "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
22 "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
25 # XXX: This is to deactivate Java support.
26 patches = lib.singleton (fetchurl {
27 url = "https://raw.github.com/Rogentos/argent-gentoo/master/media-libs/"
28 + "portmidi/files/portmidi-217-cmake-libdir-java-opts.patch";
29 sha256 = "1jbjwan61iqq9fqfpq2a4fd30k3clg7a6j0gfgsw87r8c76kqf6h";
33 sed -i -e 's|/usr/local/|'"$out"'|' -e 's|/usr/share/|'"$out"'/share/|' \
34 pm_common/CMakeLists.txt pm_dylib/CMakeLists.txt pm_java/CMakeLists.txt
36 -e 's|-classpath .|-classpath '"$(pwd)"'/pm_java|' \
37 -e 's|pmdefaults/|'"$(pwd)"'/pm_java/&|g' \
38 -e 's|jportmidi/|'"$(pwd)"'/pm_java/&|g' \
39 -e 's/WORKING_DIRECTORY pm_java//' \
40 pm_java/CMakeLists.txt
44 ln -s libportmidi.so "$out/lib/libporttime.so"
47 nativeBuildInputs = [ unzip cmake ];
48 buildInputs = [ alsaLib ];
50 hardeningDisable = [ "format" ];
53 homepage = "http://portmedia.sourceforge.net/portmidi/";
54 description = "Platform independent library for MIDI I/O";
55 license = lib.licenses.mit;
56 platforms = lib.platforms.linux;