1 { lib, stdenv, fetchurl, fetchpatch, pkg-config, fontconfig, autoreconfHook, DiskArbitration
2 , withJava ? false, jdk, ant
3 , withAACS ? false, libaacs
4 , withBDplus ? false, libbdplus
5 , withMetadata ? true, libxml2
6 , withFonts ? true, freetype
10 # https://wiki.archlinux.org/index.php/BluRay
12 stdenv.mkDerivation rec {
17 url = "https://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.bz2";
18 sha256 = "sha256-RWgU258Hwe7N736ED8uyCXbvgU34dUKL+4Hs9FhR8XA=";
22 ./BDJ-JARFILE-path.patch
24 name = "Initial-support-for-Java-18.patch";
25 url = "https://code.videolan.org/videolan/libbluray/-/commit/3187c3080096e107f0a27eed1843232b58342577.patch";
26 hash = "sha256-2TSciAoPzELkgmFGB38h1RgynOCJueyCL8hIADxAPHo=";
29 name = "bd-j-BDJSecurityManager-Change-setSecurityManager-de.patch";
30 url = "https://code.videolan.org/videolan/libbluray/-/commit/9a2d23d049760ef9cc9661ff90011a84d90368f1.patch";
31 hash = "sha256-xCc2h5ocXCqnpVMPQaybT2Ncs2YOzifQ0mlCCUhYlc8=";
35 nativeBuildInputs = [ pkg-config autoreconfHook ]
36 ++ lib.optionals withJava [ ant ];
38 buildInputs = [ fontconfig ]
39 ++ lib.optional withJava jdk
40 ++ lib.optional withMetadata libxml2
41 ++ lib.optional withFonts freetype
42 ++ lib.optional stdenv.isDarwin DiskArbitration;
44 propagatedBuildInputs = lib.optional withAACS libaacs;
46 NIX_LDFLAGS = lib.optionalString withAACS "-L${libaacs}/lib -laacs"
47 + lib.optionalString withBDplus " -L${libbdplus}/lib -lbdplus";
49 preConfigure = lib.optionalString withJava ''
50 export JDK_HOME="${jdk.home}"
53 configureFlags = lib.optional (!withJava) "--disable-bdjava-jar"
54 ++ lib.optional (!withMetadata) "--without-libxml2"
55 ++ lib.optional (!withFonts) "--without-freetype";
58 homepage = "http://www.videolan.org/developers/libbluray.html";
59 description = "Library to access Blu-Ray disks for video playback";
60 license = licenses.lgpl21;
61 maintainers = with maintainers; [ abbradar ];
62 platforms = platforms.unix;