nixpkgs/pkgs/by-name/li/libplacebo/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

86 lines
2.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib
, stdenv
, fetchFromGitLab
, meson
, ninja
, pkg-config
, python3Packages
, vulkan-headers
, vulkan-loader
, shaderc
, lcms2
, libGL
, libX11
, libunwind
, libdovi
, xxHash
, fast-float
, vulkanSupport ? true
}:
stdenv.mkDerivation rec {
pname = "libplacebo";
version = "7.349.0";
src = fetchFromGitLab {
domain = "code.videolan.org";
owner = "videolan";
repo = pname;
rev = "v${version}";
hash = "sha256-mIjQvc7SRjE1Orb2BkHK+K1TcRQvzj2oUOCUT4DzIuA=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
python3Packages.jinja2
python3Packages.glad2
];
buildInputs = [
shaderc
lcms2
libGL
libX11
libunwind
libdovi
xxHash
vulkan-headers
] ++ lib.optionals vulkanSupport [
vulkan-loader
] ++ lib.optionals (!stdenv.cc.isGNU) [
fast-float
];
mesonFlags = [
(lib.mesonBool "demos" false) # Don't build and install the demo programs
(lib.mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer
(lib.mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead
(lib.mesonEnable "vk-proc-addr" vulkanSupport)
(lib.mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml")
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.mesonEnable "unwind" false) # libplacebo doesnt build with `darwin.libunwind`
];
postPatch = ''
substituteInPlace meson.build \
--replace 'python_env.append' '#'
'';
meta = with lib; {
description = "Reusable library for GPU-accelerated video/image rendering primitives";
longDescription = ''
Reusable library for GPU-accelerated image/view processing primitives and
shaders, as well a batteries-included, extensible, high-quality rendering
pipeline (similar to mpv's vo_gpu). Supports Vulkan, OpenGL and Metal (via
MoltenVK).
'';
homepage = "https://code.videolan.org/videolan/libplacebo";
changelog = "https://code.videolan.org/videolan/libplacebo/-/tags/v${version}";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ primeos ];
platforms = platforms.all;
};
}