mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-11 14:43:47 +00:00
![Artturin](/assets/img/avatar_default.png)
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
47 lines
1.6 KiB
Nix
47 lines
1.6 KiB
Nix
{ lib, stdenv, fetchurl, pkg-config, fontconfig, autoreconfHook, DiskArbitration
|
|
, withJava ? false, jdk17, ant, stripJavaArchivesHook
|
|
, withAACS ? false, libaacs
|
|
, withBDplus ? false, libbdplus
|
|
, withMetadata ? true, libxml2
|
|
, withFonts ? true, freetype
|
|
}:
|
|
|
|
# Info on how to use:
|
|
# https://wiki.archlinux.org/index.php/BluRay
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "libbluray";
|
|
version = "1.3.4";
|
|
|
|
src = fetchurl {
|
|
url = "https://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.bz2";
|
|
hash = "sha256-R4/9aKD13ejvbKmJt/A1taCiLFmRQuXNP/ewO76+Xys=";
|
|
};
|
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ]
|
|
++ lib.optionals withJava [ jdk17 ant stripJavaArchivesHook ];
|
|
|
|
buildInputs = [ fontconfig ]
|
|
++ lib.optional withMetadata libxml2
|
|
++ lib.optional withFonts freetype
|
|
++ lib.optional stdenv.hostPlatform.isDarwin DiskArbitration;
|
|
|
|
propagatedBuildInputs = lib.optional withAACS libaacs;
|
|
|
|
env.JAVA_HOME = lib.optionalString withJava jdk17.home; # Fails at runtime without this
|
|
env.NIX_LDFLAGS = lib.optionalString withAACS "-L${libaacs}/lib -laacs"
|
|
+ lib.optionalString withBDplus " -L${libbdplus}/lib -lbdplus";
|
|
|
|
configureFlags = lib.optional (!withJava) "--disable-bdjava-jar"
|
|
++ lib.optional (!withMetadata) "--without-libxml2"
|
|
++ lib.optional (!withFonts) "--without-freetype";
|
|
|
|
meta = with 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;
|
|
};
|
|
}
|