mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-15 01:15:51 +00:00
e0464e4788
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" ```
53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{ stdenv
|
|
, lib
|
|
, fetchFromGitHub
|
|
, autoreconfHook
|
|
, libX11
|
|
, pkg-config
|
|
, libXext
|
|
, libdrm
|
|
, libXfixes
|
|
, wayland
|
|
, wayland-scanner
|
|
, libffi
|
|
, libGL
|
|
, mesa
|
|
, minimal ? false
|
|
, libva1-minimal
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "libva" + lib.optionalString minimal "-minimal";
|
|
# nixpkgs-update: no auto update
|
|
version = "1.8.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "intel";
|
|
repo = "libva";
|
|
rev = version;
|
|
sha256 = "sha256-ur59cqdZqXIY2dDUSie9XsxyRomVBxIW2IVKAgWYC38=";
|
|
};
|
|
|
|
outputs = [ "dev" "out" ];
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config wayland-scanner ];
|
|
|
|
buildInputs = [ libdrm ]
|
|
++ lib.optionals (!minimal) [ libva1-minimal libX11 libXext libXfixes wayland libffi libGL ];
|
|
# TODO: share libs between minimal and !minimal - perhaps just symlink them
|
|
|
|
# Add FHS paths for non-NixOS applications.
|
|
configureFlags = lib.optionals stdenv.hostPlatform.isLinux [ "--with-drivers-path=${mesa.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri" ]
|
|
++ lib.optionals (!minimal) [ "--enable-glx" ];
|
|
|
|
installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://www.freedesktop.org/wiki/Software/vaapi/";
|
|
license = licenses.mit;
|
|
description = "VAAPI library: Video Acceleration API";
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
|
};
|
|
}
|