Unverified Commit 86eaa54c authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

xpraWithNvenc: add nvjpeg support (#370396)

parents 1eb49447 941f3d43
Loading
Loading
Loading
Loading
+27 −11
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
  atk,
  cairo,
  cudatoolkit,
  cudaPackages,
  ffmpeg,
  gdk-pixbuf,
  getopt,
@@ -40,7 +41,7 @@
  xorgserver,
  xxHash,
  clang,
}:
}@args:

let
  inherit (python3.pkgs) cython buildPythonApplication;
@@ -73,11 +74,18 @@ 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 ${cudaPackages.libnvjpeg.dev}/share/pkgconfig/nvjpeg.pc $out/lib/pkgconfig/nvjpeg.pc
  '';
in
buildPythonApplication rec {
  pname = "xpra";
  version = "6.2.2";

  stdenv = if withNvenc then cudaPackages.backendStdenv else args.stdenv;

  src = fetchFromGitHub {
    owner = "Xpra-org";
    repo = "xpra";
@@ -148,7 +156,10 @@ buildPythonApplication rec {
      x265
      xxHash
    ]
    ++ lib.optional withNvenc nvencHeaders;
    ++ lib.optional withNvenc [
      nvencHeaders
      nvjpegHeaders
    ];

  propagatedBuildInputs =
    with python3.pkgs;
@@ -185,7 +196,8 @@ buildPythonApplication rec {
  # error: 'import_cairo' defined but not used
  env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";

  setupPyBuildFlags = [
  setupPyBuildFlags =
    [
      "--with-Xdummy"
      "--without-Xdummy_wrapper"
      "--without-strict"
@@ -193,7 +205,11 @@ buildPythonApplication rec {
      # Override these, setup.py checks for headers in /usr/* paths
      "--with-pam"
      "--with-vsock"
  ] ++ lib.optional withNvenc "--with-nvenc";
    ]
    ++ lib.optional withNvenc [
      "--with-nvenc"
      "--with-nvjpeg_encoder"
    ];

  dontWrapGApps = true;