1 { lib, stdenv, fetchFromGitHub, unzip, cmake, alsa-lib, Carbon, CoreAudio, CoreFoundation, CoreMIDI, CoreServices }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-bLGqi3b9FHBA43baNDT8jkPBQSXAUDfurQSJHLcy3AE=";
15 "-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
16 "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
17 "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
21 # Add missing header include
25 postInstall = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
26 ln -s libportmidi${ext} "$out/lib/libporttime${ext}"
29 nativeBuildInputs = [ unzip cmake ];
30 buildInputs = lib.optionals stdenv.isLinux [
32 ] ++ lib.optionals stdenv.isDarwin [
33 Carbon CoreAudio CoreFoundation CoreMIDI CoreServices
36 hardeningDisable = [ "format" ];
39 homepage = "https://github.com/PortMidi/portmidi";
40 description = "Platform independent library for MIDI I/O";
41 license = licenses.mit;
42 maintainers = with maintainers; [ emilytrau ];
43 platforms = platforms.unix;