depot/third_party/nixpkgs/pkgs/development/libraries/portmidi/default.nix
Default email 8e65f7f0cc Project import generated by Copybara.
GitOrigin-RevId: 062a0c5437b68f950b081bbfc8a699d57a4ee026
2022-03-05 17:20:37 +01:00

45 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, unzip, cmake, alsa-lib, Carbon, CoreAudio, CoreFoundation, CoreMIDI, CoreServices }:
stdenv.mkDerivation rec {
pname = "portmidi";
version = "2.0.3";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "sha256-bLGqi3b9FHBA43baNDT8jkPBQSXAUDfurQSJHLcy3AE=";
};
cmakeFlags = [
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
];
patches = [
# Add missing header include
./missing-header.diff
];
postInstall = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
ln -s libportmidi${ext} "$out/lib/libporttime${ext}"
'';
nativeBuildInputs = [ unzip cmake ];
buildInputs = lib.optionals stdenv.isLinux [
alsa-lib
] ++ lib.optionals stdenv.isDarwin [
Carbon CoreAudio CoreFoundation CoreMIDI CoreServices
];
hardeningDisable = [ "format" ];
meta = with lib; {
homepage = "https://github.com/PortMidi/portmidi";
description = "Platform independent library for MIDI I/O";
license = licenses.mit;
maintainers = with maintainers; [ emilytrau ];
platforms = platforms.unix;
};
}