nixpkgs/pkgs/development/libraries/libbluray/default.nix

67 lines
2.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, pkg-config, fontconfig, autoreconfHook, DiskArbitration
, withJava ? false, jdk ? null, ant ? null
, withAACS ? false, libaacs ? null
, withBDplus ? false, libbdplus ? null
, withMetadata ? true, libxml2 ? null
, withFonts ? true, freetype ? null
}:
with lib;
assert withJava -> jdk != null && ant != null;
assert withAACS -> libaacs != null;
assert withBDplus -> libbdplus != null;
assert withMetadata -> libxml2 != null;
assert withFonts -> freetype != null;
# Info on how to use:
# https://wiki.archlinux.org/index.php/BluRay
stdenv.mkDerivation rec {
pname = "libbluray";
2020-11-02 23:05:29 +00:00
version = "1.2.1";
src = fetchurl {
url = "http://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.bz2";
2020-11-02 23:05:29 +00:00
sha256 = "1v1nmq631j0prih7pjl01ixhhwgrkjpxrjmmc342rsl8g4zyh8sj";
};
2017-03-18 08:44:25 +00:00
patches = optional withJava ./BDJ-JARFILE-path.patch;
nativeBuildInputs = [ pkg-config autoreconfHook ]
++ optionals withJava [ ant ]
;
buildInputs = [ fontconfig ]
++ optional withJava jdk
++ optional withMetadata libxml2
++ optional withFonts freetype
2020-04-06 10:20:00 +01:00
++ optional stdenv.isDarwin DiskArbitration
;
2017-03-18 08:44:25 +00:00
propagatedBuildInputs = optional withAACS libaacs;
2019-10-30 00:40:49 +00:00
NIX_LDFLAGS = toString [
2017-03-18 08:44:25 +00:00
(optionalString withAACS "-L${libaacs}/lib -laacs")
(optionalString withBDplus "-L${libbdplus}/lib -lbdplus")
];
2015-02-22 03:39:37 +00:00
preConfigure = ''
${optionalString withJava ''export JDK_HOME="${jdk.home}"''}
2015-02-22 03:39:37 +00:00
'';
configureFlags = with lib;
2018-01-28 15:00:48 +00:00
optional (! withJava) "--disable-bdjava-jar"
++ optional (! withMetadata) "--without-libxml2"
++ optional (! withFonts) "--without-freetype"
;
meta = with lib; {
2020-03-24 13:31:47 +00:00
homepage = "http://www.videolan.org/developers/libbluray.html";
description = "Library to access Blu-Ray disks for video playback";
license = licenses.lgpl21;
2017-03-18 08:44:25 +00:00
maintainers = with maintainers; [ abbradar ];
platforms = platforms.unix;
};
}