From 89f4507c5c8782959a1a98df7efdadd00d850fd6 Mon Sep 17 00:00:00 2001 From: Nathaniel Baxter Date: Sun, 22 Feb 2015 14:39:37 +1100 Subject: [PATCH] libbluray: fix aacs support --- .../libbluray/BDJ-JARFILE-path.patch | 25 +++++++++++++++++++ .../libraries/libbluray/default.nix | 18 ++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch diff --git a/pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch b/pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch new file mode 100644 index 000000000000..64f0e74084fc --- /dev/null +++ b/pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch @@ -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 + }; + diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix index 3bcf62036ab8..170c4e461882 100644 --- a/pkgs/development/libraries/libbluray/default.nix +++ b/pkgs/development/libraries/libbluray/default.nix @@ -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";