Skip to content

Commit

Permalink
xpraWithNvenc: add nvjpeg support
Browse files Browse the repository at this point in the history
  • Loading branch information
CorbinWunderlich committed Jan 2, 2025
1 parent 639295b commit 3c23fe6
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions pkgs/tools/X11/xpra/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
atk,
cairo,
cudatoolkit,
libnvjpeg,
ffmpeg,
gdk-pixbuf,
getopt,
Expand Down Expand Up @@ -40,7 +41,6 @@
xorgserver,
xxHash,
}:

let
inherit (python3.pkgs) cython buildPythonApplication;

Expand Down Expand Up @@ -72,6 +72,11 @@ let
cp ${nv-codec-headers-10}/include/ffnvcodec/nvEncodeAPI.h $out/include
substituteAll ${./nvenc.pc} $out/lib/pkgconfig/nvenc.pc
'';

nvjpegHeaders = runCommand "nvjpeg-headers" { } ''
mkdir -p $out/include $out/lib/pkgconfig
substituteAll ${libnvjpeg.dev}/share/pkgconfig/nvjpeg.pc $out/lib/pkgconfig/nvjpeg.pc
'';
in
buildPythonApplication rec {
pname = "xpra";
Expand Down Expand Up @@ -144,7 +149,10 @@ buildPythonApplication rec {
x265
xxHash
]
++ lib.optional withNvenc nvencHeaders;
++ lib.optional withNvenc [
nvencHeaders
nvjpegHeaders
];

propagatedBuildInputs =
with python3.pkgs;
Expand Down Expand Up @@ -181,15 +189,20 @@ buildPythonApplication rec {
# error: 'import_cairo' defined but not used
env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";

setupPyBuildFlags = [
"--with-Xdummy"
"--without-Xdummy_wrapper"
"--without-strict"
"--with-gtk3"
# Override these, setup.py checks for headers in /usr/* paths
"--with-pam"
"--with-vsock"
] ++ lib.optional withNvenc "--with-nvenc";
setupPyBuildFlags =
[
"--with-Xdummy"
"--without-Xdummy_wrapper"
"--without-strict"
"--with-gtk3"
# Override these, setup.py checks for headers in /usr/* paths
"--with-pam"
"--with-vsock"
]
++ lib.optional withNvenc [
"--with-nvenc"
"--with-nvjpeg_encoder"
];

dontWrapGApps = true;

Expand Down

0 comments on commit 3c23fe6

Please sign in to comment.