nixpkgs/pkgs/development/libraries/libbluray/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

67 lines
2.0 KiB
Nix

{ 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 stdenv.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";
version = "1.2.1";
src = fetchurl {
url = "http://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.bz2";
sha256 = "1v1nmq631j0prih7pjl01ixhhwgrkjpxrjmmc342rsl8g4zyh8sj";
};
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
++ optional stdenv.isDarwin DiskArbitration
;
propagatedBuildInputs = optional withAACS libaacs;
NIX_LDFLAGS = toString [
(optionalString withAACS "-L${libaacs}/lib -laacs")
(optionalString withBDplus "-L${libbdplus}/lib -lbdplus")
];
preConfigure = ''
${optionalString withJava ''export JDK_HOME="${jdk.home}"''}
'';
configureFlags = with stdenv.lib;
optional (! withJava) "--disable-bdjava-jar"
++ optional (! withMetadata) "--without-libxml2"
++ optional (! withFonts) "--without-freetype"
;
meta = with stdenv.lib; {
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;
};
}