2014-03-02 05:21:50 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, yasm
|
2015-06-01 01:47:59 +02:00
|
|
|
, freetype, fribidi
|
2015-02-09 16:27:10 +01:00
|
|
|
, 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 05:21:50 +01:00
|
|
|
}:
|
2011-02-09 22:10:42 +01:00
|
|
|
|
2015-06-01 01:47:59 +02:00
|
|
|
assert encaSupport -> enca != null;
|
|
|
|
assert fontconfigSupport -> fontconfig != null;
|
|
|
|
assert harfbuzzSupport -> harfbuzz != null;
|
2015-02-09 16:27:10 +01:00
|
|
|
|
2015-06-01 21:29:47 +02:00
|
|
|
let
|
|
|
|
mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
|
|
|
|
in
|
|
|
|
|
2015-02-09 16:27:10 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
stdenv.mkDerivation rec {
|
2014-03-02 05:21:50 +01:00
|
|
|
name = "libass-${version}";
|
2015-06-01 01:47:59 +02:00
|
|
|
version = "0.12.2";
|
2011-02-09 22:10:42 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-02-09 16:27:10 +01:00
|
|
|
url = "https://github.com/libass/libass/releases/download/${version}/${name}.tar.xz";
|
2015-06-01 01:47:59 +02:00
|
|
|
sha256 = "1qzibgqmnnqk2r116lpk1br764g0v74f2zp12y5id0p1plaing37";
|
2011-02-09 22:10:42 +01:00
|
|
|
};
|
|
|
|
|
2015-02-09 16:27:10 +01:00
|
|
|
configureFlags = [
|
2015-06-01 21:29:47 +02:00
|
|
|
(mkFlag encaSupport "enca")
|
|
|
|
(mkFlag fontconfigSupport "fontconfig")
|
|
|
|
(mkFlag harfbuzzSupport "harfbuzz")
|
|
|
|
(mkFlag rasterizerSupport "rasterizer")
|
|
|
|
(mkFlag largeTilesSupport "large-tiles")
|
2015-02-09 16:27:10 +01:00
|
|
|
];
|
|
|
|
|
2014-03-02 05:21:50 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig yasm ];
|
|
|
|
|
2015-02-09 16:27:10 +01:00
|
|
|
buildInputs = [ freetype fribidi ]
|
|
|
|
++ optional encaSupport enca
|
|
|
|
++ optional fontconfigSupport fontconfig
|
|
|
|
++ optional harfbuzzSupport harfbuzz;
|
2011-02-09 22:10:42 +01:00
|
|
|
|
|
|
|
meta = {
|
2014-03-02 05:21:50 +01:00
|
|
|
description = "Portable ASS/SSA subtitle renderer";
|
2015-02-09 16:27:10 +01:00
|
|
|
homepage = https://github.com/libass/libass;
|
|
|
|
license = licenses.isc;
|
2015-02-28 16:11:23 +01:00
|
|
|
platforms = platforms.unix;
|
2015-02-09 16:27:10 +01:00
|
|
|
maintainers = with maintainers; [ codyopel urkud ];
|
2014-03-02 05:21:50 +01:00
|
|
|
repositories.git = git://github.com/libass/libass.git;
|
2011-02-09 22:10:42 +01:00
|
|
|
};
|
|
|
|
}
|