summary refs log tree commit diff
path: root/pkgs/applications/audio/mup/default.nix
blob: 43098be12e3f980fc33a6192040aab648e208e8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ stdenv, fetchurl, autoreconfHook, bison, flex, ghostscript, groff, netpbm
, fltk, libXinerama, libXpm, libjpeg
}:

stdenv.mkDerivation rec {
  pname = "mup";
  version = "6.7";

  src = fetchurl {
    url = "http://www.arkkra.com/ftp/pub/unix/mup${builtins.replaceStrings ["."] [""] version}src.tar.gz";
    sha256 = "1y1qknhib1isdjsbv833w3nxzyfljkfgp1gmjwly60l55q60frpk";
  };

  nativeBuildInputs = [ autoreconfHook bison flex ghostscript groff netpbm ];

  buildInputs = [ fltk libXinerama libXpm libjpeg ];

  patches = [ ./ghostscript-permit-file-write.patch ];

  postPatch = ''
    for f in Makefile.am doc/Makefile.am doc/htmldocs/Makefile.am src/mupmate/Preferences.C; do
      substituteInPlace $f --replace doc/packages doc
    done
    substituteInPlace src/mupprnt/mupprnt --replace 'mup ' $out/bin/mup' '
    substituteInPlace src/mupdisp/genfile.c --replace '"mup"' '"'$out/bin/mup'"'
    substituteInPlace src/mupmate/Preferences.C \
      --replace '"mup"' '"'$out/bin/mup'"' \
      --replace '"gv"' '"xdg-open"' \
      --replace /usr/share/doc $out/share/doc
  '';

  enableParallelBuilding = false; # Undeclared dependencies + https://stackoverflow.com/a/19822767/1687334 for prolog.ps.

  meta = with stdenv.lib; {
    homepage = http://www.arkkra.com/;
    description = "Music typesetting program (ASCII to PostScript and MIDI)";
    license = licenses.bsd3;
    maintainers = with maintainers; [ orivej ];
    platforms = platforms.linux;
  };
}