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
|
|
|
|
, libX11
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, libGL
|
2022-09-09 14:08:57 +00:00
|
|
|
, obs-vkcapture32
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "obs-vkcapture";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.3.0";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nowrep";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-xtIcIT9lWw73Et9WgyEUznwy1X947Rv5nTiM+t0qYaM=";
|
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
|
|
|
|
libX11
|
|
|
|
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";
|
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
|
|
|
};
|
|
|
|
}
|