2015-05-18 14:04:50 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, fontconfig, autoreconfHook
|
2015-07-26 09:58:51 +00:00
|
|
|
, withJava ? false, jdk ? null, ant ? null
|
2015-05-18 14:04:50 +00:00
|
|
|
, withAACS ? false, libaacs ? null
|
|
|
|
, withBDplus ? false, libbdplus ? null
|
2014-09-18 01:42:08 +00:00
|
|
|
, withMetadata ? true, libxml2 ? null
|
|
|
|
, withFonts ? true, freetype ? null
|
|
|
|
}:
|
2012-02-22 20:29:29 +00:00
|
|
|
|
2015-05-18 14:04:50 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
assert withJava -> jdk != null && ant != null;
|
|
|
|
assert withAACS -> libaacs != null;
|
|
|
|
assert withBDplus -> libbdplus != null;
|
2014-09-18 01:42:08 +00:00
|
|
|
assert withMetadata -> libxml2 != null;
|
|
|
|
assert withFonts -> freetype != null;
|
2012-02-22 20:29:29 +00:00
|
|
|
|
|
|
|
# Info on how to use:
|
|
|
|
# https://wiki.archlinux.org/index.php/BluRay
|
|
|
|
|
2014-09-18 01:42:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
baseName = "libbluray";
|
2016-01-13 15:36:12 +00:00
|
|
|
version = "0.9.2";
|
2014-09-18 01:42:08 +00:00
|
|
|
name = "${baseName}-${version}";
|
2012-02-22 20:29:29 +00:00
|
|
|
|
2014-09-18 01:42:08 +00:00
|
|
|
src = fetchurl {
|
2016-02-07 12:18:48 +00:00
|
|
|
url = "http://get.videolan.org/${baseName}/${version}/${name}.tar.bz2";
|
2016-01-13 15:36:12 +00:00
|
|
|
sha256 = "1sp71j4agcsg17g6b85cqz78pn5vknl5pl39rvr6mkib5ps99jgg";
|
2012-02-22 20:29:29 +00:00
|
|
|
};
|
|
|
|
|
2015-05-18 14:04:50 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig autoreconfHook ]
|
|
|
|
++ optionals withJava [ ant ]
|
2014-09-18 01:42:08 +00:00
|
|
|
;
|
2012-02-22 20:29:29 +00:00
|
|
|
|
2015-05-18 14:04:50 +00:00
|
|
|
buildInputs = [ fontconfig ]
|
|
|
|
++ optional withJava jdk
|
|
|
|
++ optional withMetadata libxml2
|
|
|
|
++ optional withFonts freetype
|
|
|
|
;
|
2012-02-22 20:29:29 +00:00
|
|
|
|
2015-02-22 03:39:37 +00:00
|
|
|
propagatedBuildInputs = stdenv.lib.optional withAACS libaacs;
|
|
|
|
|
2015-05-18 14:04:50 +00:00
|
|
|
preConfigure = ''
|
|
|
|
${optionalString withJava ''export JDK_HOME="${jdk.home}"''}
|
|
|
|
${optionalString withAACS ''export NIX_LDFLAGS="$NIX_LDFLAGS -L${libaacs}/lib -laacs"''}
|
|
|
|
${optionalString withBDplus ''export NIX_LDFLAGS="$NIX_LDFLAGS -L${libbdplus}/lib -lbdplus"''}
|
2015-02-22 03:39:37 +00:00
|
|
|
'';
|
|
|
|
|
2014-09-18 01:42:08 +00:00
|
|
|
configureFlags = with stdenv.lib;
|
2015-05-18 14:04:50 +00:00
|
|
|
optional (! withJava) "--disable-bdjava"
|
2014-09-18 01:42:08 +00:00
|
|
|
++ optional (! withMetadata) "--without-libxml2"
|
|
|
|
++ optional (! withFonts) "--without-freetype"
|
|
|
|
;
|
2014-05-03 23:17:40 +00:00
|
|
|
|
2015-02-22 03:39:37 +00:00
|
|
|
# Fix search path for BDJ jarfile
|
2015-05-18 14:04:50 +00:00
|
|
|
patches = stdenv.lib.optional withJava ./BDJ-JARFILE-path.patch;
|
2015-02-22 03:39:37 +00:00
|
|
|
|
2014-09-18 01:42:08 +00:00
|
|
|
meta = with stdenv.lib; {
|
2012-02-22 20:29:29 +00:00
|
|
|
homepage = http://www.videolan.org/developers/libbluray.html;
|
|
|
|
description = "Library to access Blu-Ray disks for video playback";
|
2014-09-18 01:42:08 +00:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = [ maintainers.abbradar ];
|
2012-02-22 20:29:29 +00:00
|
|
|
};
|
|
|
|
}
|