2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2022-09-09 14:08:57 +00:00
|
|
|
, extra-cmake-modules
|
2022-04-27 09:35:20 +00:00
|
|
|
, ninja
|
|
|
|
, wayland
|
2022-09-09 14:08:57 +00:00
|
|
|
, wayland-scanner
|
2022-04-27 09:35:20 +00:00
|
|
|
, obs-studio
|
2023-04-29 16:46:19 +00:00
|
|
|
, libffi
|
2022-04-27 09:35:20 +00:00
|
|
|
, libX11
|
2023-04-29 16:46:19 +00:00
|
|
|
, libXau
|
|
|
|
, libXdmcp
|
2023-02-22 10:55:15 +00:00
|
|
|
, libxcb
|
2022-04-27 09:35:20 +00:00
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, libGL
|
2022-09-09 14:08:57 +00:00
|
|
|
, obs-vkcapture32
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-04-27 09:35:20 +00:00
|
|
|
pname = "obs-vkcapture";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.4.3";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nowrep";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = "v${finalAttrs.version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-hFweWZalWMGbGXhM6uxaGoWkr9srqxRChJo5yUBiBXs=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
cmakeFlags = lib.optionals stdenv.isi686 [
|
|
|
|
# We don't want to build the plugin for 32bit. The library integrates with
|
|
|
|
# the 64bit plugin but it's necessary to be loaded into 32bit games.
|
|
|
|
"-DBUILD_PLUGIN=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake extra-cmake-modules ninja wayland-scanner ];
|
|
|
|
buildInputs = [
|
|
|
|
libGL
|
2023-04-29 16:46:19 +00:00
|
|
|
libffi
|
2022-09-09 14:08:57 +00:00
|
|
|
libX11
|
2023-04-29 16:46:19 +00:00
|
|
|
libXau
|
|
|
|
libXdmcp
|
2023-02-22 10:55:15 +00:00
|
|
|
libxcb
|
2022-09-09 14:08:57 +00:00
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
wayland
|
|
|
|
]
|
|
|
|
++ lib.optionals (!stdenv.isi686) [
|
|
|
|
obs-studio
|
|
|
|
];
|
|
|
|
|
|
|
|
# Support 32bit Vulkan applications by linking in the 32bit Vulkan layer
|
|
|
|
postInstall = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
|
|
|
|
ln -s ${obs-vkcapture32}/share/vulkan/implicit_layer.d/obs_vkcapture_32.json \
|
|
|
|
"$out/share/vulkan/implicit_layer.d/"
|
|
|
|
'';
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "OBS Linux Vulkan/OpenGL game capture";
|
|
|
|
homepage = "https://github.com/nowrep/obs-vkcapture";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/nowrep/obs-vkcapture/releases/tag/v${finalAttrs.version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ atila pedrohlc ];
|
2022-04-27 09:35:20 +00:00
|
|
|
license = licenses.gpl2Only;
|
2022-08-12 12:06:08 +00:00
|
|
|
platforms = platforms.linux;
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|