summary refs log tree commit diff
path: root/pkgs/development/libraries/aalib/default.nix
blob: 94453264419c08c0d5578cddc5afa92d0a9f7799 (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, ncurses, automake}:

stdenv.mkDerivation {
  name = "aalib-1.4rc5";

  src = fetchurl {
    url = "mirror://sourceforge/aa-project/aalib-1.4rc5.tar.gz";
    sha256 = "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv";
  };

  outputs = [ "bin" "dev" "out" "man" "info" ];
  setOutputFlags = false; # Doesn't support all the flags

  patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin.patch ];

  # The fuloong2f is not supported by aalib still
  preConfigure = ''
    cp ${automake}/share/automake*/config.{sub,guess} .
    configureFlagsArray+=(
      "--bindir=$bin/bin"
      "--includedir=$dev/include"
      "--libdir=$out/lib"
    )
  '';

  buildInputs = [ ncurses ];

  configureFlags = [ "--without-x" "--with-ncurses=${ncurses.dev}" ];

  postInstall = ''
    mkdir -p $dev/bin
    mv $bin/bin/aalib-config $dev/bin/aalib-config
    substituteInPlace $out/lib/libaa.la --replace "${ncurses.dev}/lib" "${ncurses.out}/lib"
  '';

  meta = {
    description = "ASCII art graphics library";
    platforms = stdenv.lib.platforms.unix;
    license = stdenv.lib.licenses.lgpl2;
  };
}