2015-02-02 18:31:20 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, fontconfig
|
2014-09-18 03:42:08 +02:00
|
|
|
, withAACS ? false, libaacs ? null, jdk ? null, ant ? null
|
|
|
|
, withMetadata ? true, libxml2 ? null
|
|
|
|
, withFonts ? true, freetype ? null
|
2015-02-22 04:39:37 +01:00
|
|
|
# Need to run autoreconf hook after BDJ jarfile patch
|
|
|
|
, autoreconfHook ? null
|
2014-09-18 03:42:08 +02:00
|
|
|
}:
|
2012-02-22 21:29:29 +01:00
|
|
|
|
2015-02-22 04:39:37 +01:00
|
|
|
assert withAACS -> jdk != null && ant != null && libaacs != null && autoreconfHook != null;
|
2014-09-18 03:42:08 +02:00
|
|
|
assert withMetadata -> libxml2 != null;
|
|
|
|
assert withFonts -> freetype != null;
|
2012-02-22 21:29:29 +01:00
|
|
|
|
|
|
|
# Info on how to use:
|
|
|
|
# https://wiki.archlinux.org/index.php/BluRay
|
|
|
|
|
2014-09-18 03:42:08 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
baseName = "libbluray";
|
2015-02-02 18:31:20 +01:00
|
|
|
version = "0.7.0";
|
2014-09-18 03:42:08 +02:00
|
|
|
name = "${baseName}-${version}";
|
2012-02-22 21:29:29 +01:00
|
|
|
|
2014-09-18 03:42:08 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.videolan.org/pub/videolan/${baseName}/${version}/${name}.tar.bz2";
|
2015-02-02 18:31:20 +01:00
|
|
|
sha256 = "13dngs4b4cv29f6b825dq14n77mfhvk1kjb42axpq494pfgyp6zp";
|
2012-02-22 21:29:29 +01:00
|
|
|
};
|
|
|
|
|
2014-09-18 03:42:08 +02:00
|
|
|
nativeBuildInputs = with stdenv.lib;
|
|
|
|
[pkgconfig]
|
|
|
|
++ optional withAACS ant
|
|
|
|
;
|
2012-02-22 21:29:29 +01:00
|
|
|
|
2014-09-18 03:42:08 +02:00
|
|
|
buildInputs = with stdenv.lib;
|
2015-02-02 18:31:20 +01:00
|
|
|
[fontconfig]
|
2015-02-22 04:39:37 +01:00
|
|
|
++ optionals withAACS [ jdk autoreconfHook ]
|
2014-09-18 03:42:08 +02:00
|
|
|
++ optional withMetadata libxml2
|
|
|
|
++ optional withFonts freetype
|
|
|
|
;
|
2012-02-22 21:29:29 +01:00
|
|
|
|
2015-02-22 04:39:37 +01:00
|
|
|
propagatedBuildInputs = stdenv.lib.optional withAACS libaacs;
|
|
|
|
|
|
|
|
preConfigure = stdenv.lib.optionalString withAACS ''
|
|
|
|
export JDK_HOME=${jdk.home}
|
|
|
|
export LIBS="$LIBS -L${libaacs} -laacs"
|
|
|
|
'';
|
|
|
|
|
2014-09-18 03:42:08 +02:00
|
|
|
configureFlags = with stdenv.lib;
|
2015-02-22 04:39:37 +01:00
|
|
|
optional withAACS "--enable-bdjava"
|
2014-09-18 03:42:08 +02:00
|
|
|
++ optional (! withMetadata) "--without-libxml2"
|
|
|
|
++ optional (! withFonts) "--without-freetype"
|
|
|
|
;
|
2014-05-04 01:17:40 +02:00
|
|
|
|
2015-02-22 04:39:37 +01:00
|
|
|
# Fix search path for BDJ jarfile
|
|
|
|
patches = stdenv.lib.optional withAACS ./BDJ-JARFILE-path.patch;
|
|
|
|
|
2014-09-18 03:42:08 +02:00
|
|
|
meta = with stdenv.lib; {
|
2012-02-22 21:29:29 +01:00
|
|
|
homepage = http://www.videolan.org/developers/libbluray.html;
|
|
|
|
description = "Library to access Blu-Ray disks for video playback";
|
2014-09-18 03:42:08 +02:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = [ maintainers.abbradar ];
|
2012-02-22 21:29:29 +01:00
|
|
|
};
|
|
|
|
}
|