diff options
author | Peter Simons <simons@cryp.to> | 2013-09-18 08:08:24 -0700 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2013-09-18 08:08:24 -0700 |
commit | 682faad1a7f5af16ac3e3649075833dadcc956a8 (patch) | |
tree | 52866c58deabde5b82019c46fcf0bbc2c5915a87 /pkgs/applications/video | |
parent | 8e4a53ba9533fd07a3f60311d60922297ae7fcd6 (diff) | |
parent | afcda36c4653ac3e1aea2e842a9e71f3fdbe07e8 (diff) | |
download | nixlib-682faad1a7f5af16ac3e3649075833dadcc956a8.tar nixlib-682faad1a7f5af16ac3e3649075833dadcc956a8.tar.gz nixlib-682faad1a7f5af16ac3e3649075833dadcc956a8.tar.bz2 nixlib-682faad1a7f5af16ac3e3649075833dadcc956a8.tar.lz nixlib-682faad1a7f5af16ac3e3649075833dadcc956a8.tar.xz nixlib-682faad1a7f5af16ac3e3649075833dadcc956a8.tar.zst nixlib-682faad1a7f5af16ac3e3649075833dadcc956a8.zip |
Merge pull request #987 from oxij/mplayer-fontconfig
mplayer: add fontconfig support
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r-- | pkgs/applications/video/mplayer/default.nix | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 2051590a8197..6d8780d6cf48 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, freetype, pkgconfig, yasm, freefont_ttf +{ stdenv, fetchurl, pkgconfig, freetype, yasm +, fontconfigSupport ? true, fontconfig ? null, freefont_ttf ? null , x11Support ? true, libX11 ? null, libXext ? null, mesa ? null , xineramaSupport ? true, libXinerama ? null , xvSupport ? true, libXv ? null @@ -22,6 +23,8 @@ , useUnfreeCodecs ? false }: +assert fontconfigSupport -> (fontconfig != null); +assert (!fontconfigSupport) -> (freefont_ttf != null); assert x11Support -> (libX11 != null && libXext != null && mesa != null); assert xineramaSupport -> (libXinerama != null && x11Support); assert xvSupport -> (libXv != null && x11Support); @@ -95,7 +98,8 @@ stdenv.mkDerivation rec { ''; buildInputs = with stdenv.lib; - [ freetype pkgconfig ] + [ pkgconfig freetype ] + ++ optional fontconfigSupport fontconfig ++ optionals x11Support [ libX11 libXext mesa ] ++ optional alsaSupport alsaLib ++ optional xvSupport libXv @@ -125,6 +129,8 @@ stdenv.mkDerivation rec { configureFlags = with stdenv.lib; '' + --enable-freetype + ${if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig"} ${if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl"} ${if xineramaSupport then "--enable-xinerama" else "--disable-xinerama"} ${if xvSupport then "--enable-xv" else "--disable-xv"} @@ -144,7 +150,6 @@ stdenv.mkDerivation rec { ${if pulseSupport then "--enable-pulse" else "--disable-pulse"} ${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"} ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"} - --enable-freetype --disable-xanim --disable-ivtv --disable-xvid --disable-xvid-lavc @@ -153,14 +158,17 @@ stdenv.mkDerivation rec { --disable-ossaudio ''; - NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext"; + NIX_LDFLAGS = with stdenv.lib; + optional fontconfigSupport "-lfontconfig" + ++ optionals x11Support [ "-lX11" "-lXext" ] + ; installTargets = [ "install" ] ++ stdenv.lib.optional x11Support "install-gui"; enableParallelBuilding = true; - # Provide a reasonable standard font. Maybe we should symlink here. - postInstall = + # Provide a reasonable standard font when not using fontconfig. Maybe we should symlink here. + postInstall = stdenv.lib.optionalString (!fontconfigSupport) '' mkdir -p $out/share/mplayer cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf |