@@ -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";