2022-02-20 05:27:41 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, unzip, cmake, alsa-lib, Carbon, CoreAudio, CoreFoundation, CoreMIDI, CoreServices }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "portmidi";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "2.0.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-uqBeh9vBP6+V+FN4lfeGxePQcpZMDYUuAo/d9a5rQxU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
cmakeFlags = [
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
|
|
|
|
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
|
|
|
|
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
|
2021-08-10 14:31:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
2022-02-20 05:27:41 +00:00
|
|
|
# Add missing header include
|
|
|
|
./missing-header.diff
|
2021-08-10 14:31:46 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
postInstall = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
|
2021-08-11 14:56:57 +00:00
|
|
|
ln -s libportmidi${ext} "$out/lib/libporttime${ext}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
nativeBuildInputs = [ unzip cmake ];
|
2021-08-10 14:31:46 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Carbon CoreAudio CoreFoundation CoreMIDI CoreServices
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
meta = with lib; {
|
2022-02-20 05:27:41 +00:00
|
|
|
homepage = "https://github.com/PortMidi/portmidi";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Platform independent library for MIDI I/O";
|
2021-08-10 14:31:46 +00:00
|
|
|
license = licenses.mit;
|
2022-02-20 05:27:41 +00:00
|
|
|
maintainers = with maintainers; [ emilytrau ];
|
2021-08-10 14:31:46 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|