git.iko.soy/typeable/nixpkgs
on master help sign in
libbluray: fix aacs support
commit89f4507c5c8782959a1a98df7efdadd00d850fd6 authorNathaniel Baxter <nathaniel.baxter@gmail.com> dateSun 22 Feb 2015, 14:39 (12 years ago) parent1aed33f
2 files changed+40−3
pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch+25 pkgs/development/libraries/libbluray/default.nix+15−3
pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patchnew file+25
@@ -0,0 +1,25 @@
1+diff --git a/configure.ac b/configure.ac
2+index 3609d88..48c6bc6 100644
3+--- a/configure.ac
4++++ b/configure.ac
5+@@ -227,6 +227,7 @@ if [[ $use_bdjava = "yes" ]]; then
6+ AC_DEFINE([USING_BDJAVA], [1], ["Define to 1 if using BD-Java"])
7+ AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
8+ AC_DEFINE_UNQUOTED([JDK_HOME], ["$JDK_HOME"], [""])
9++ CPPFLAGS="${CPPFLAGS} -DJARDIR='\"\$(datadir)/java\"'"
10+ fi
11+ AM_CONDITIONAL([USING_BDJAVA], [ test $use_bdjava = "yes" ])
12+
13+diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
14+index c622801..f4aab9b 100644
15+--- a/src/libbluray/bdj/bdj.c
16++++ b/src/libbluray/bdj/bdj.c
17+@@ -210,7 +210,7 @@ static const char *_find_libbluray_jar(void)
18+ #ifdef _WIN32
19+ "" BDJ_JARFILE,
20+ #else
21+- "/usr/share/java/" BDJ_JARFILE,
22++ JARDIR "/" BDJ_JARFILE,
23+ #endif
24+ };
25+
pkgs/development/libraries/libbluray/default.nix+15−3
@@ -2,9 +2,11 @@
22, withAACS ? false, libaacs ? null, jdk ? null, ant ? null
33, withMetadata ? true, libxml2 ? null
44, withFonts ? true, freetype ? null
5+# Need to run autoreconf hook after BDJ jarfile patch
6+, autoreconfHook ? null
57}:
68
7−assert withAACS -> jdk != null && ant != null && libaacs != null;
9+assert withAACS -> jdk != null && ant != null && libaacs != null && autoreconfHook != null;
810assert withMetadata -> libxml2 != null;
911assert withFonts -> freetype != null;
1012
@@ -28,17 +30,27 @@ stdenv.mkDerivation rec {
2830
2931 buildInputs = with stdenv.lib;
3032 [fontconfig]
31− ++ optionals withAACS [jdk libaacs]
33+ ++ optionals withAACS [ jdk autoreconfHook ]
3234 ++ optional withMetadata libxml2
3335 ++ optional withFonts freetype
3436 ;
3537
38+ propagatedBuildInputs = stdenv.lib.optional withAACS libaacs;
39+
40+ preConfigure = stdenv.lib.optionalString withAACS ''
41+ export JDK_HOME=${jdk.home}
42+ export LIBS="$LIBS -L${libaacs} -laacs"
43+ '';
44+
3645 configureFlags = with stdenv.lib;
37− optionals withAACS ["--enable-bdjava" "--with-jdk=${jdk}"]
46+ optional withAACS "--enable-bdjava"
3847 ++ optional (! withMetadata) "--without-libxml2"
3948 ++ optional (! withFonts) "--without-freetype"
4049 ;
4150
51+ # Fix search path for BDJ jarfile
52+ patches = stdenv.lib.optional withAACS ./BDJ-JARFILE-path.patch;
53+
4254 meta = with stdenv.lib; {
4355 homepage = http://www.videolan.org/developers/libbluray.html;
4456 description = "Library to access Blu-Ray disks for video playback";