2023-04-12 12:48:02 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, fetchFromGitLab
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
2020-07-18 16:06:22 +00:00
|
|
|
|
, pkg-config
|
|
|
|
|
, python3Packages
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, vulkan-headers
|
|
|
|
|
, vulkan-loader
|
|
|
|
|
, shaderc
|
|
|
|
|
, lcms2
|
2021-01-09 10:05:03 +00:00
|
|
|
|
, libGL
|
2024-01-25 14:12:00 +00:00
|
|
|
|
, libX11
|
2022-01-19 23:45:15 +00:00
|
|
|
|
, libunwind
|
2023-04-12 12:48:02 +00:00
|
|
|
|
, libdovi
|
2024-01-25 14:12:00 +00:00
|
|
|
|
, xxHash
|
2024-02-07 01:22:34 +00:00
|
|
|
|
, fast-float
|
2024-06-05 15:53:02 +00:00
|
|
|
|
, vulkanSupport ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "libplacebo";
|
2024-07-31 10:19:44 +00:00
|
|
|
|
version = "7.349.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
|
domain = "code.videolan.org";
|
|
|
|
|
owner = "videolan";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = "v${version}";
|
2024-07-31 10:19:44 +00:00
|
|
|
|
hash = "sha256-mIjQvc7SRjE1Orb2BkHK+K1TcRQvzj2oUOCUT4DzIuA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
meson
|
|
|
|
|
ninja
|
2020-07-18 16:06:22 +00:00
|
|
|
|
pkg-config
|
2023-04-12 12:48:02 +00:00
|
|
|
|
python3Packages.jinja2
|
|
|
|
|
python3Packages.glad2
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
shaderc
|
|
|
|
|
lcms2
|
2021-01-09 10:05:03 +00:00
|
|
|
|
libGL
|
2024-01-25 14:12:00 +00:00
|
|
|
|
libX11
|
2022-01-19 23:45:15 +00:00
|
|
|
|
libunwind
|
2023-04-12 12:48:02 +00:00
|
|
|
|
libdovi
|
2024-01-25 14:12:00 +00:00
|
|
|
|
xxHash
|
2024-06-05 15:53:02 +00:00
|
|
|
|
vulkan-headers
|
|
|
|
|
] ++ lib.optionals vulkanSupport [
|
|
|
|
|
vulkan-loader
|
2024-02-07 01:22:34 +00:00
|
|
|
|
] ++ lib.optionals (!stdenv.cc.isGNU) [
|
|
|
|
|
fast-float
|
2020-07-18 16:06:22 +00:00
|
|
|
|
];
|
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
|
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")
|
2024-09-26 11:04:55 +00:00
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-09-19 14:19:46 +00:00
|
|
|
|
(lib.mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind`
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
substituteInPlace meson.build \
|
|
|
|
|
--replace 'python_env.append' '#'
|
|
|
|
|
'';
|
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Reusable library for GPU-accelerated video/image rendering primitives";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
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).
|
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
homepage = "https://code.videolan.org/videolan/libplacebo";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
changelog = "https://code.videolan.org/videolan/libplacebo/-/tags/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
license = licenses.lgpl21Plus;
|
2024-07-27 06:49:29 +00:00
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
};
|
|
|
|
|
}
|