nixpkgs/pkgs/development/libraries/portmidi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.2 KiB
Nix
Raw Normal View History

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