forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / portmidi / default.nix
blobeac2a369fd0b0aeb8b7a21028797ceebeecac674
1 { lib, stdenv, fetchFromGitHub, unzip, cmake, alsa-lib, Carbon, CoreAudio, CoreFoundation, CoreMIDI, CoreServices }:
3 stdenv.mkDerivation rec {
4   pname = "portmidi";
5   version = "2.0.4";
7   src = fetchFromGitHub {
8     owner = pname;
9     repo = pname;
10     rev = "v${version}";
11     sha256 = "sha256-uqBeh9vBP6+V+FN4lfeGxePQcpZMDYUuAo/d9a5rQxU=";
12   };
14   cmakeFlags = [
15     "-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
16     "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
17     "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
18   ];
20   patches = [
21     # Add missing header include
22     ./missing-header.diff
23   ];
25   postInstall = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
26     ln -s libportmidi${ext} "$out/lib/libporttime${ext}"
27   '';
29   nativeBuildInputs = [ unzip cmake ];
30   buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
31     alsa-lib
32   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
33     Carbon CoreAudio CoreFoundation CoreMIDI CoreServices
34   ];
36   hardeningDisable = [ "format" ];
38   meta = with lib; {
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;
44   };