2014-03-02 04:21:50 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, yasm
|
2015-02-09 15:27:10 +00:00
|
|
|
, freetype ? null
|
|
|
|
, fribidi ? null
|
|
|
|
, encaSupport ? true, enca ? null # enca support
|
|
|
|
, fontconfigSupport ? true, fontconfig ? null # fontconfig support
|
|
|
|
, harfbuzzSupport ? true, harfbuzz ? null # harfbuzz support
|
|
|
|
, rasterizerSupport ? false # Internal rasterizer
|
|
|
|
, largeTilesSupport ? false # Use larger tiles in the rasterizer
|
2014-03-02 04:21:50 +00:00
|
|
|
}:
|
2011-02-09 21:10:42 +00:00
|
|
|
|
2015-02-09 15:27:10 +00:00
|
|
|
assert ((freetype != null) && (fribidi != null));
|
|
|
|
assert encaSupport -> (enca != null);
|
|
|
|
assert fontconfigSupport -> (fontconfig != null);
|
|
|
|
assert harfbuzzSupport -> (harfbuzz != null);
|
|
|
|
|
2014-03-02 04:21:50 +00:00
|
|
|
let
|
2015-02-09 15:27:10 +00:00
|
|
|
mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
|
|
|
|
in
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
stdenv.mkDerivation rec {
|
2014-03-02 04:21:50 +00:00
|
|
|
name = "libass-${version}";
|
2015-02-09 15:27:10 +00:00
|
|
|
version = "0.12.1";
|
2011-02-09 21:10:42 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-02-09 15:27:10 +00:00
|
|
|
url = "https://github.com/libass/libass/releases/download/${version}/${name}.tar.xz";
|
|
|
|
sha256 = "1mwj2nk9g6cq6f8m1hf0ijg1299rghhy9naahqq43sc2whblb1l7";
|
2011-02-09 21:10:42 +00:00
|
|
|
};
|
|
|
|
|
2015-02-09 15:27:10 +00:00
|
|
|
configureFlags = [
|
|
|
|
(mkFlag encaSupport "enca")
|
|
|
|
(mkFlag fontconfigSupport "fontconfig")
|
|
|
|
(mkFlag harfbuzzSupport "harfbuzz")
|
|
|
|
(mkFlag rasterizerSupport "rasterizer")
|
|
|
|
(mkFlag largeTilesSupport "large-tiles")
|
|
|
|
];
|
|
|
|
|
2014-03-02 04:21:50 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig yasm ];
|
|
|
|
|
2015-02-09 15:27:10 +00:00
|
|
|
buildInputs = [ freetype fribidi ]
|
|
|
|
++ optional encaSupport enca
|
|
|
|
++ optional fontconfigSupport fontconfig
|
|
|
|
++ optional harfbuzzSupport harfbuzz;
|
2011-02-09 21:10:42 +00:00
|
|
|
|
|
|
|
meta = {
|
2014-03-02 04:21:50 +00:00
|
|
|
description = "Portable ASS/SSA subtitle renderer";
|
2015-02-09 15:27:10 +00:00
|
|
|
homepage = https://github.com/libass/libass;
|
|
|
|
license = licenses.isc;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ codyopel urkud ];
|
2014-03-02 04:21:50 +00:00
|
|
|
repositories.git = git://github.com/libass/libass.git;
|
2011-02-09 21:10:42 +00:00
|
|
|
};
|
|
|
|
}
|