Merge pull request #6506 from nathanielbaxter/dev/libbluray

libbluray: fix aacs support
This commit is contained in:
Nikolay Amiantov 2015-02-23 14:17:41 +03:00
commit 68ed035798
2 changed files with 40 additions and 3 deletions

View File

@ -0,0 +1,25 @@
diff --git a/configure.ac b/configure.ac
index 3609d88..48c6bc6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -227,6 +227,7 @@ if [[ $use_bdjava = "yes" ]]; then
AC_DEFINE([USING_BDJAVA], [1], ["Define to 1 if using BD-Java"])
AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
AC_DEFINE_UNQUOTED([JDK_HOME], ["$JDK_HOME"], [""])
+ CPPFLAGS="${CPPFLAGS} -DJARDIR='\"\$(datadir)/java\"'"
fi
AM_CONDITIONAL([USING_BDJAVA], [ test $use_bdjava = "yes" ])
diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index c622801..f4aab9b 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -210,7 +210,7 @@ static const char *_find_libbluray_jar(void)
#ifdef _WIN32
"" BDJ_JARFILE,
#else
- "/usr/share/java/" BDJ_JARFILE,
+ JARDIR "/" BDJ_JARFILE,
#endif
};

View File

@ -2,9 +2,11 @@
, withAACS ? false, libaacs ? null, jdk ? null, ant ? null
, withMetadata ? true, libxml2 ? null
, withFonts ? true, freetype ? null
# Need to run autoreconf hook after BDJ jarfile patch
, autoreconfHook ? null
}:
assert withAACS -> jdk != null && ant != null && libaacs != null;
assert withAACS -> jdk != null && ant != null && libaacs != null && autoreconfHook != null;
assert withMetadata -> libxml2 != null;
assert withFonts -> freetype != null;
@ -28,17 +30,27 @@ stdenv.mkDerivation rec {
buildInputs = with stdenv.lib;
[fontconfig]
++ optionals withAACS [jdk libaacs]
++ optionals withAACS [ jdk autoreconfHook ]
++ optional withMetadata libxml2
++ optional withFonts freetype
;
propagatedBuildInputs = stdenv.lib.optional withAACS libaacs;
preConfigure = stdenv.lib.optionalString withAACS ''
export JDK_HOME=${jdk.home}
export LIBS="$LIBS -L${libaacs} -laacs"
'';
configureFlags = with stdenv.lib;
optionals withAACS ["--enable-bdjava" "--with-jdk=${jdk}"]
optional withAACS "--enable-bdjava"
++ optional (! withMetadata) "--without-libxml2"
++ optional (! withFonts) "--without-freetype"
;
# Fix search path for BDJ jarfile
patches = stdenv.lib.optional withAACS ./BDJ-JARFILE-path.patch;
meta = with stdenv.lib; {
homepage = http://www.videolan.org/developers/libbluray.html;
description = "Library to access Blu-Ray disks for video playback";