zfs_unstable: 2.3.0-rc3 -> 2.3.0-rc4 (#365045)
[NixPkgs.git] / pkgs / development / libraries / portmidi / default.nix
blob9afbb6018aebfe374554db3fea00dec6c740897e
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   unzip,
6   cmake,
7   alsa-lib,
8   Carbon,
9   CoreAudio,
10   CoreFoundation,
11   CoreMIDI,
12   CoreServices,
15 stdenv.mkDerivation rec {
16   pname = "portmidi";
17   version = "2.0.4";
19   src = fetchFromGitHub {
20     owner = pname;
21     repo = pname;
22     rev = "v${version}";
23     sha256 = "sha256-uqBeh9vBP6+V+FN4lfeGxePQcpZMDYUuAo/d9a5rQxU=";
24   };
26   cmakeFlags = [
27     "-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
28     "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
29     "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
30   ];
32   patches = [
33     # Add missing header include
34     ./missing-header.diff
35   ];
37   postInstall =
38     let
39       ext = stdenv.hostPlatform.extensions.sharedLibrary;
40     in
41     ''
42       ln -s libportmidi${ext} "$out/lib/libporttime${ext}"
43     '';
45   nativeBuildInputs = [
46     unzip
47     cmake
48   ];
49   buildInputs =
50     lib.optionals stdenv.hostPlatform.isLinux [
51       alsa-lib
52     ]
53     ++ lib.optionals stdenv.hostPlatform.isDarwin [
54       Carbon
55       CoreAudio
56       CoreFoundation
57       CoreMIDI
58       CoreServices
59     ];
61   hardeningDisable = [ "format" ];
63   meta = with lib; {
64     homepage = "https://github.com/PortMidi/portmidi";
65     description = "Platform independent library for MIDI I/O";
66     license = licenses.mit;
67     maintainers = with maintainers; [ emilytrau ];
68     platforms = platforms.unix;
69   };