summary refs log tree commit diff
path: root/pkgs/applications/video/aegisub/default.nix
blob: fa17fb5ffd2c88715a9d98c06bac80520a10b842 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ stdenv, fetchurl
, libX11, gettext, wxGTK
, libiconv, fontconfig, freetype
, mesa
, libass, fftw, ffms
, ffmpeg, pkgconfig, zlib # Undocumented (?) dependencies
, spellChecking ? true, hunspell ? null
, automationSupport ? true, lua ? null 
, openalSupport ? false, openal ? null
, alsaSupport ? true, alsaLib ? null
, pulseaudioSupport ? true, pulseaudio ? null
, portaudioSupport ? false, portaudio ? null
}:

assert spellChecking -> (hunspell != null);
assert automationSupport -> (lua != null);
assert openalSupport -> (openal != null);
assert alsaSupport -> (alsaLib != null);
assert pulseaudioSupport -> (pulseaudio != null);
assert portaudioSupport -> (portaudio != null);

stdenv.mkDerivation rec {
  name = "aegisub-${version}";
  version = "3.0.4";

  src = fetchurl {
    url = "http://ftp.aegisub.org/pub/releases/${name}.tar.xz";
    md5 = "0f22d63ed4c502f3801795fa623a4f41";
  };

  buildInputs = with stdenv.lib;
  [ libX11 gettext wxGTK libiconv fontconfig freetype mesa libass fftw ffms ffmpeg pkgconfig zlib ]
  ++ optional spellChecking hunspell
  ++ optional automationSupport lua
  ++ optional openalSupport openal
  ++ optional alsaSupport alsaLib
  ++ optional pulseaudioSupport pulseaudio
  ++ optional portaudioSupport portaudio
  ;

  NIX_LDFLAGS = "-liconv -lavutil -lavformat -lavcodec -lswscale -lz -lm";
  
  preConfigure = "cd aegisub"; 
  
  postInstall = "ln -s $out/bin/aegisub-3.0 $out/bin/aegisub";
  
  meta = {
    description = "An advanced subtitle editor";
    longDescription = ''
      Aegisub is a free, cross-platform open source tool for creating and
      modifying subtitles. Aegisub makes it quick and easy to time subtitles to
      audio, and features many powerful tools for styling them, including a
      built-in real-time video preview.
    '';
    homepage = http://www.aegisub.org/;
    license = stdenv.lib.licenses.bsd3; 
              # The Aegisub sources are itself BSD/ISC, 
              # but they are linked against GPL'd softwares
              # - so the resulting program will be GPL
    maintainers = [ maintainers.AndersonTorres ];
    platforms = stdenv.lib.platforms.linux;

  };
}