Merge pull request #119662 from AndersonTorres/new-libcaca
libcaca: refactor
This commit is contained in:
commit
a03f318104
@ -1,40 +1,75 @@
|
|||||||
{ lib, stdenv, fetchurl, ncurses, zlib, pkg-config, imlib2
|
{ lib
|
||||||
, x11Support ? !stdenv.isDarwin, libX11, libXext
|
, stdenv
|
||||||
|
, fetchurl
|
||||||
|
, imlib2
|
||||||
|
, libX11
|
||||||
|
, libXext
|
||||||
|
, ncurses
|
||||||
|
, pkg-config
|
||||||
|
, x11Support ? !stdenv.isDarwin
|
||||||
|
, zlib
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "libcaca-0.99.beta19";
|
pname = "libcaca";
|
||||||
|
version = "0.99.beta19";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
urls = [
|
urls = [
|
||||||
"http://fossies.org/linux/privat/${name}.tar.gz"
|
"http://fossies.org/linux/privat/${pname}-${version}.tar.gz"
|
||||||
"http://caca.zoy.org/files/libcaca/${name}.tar.gz"
|
"http://caca.zoy.org/files/libcaca/${pname}-${version}.tar.gz"
|
||||||
];
|
];
|
||||||
sha256 = "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj";
|
hash = "sha256-EotGfE7QMmTBh0BRcqToMEk0LMjML2VfU6LQ7p03cvQ=";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "bin" "dev" "out" "man" ];
|
outputs = [ "bin" "dev" "out" "man" ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
(if x11Support then "--enable-x11" else "--disable-x11")
|
(if x11Support then "--enable-x11" else "--disable-x11")
|
||||||
];
|
];
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
|
NIX_CFLAGS_COMPILE = lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
propagatedBuildInputs = [ ncurses zlib pkg-config (imlib2.override { inherit x11Support; }) ]
|
nativeBuildInputs = [
|
||||||
++ lib.optionals x11Support [ libX11 libXext ];
|
pkg-config
|
||||||
|
];
|
||||||
|
buildInputs = [
|
||||||
|
ncurses
|
||||||
|
zlib
|
||||||
|
(imlib2.override { inherit x11Support; })
|
||||||
|
] ++ lib.optionals x11Support [
|
||||||
|
libX11
|
||||||
|
libXext
|
||||||
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $dev/bin
|
mkdir -p $dev/bin
|
||||||
mv $bin/bin/caca-config $dev/bin/caca-config
|
mv $bin/bin/caca-config $dev/bin/caca-config
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = with lib; {
|
||||||
homepage = "http://libcaca.zoy.org/";
|
homepage = "http://caca.zoy.org/wiki/libcaca";
|
||||||
description = "A graphics library that outputs text instead of pixels";
|
description = "A graphics library that outputs text instead of pixels";
|
||||||
license = lib.licenses.wtfpl;
|
longDescription = ''
|
||||||
platforms = lib.platforms.unix;
|
libcaca is a graphics library that outputs text instead of pixels, so that
|
||||||
|
it can work on older video cards or text terminals. It is not unlike the
|
||||||
|
famous AAlib library, with the following improvements:
|
||||||
|
|
||||||
|
- Unicode support
|
||||||
|
- 2048 available colours (some devices can only handle 16)
|
||||||
|
- dithering of colour images
|
||||||
|
- advanced text canvas operations (blitting, rotations)
|
||||||
|
|
||||||
|
Libcaca works in a text terminal (and should thus work on all Unix systems
|
||||||
|
including Mac OS X) using the S-Lang or ncurses libraries. It also works
|
||||||
|
natively on DOS and Windows.
|
||||||
|
|
||||||
|
Libcaca was written by Sam Hocevar and Jean-Yves Lamoureux.
|
||||||
|
'';
|
||||||
|
license = licenses.wtfpl;
|
||||||
|
maintainers = with maintainers; [ AndersonTorres ];
|
||||||
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user