2022-09-09 14:08:57 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, pkg-config, fontconfig, autoreconfHook, DiskArbitration
|
2022-05-18 14:49:53 +00:00
|
|
|
, withJava ? false, jdk, ant
|
|
|
|
, withAACS ? false, libaacs
|
|
|
|
, withBDplus ? false, libbdplus
|
|
|
|
, withMetadata ? true, libxml2
|
|
|
|
, withFonts ? true, freetype
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
# Info on how to use:
|
|
|
|
# https://wiki.archlinux.org/index.php/BluRay
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libbluray";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "1.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-08-21 13:32:41 +00:00
|
|
|
url = "https://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.bz2";
|
|
|
|
sha256 = "sha256-RWgU258Hwe7N736ED8uyCXbvgU34dUKL+4Hs9FhR8XA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
patches = [
|
|
|
|
./BDJ-JARFILE-path.patch
|
2022-09-09 14:08:57 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "Initial-support-for-Java-18.patch";
|
|
|
|
url = "https://code.videolan.org/videolan/libbluray/-/commit/3187c3080096e107f0a27eed1843232b58342577.patch";
|
|
|
|
hash = "sha256-2TSciAoPzELkgmFGB38h1RgynOCJueyCL8hIADxAPHo=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "bd-j-BDJSecurityManager-Change-setSecurityManager-de.patch";
|
|
|
|
url = "https://code.videolan.org/videolan/libbluray/-/commit/9a2d23d049760ef9cc9661ff90011a84d90368f1.patch";
|
|
|
|
hash = "sha256-xCc2h5ocXCqnpVMPQaybT2Ncs2YOzifQ0mlCCUhYlc8=";
|
|
|
|
})
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ]
|
2022-08-21 13:32:41 +00:00
|
|
|
++ lib.optionals withJava [ ant ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ fontconfig ]
|
2022-08-21 13:32:41 +00:00
|
|
|
++ lib.optional withJava jdk
|
|
|
|
++ lib.optional withMetadata libxml2
|
|
|
|
++ lib.optional withFonts freetype
|
|
|
|
++ lib.optional stdenv.isDarwin DiskArbitration;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
propagatedBuildInputs = lib.optional withAACS libaacs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString withAACS "-L${libaacs}/lib -laacs"
|
|
|
|
+ lib.optionalString withBDplus " -L${libbdplus}/lib -lbdplus";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
preConfigure = lib.optionalString withJava ''
|
|
|
|
export JDK_HOME="${jdk.home}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
configureFlags = lib.optional (!withJava) "--disable-bdjava-jar"
|
|
|
|
++ lib.optional (!withMetadata) "--without-libxml2"
|
|
|
|
++ lib.optional (!withFonts) "--without-freetype";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.videolan.org/developers/libbluray.html";
|
|
|
|
description = "Library to access Blu-Ray disks for video playback";
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|