base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / li / libcaca / package.nix
blob78b81bf49169ea54d4bd858e1920c7c0dd19e442
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , autoreconfHook
5 , imlib2
6 , xorg
7 , ncurses
8 , pkg-config
9 , zlib
10 , x11Support ? !stdenv.hostPlatform.isDarwin
13 stdenv.mkDerivation rec {
14   pname = "libcaca";
15   version = "0.99.beta20";
17   src = fetchFromGitHub {
18     owner = "cacalabs";
19     repo = pname;
20     rev = "v${version}";
21     hash = "sha256-N0Lfi0d4kjxirEbIjdeearYWvStkKMyV6lgeyNKXcVw=";
22   };
24   nativeBuildInputs = [
25     autoreconfHook
26     pkg-config
27   ];
29   buildInputs = [
30     ncurses
31     zlib
32     (imlib2.override { inherit x11Support; })
33   ] ++ lib.optionals x11Support [
34     xorg.libX11
35     xorg.libXext
36   ];
38   outputs = [ "bin" "dev" "out" "man" ];
40   configureFlags = [
41     (if x11Support then "--enable-x11" else "--disable-x11")
42   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
43     # Suppresses a build failure building Cocoa support due to accessing private ivar `_running`,
44     # which no longer available.
45     (lib.enableFeature false "cocoa")
46   ];
48   env.NIX_CFLAGS_COMPILE = lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
50   postInstall = ''
51     mkdir -p $dev/bin
52     mv $bin/bin/caca-config $dev/bin/caca-config
53   '';
55   meta = with lib; {
56     homepage = "http://caca.zoy.org/wiki/libcaca";
57     description = "Graphics library that outputs text instead of pixels";
58     longDescription = ''
59       libcaca is a graphics library that outputs text instead of pixels, so that
60       it can work on older video cards or text terminals. It is not unlike the
61       famous â€‹AAlib library, with the following improvements:
63       - Unicode support
64       - 2048 available colours (some devices can only handle 16)
65       - dithering of colour images
66       - advanced text canvas operations (blitting, rotations)
68       Libcaca works in a text terminal (and should thus work on all Unix systems
69       including Mac OS X) using the S-Lang or ncurses libraries. It also works
70       natively on DOS and Windows.
72       Libcaca was written by Sam Hocevar and Jean-Yves Lamoureux.
73     '';
74     license = licenses.wtfpl;
75     maintainers = with maintainers; [ AndersonTorres ];
76     platforms = platforms.unix;
77   };