2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, cmake, /*jdk,*/ alsaLib }:
|
2013-10-28 02:09:10 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "portmidi";
|
2013-10-28 02:09:10 +00:00
|
|
|
version = "217";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/portmedia/portmidi-src-${version}.zip";
|
|
|
|
sha256 = "03rfsk7z6rdahq2ihy5k13qjzgx757f75yqka88v3gc0pn9ais88";
|
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = let
|
2015-01-01 23:49:20 +00:00
|
|
|
#base = "${jdk}/jre/lib/${jdk.architecture}";
|
2013-10-28 02:09:10 +00:00
|
|
|
in [
|
|
|
|
"-DPORTMIDI_ENABLE_JAVA=0"
|
|
|
|
/* TODO: Fix Java support.
|
|
|
|
"-DJAVA_AWT_LIBRARY=${base}/libawt.so"
|
|
|
|
"-DJAVA_JVM_LIBRARY=${base}/server/libjvm.so"
|
|
|
|
*/
|
|
|
|
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
|
|
|
|
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
|
|
|
|
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
|
|
|
|
];
|
|
|
|
|
|
|
|
# XXX: This is to deactivate Java support.
|
2021-01-21 17:00:13 +00:00
|
|
|
patches = lib.singleton (fetchurl {
|
2013-10-28 02:09:10 +00:00
|
|
|
url = "https://raw.github.com/Rogentos/argent-gentoo/master/media-libs/"
|
|
|
|
+ "portmidi/files/portmidi-217-cmake-libdir-java-opts.patch";
|
|
|
|
sha256 = "1jbjwan61iqq9fqfpq2a4fd30k3clg7a6j0gfgsw87r8c76kqf6h";
|
|
|
|
});
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's|/usr/local/|'"$out"'|' -e 's|/usr/share/|'"$out"'/share/|' \
|
|
|
|
pm_common/CMakeLists.txt pm_dylib/CMakeLists.txt pm_java/CMakeLists.txt
|
|
|
|
sed -i \
|
|
|
|
-e 's|-classpath .|-classpath '"$(pwd)"'/pm_java|' \
|
|
|
|
-e 's|pmdefaults/|'"$(pwd)"'/pm_java/&|g' \
|
|
|
|
-e 's|jportmidi/|'"$(pwd)"'/pm_java/&|g' \
|
|
|
|
-e 's/WORKING_DIRECTORY pm_java//' \
|
|
|
|
pm_java/CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -s libportmidi.so "$out/lib/libporttime.so"
|
|
|
|
'';
|
|
|
|
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ unzip cmake ];
|
|
|
|
buildInputs = [ alsaLib ];
|
2013-10-28 02:09:10 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-11 00:21:20 +00:00
|
|
|
|
2013-10-28 02:09:10 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://portmedia.sourceforge.net/portmidi/";
|
2013-10-28 02:09:10 +00:00
|
|
|
description = "Platform independent library for MIDI I/O";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.linux;
|
2013-10-28 02:09:10 +00:00
|
|
|
};
|
|
|
|
}
|