1{
2 lib,
3 stdenv,
4 fetchurl,
5 autoreconfHook,
6 gettext,
7 makeWrapper,
8 alsa-lib,
9 libjack2,
10 tk,
11 fftw,
12 portaudio,
13 portmidi,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "puredata";
18 version = "0.55-2";
19
20 src = fetchurl {
21 url = "http://msp.ucsd.edu/Software/pd-${version}.src.tar.gz";
22 hash = "sha256-EIKX+NHdGQ346LtKSsNIeSrM9wT5ogUtk8uoybi7Wls=";
23 };
24
25 patches = [
26 # expose error function used by dependents
27 ./expose-error.patch
28 ];
29
30 nativeBuildInputs = [
31 autoreconfHook
32 gettext
33 makeWrapper
34 ];
35
36 buildInputs = [
37 fftw
38 libjack2
39 ]
40 ++ lib.optionals stdenv.hostPlatform.isLinux [
41 alsa-lib
42 ]
43 ++ lib.optionals stdenv.hostPlatform.isDarwin [
44 portmidi
45 portaudio
46 ];
47
48 configureFlags = [
49 "--enable-fftw"
50 "--enable-jack"
51 ]
52 ++ lib.optionals stdenv.hostPlatform.isLinux [
53 "--enable-alsa"
54 ]
55 ++ lib.optionals stdenv.hostPlatform.isDarwin [
56 "--enable-portaudio"
57 "--enable-portmidi"
58 "--without-local-portaudio"
59 "--without-local-portmidi"
60 "--disable-jack-framework"
61 "--with-wish=${tk}/bin/wish8.6"
62 ];
63
64 postInstall = ''
65 wrapProgram $out/bin/pd --prefix PATH : ${lib.makeBinPath [ tk ]}
66 wrapProgram $out/bin/pd-gui --prefix PATH : ${lib.makeBinPath [ tk ]}
67 '';
68
69 meta = with lib; {
70 description = ''Real-time graphical programming environment for audio, video, and graphical processing'';
71 homepage = "http://puredata.info";
72 license = licenses.bsd3;
73 platforms = platforms.linux ++ platforms.darwin;
74 maintainers = with maintainers; [ carlthome ];
75 mainProgram = "pd";
76 changelog = "https://msp.puredata.info/Pd_documentation/x5.htm#s1";
77 };
78}