about summary refs log tree commit diff
path: root/pkgs/tools/X11/xpra
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/X11/xpra')
-rw-r--r--pkgs/tools/X11/xpra/0002-Constant-DPI.patch96
-rw-r--r--pkgs/tools/X11/xpra/0003-fix-pointer-limits.patch39
-rw-r--r--pkgs/tools/X11/xpra/default.nix219
-rw-r--r--pkgs/tools/X11/xpra/fix-122159.patch16
-rw-r--r--pkgs/tools/X11/xpra/fix-41106.patch15
-rw-r--r--pkgs/tools/X11/xpra/fix-paths.patch37
-rw-r--r--pkgs/tools/X11/xpra/libfakeXinerama.nix40
-rw-r--r--pkgs/tools/X11/xpra/nvenc.pc11
-rwxr-xr-xpkgs/tools/X11/xpra/update.sh5
9 files changed, 0 insertions, 478 deletions
diff --git a/pkgs/tools/X11/xpra/0002-Constant-DPI.patch b/pkgs/tools/X11/xpra/0002-Constant-DPI.patch
deleted file mode 100644
index f91e53d1e493..000000000000
--- a/pkgs/tools/X11/xpra/0002-Constant-DPI.patch
+++ /dev/null
@@ -1,96 +0,0 @@
---- a/src/dummy.h	2016-12-17 23:02:53.396287041 +0100
-+++ b/src/dummy.h	2016-12-17 23:03:30.319616550 +0100
-@@ -51,6 +51,7 @@
-     /* options */
-     OptionInfoPtr Options;
-     Bool swCursor;
-+    Bool constantDPI;
-     /* proc pointer */
-     CloseScreenProcPtr CloseScreen;
-     xf86CursorInfoPtr CursorInfo;
---- a/src/dummy_driver.c	2016-12-14 21:54:20.000000000 +0100
-+++ b/src/dummy_driver.c	2016-12-17 23:04:59.916416126 +0100
-@@ -17,6 +17,12 @@
- /* All drivers using the mi colormap manipulation need this */
- #include "micmap.h"
- 
-+#ifdef RANDR
-+#include "randrstr.h"
-+#endif
-+
-+#include "windowstr.h"
-+
- /* identifying atom needed by magnifiers */
- #include <X11/Xatom.h>
- #include "property.h"
-@@ -115,11 +121,15 @@
- };
- 
- typedef enum {
--    OPTION_SW_CURSOR
-+    OPTION_SW_CURSOR,
-+    OPTION_CONSTANT_DPI
- } DUMMYOpts;
- 
- static const OptionInfoRec DUMMYOptions[] = {
-     { OPTION_SW_CURSOR,	"SWcursor",	OPTV_BOOLEAN,	{0}, FALSE },
-+#ifdef RANDR
-+    { OPTION_CONSTANT_DPI,	"ConstantDPI",	OPTV_BOOLEAN,	{0}, FALSE },
-+#endif
-     { -1,                  NULL,           OPTV_NONE,	{0}, FALSE }
- };
- 
-@@ -359,6 +369,7 @@
-     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, dPtr->Options);
- 
-     xf86GetOptValBool(dPtr->Options, OPTION_SW_CURSOR,&dPtr->swCursor);
-+    xf86GetOptValBool(dPtr->Options, OPTION_CONSTANT_DPI, &dPtr->constantDPI);
- 
-     if (device->videoRam != 0) {
- 	pScrn->videoRam = device->videoRam;
-@@ -639,10 +650,45 @@
-     return TRUE;
- }
- 
-+const char *XDPY_PROPERTY = "dummy-constant-xdpi";
-+const char *YDPY_PROPERTY = "dummy-constant-ydpi";
-+static int get_dpi_value(WindowPtr root, const char *property_name, int default_dpi)
-+{
-+    PropertyPtr prop;
-+    Atom type_atom = MakeAtom("CARDINAL", 8, TRUE);
-+    Atom prop_atom = MakeAtom(property_name, strlen(property_name), FALSE);
-+
-+    for (prop = wUserProps(root); prop; prop = prop->next) {
-+       if (prop->propertyName == prop_atom && prop->type == type_atom && prop->data) {
-+           int v = (int) (*((CARD32 *) prop->data));
-+           if ((v>0) && (v<4096)) {
-+               xf86DrvMsg(0, X_INFO, "get_constant_dpi_value() found property \"%s\" with value=%i\n", property_name, (int) v);
-+               return (int) v;
-+           }
-+           break;
-+       }
-+    }
-+    return default_dpi;
-+}
-+
- /* Mandatory */
- Bool
- DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
- {
-+    SCRN_INFO_PTR(arg);
-+#ifdef RANDR
-+    DUMMYPtr dPtr = DUMMYPTR(pScrn);
-+    if (dPtr->constantDPI) {
-+        int xDpi = get_dpi_value(pScrn->pScreen->root, XDPY_PROPERTY, pScrn->xDpi);
-+        int yDpi = get_dpi_value(pScrn->pScreen->root, YDPY_PROPERTY, pScrn->yDpi);
-+        //25.4 mm per inch: (254/10)
-+        pScrn->pScreen->mmWidth = mode->HDisplay * 254 / xDpi / 10;
-+        pScrn->pScreen->mmHeight = mode->VDisplay * 254 / yDpi / 10;
-+        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "mm(dpi %ix%i)=%ix%i\n", xDpi, yDpi, pScrn->pScreen->mmWidth, pScrn->pScreen->mmHeight);
-+        RRScreenSizeNotify(pScrn->pScreen);
-+        RRTellChanged(pScrn->pScreen);
-+    }
-+#endif
-     return TRUE;
- }
- 
diff --git a/pkgs/tools/X11/xpra/0003-fix-pointer-limits.patch b/pkgs/tools/X11/xpra/0003-fix-pointer-limits.patch
deleted file mode 100644
index 3dbb6fd179ff..000000000000
--- a/pkgs/tools/X11/xpra/0003-fix-pointer-limits.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- xf86-video-dummy-0.3.6/src/dummy_driver.c	2014-11-05 19:24:02.668656601 +0700
-+++ xf86-video-dummy-0.3.6.new/src/dummy_driver.c	2014-11-05 19:37:53.076061853 +0700
-@@ -55,6 +55,9 @@
- #include <X11/extensions/xf86dgaproto.h>
- #endif
- 
-+/* Needed for fixing pointer limits on resize */
-+#include "inputstr.h"
-+
- /* Mandatory functions */
- static const OptionInfoRec *	DUMMYAvailableOptions(int chipid, int busid);
- static void     DUMMYIdentify(int flags);
-@@ -713,6 +716,26 @@
-         RRTellChanged(pScrn->pScreen);
-     }
- #endif
-+    //ensure the screen dimensions are also updated:
-+    pScrn->pScreen->width = mode->HDisplay;
-+    pScrn->pScreen->height = mode->VDisplay;
-+    pScrn->virtualX = mode->HDisplay;
-+    pScrn->virtualY = mode->VDisplay;
-+    pScrn->frameX1 = mode->HDisplay;
-+    pScrn->frameY1 = mode->VDisplay;
-+
-+    //ensure the pointer uses the new limits too:
-+    DeviceIntPtr pDev;
-+    SpritePtr pSprite;
-+    for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
-+        if (pDev->spriteInfo!=NULL && pDev->spriteInfo->sprite!=NULL) {
-+            pSprite = pDev->spriteInfo->sprite;
-+            pSprite->hotLimits.x2 = mode->HDisplay;
-+            pSprite->hotLimits.y2 = mode->VDisplay;
-+            pSprite->physLimits.x2 = mode->HDisplay;
-+            pSprite->physLimits.y2 = mode->VDisplay;
-+        }
-+    }
-     return TRUE;
- }
- 
diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix
deleted file mode 100644
index f779dd325b8c..000000000000
--- a/pkgs/tools/X11/xpra/default.nix
+++ /dev/null
@@ -1,219 +0,0 @@
-{ lib
-, fetchurl
-, substituteAll
-, pkg-config
-, runCommand
-, writeText
-, wrapGAppsHook3
-, withNvenc ? false
-, atk
-, cairo
-, cudatoolkit
-, ffmpeg
-, gdk-pixbuf
-, getopt
-, glib
-, gobject-introspection
-, gst_all_1
-, gtk3
-, libappindicator
-, libfakeXinerama
-, librsvg
-, libvpx
-, libwebp
-, lz4
-, nv-codec-headers-10
-, nvidia_x11 ? null
-, pam
-, pandoc
-, pango
-, pulseaudio
-, python3
-, util-linux
-, which
-, x264
-, x265
-, xauth
-, xorg
-, xorgserver
-}:
-
-let
-  inherit (python3.pkgs) cython buildPythonApplication;
-
-  xf86videodummy = xorg.xf86videodummy.overrideDerivation (p: {
-    patches = [
-      # patch provided by Xpra upstream
-      ./0002-Constant-DPI.patch
-      # https://github.com/Xpra-org/xpra/issues/349
-      ./0003-fix-pointer-limits.patch
-    ];
-  });
-
-  xorgModulePaths = writeText "module-paths" ''
-    Section "Files"
-      ModulePath "${xorgserver}/lib/xorg/modules"
-      ModulePath "${xorgserver}/lib/xorg/modules/extensions"
-      ModulePath "${xorgserver}/lib/xorg/modules/drivers"
-      ModulePath "${xf86videodummy}/lib/xorg/modules/drivers"
-    EndSection
-  '';
-
-  nvencHeaders = runCommand "nvenc-headers" {
-    inherit nvidia_x11;
-  } ''
-    mkdir -p $out/include $out/lib/pkgconfig
-    cp ${nv-codec-headers-10}/include/ffnvcodec/nvEncodeAPI.h $out/include
-    substituteAll ${./nvenc.pc} $out/lib/pkgconfig/nvenc.pc
-  '';
-in buildPythonApplication rec {
-  pname = "xpra";
-  version = "4.4.6";
-
-  src = fetchurl {
-    url = "https://xpra.org/src/${pname}-${version}.tar.xz";
-    hash = "sha256-BWf3nypfSrYCzpJ0OfBkecoHGbG1lEgu5jLZhfkIejQ=";
-  };
-
-  patches = [
-    (substituteAll {  # correct hardcoded paths
-      src = ./fix-paths.patch;
-      inherit libfakeXinerama;
-    })
-    ./fix-41106.patch  # https://github.com/NixOS/nixpkgs/issues/41106
-    ./fix-122159.patch # https://github.com/NixOS/nixpkgs/issues/122159
-  ];
-
-  INCLUDE_DIRS = "${pam}/include";
-
-  nativeBuildInputs = [
-    gobject-introspection
-    pkg-config
-    wrapGAppsHook3
-    pandoc
-  ] ++ lib.optional withNvenc cudatoolkit;
-
-  buildInputs = with xorg; [
-    libX11
-    libXcomposite
-    libXdamage
-    libXfixes
-    libXi
-    libxkbfile
-    libXrandr
-    libXrender
-    libXres
-    libXtst
-    xorgproto
-  ] ++ (with gst_all_1; [
-    gst-libav
-    gst-plugins-bad
-    gst-plugins-base
-    gst-plugins-good
-    gstreamer
-  ]) ++ [
-    atk.out
-    cairo
-    cython
-    ffmpeg
-    gdk-pixbuf
-    glib
-    gtk3
-    libappindicator
-    librsvg
-    libvpx
-    libwebp
-    lz4
-    pam
-    pango
-    x264
-    x265
-  ] ++ lib.optional withNvenc nvencHeaders;
-
-  propagatedBuildInputs = with python3.pkgs; ([
-    cryptography
-    dbus-python
-    gst-python
-    idna
-    lz4
-    netifaces
-    numpy
-    opencv4
-    pam
-    paramiko
-    pillow
-    pycairo
-    pycrypto
-    pycups
-    pygobject3
-    pyinotify
-    pyopengl
-    python-uinput
-    pyxdg
-    rencode
-    invoke
-  ] ++ lib.optionals withNvenc [
-    pycuda
-    pynvml
-  ]);
-
-  # 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";
-
-  dontWrapGApps = true;
-
-  preFixup = ''
-    makeWrapperArgs+=(
-      "''${gappsWrapperArgs[@]}"
-      --set XPRA_INSTALL_PREFIX "$out"
-      --set XPRA_COMMAND "$out/bin/xpra"
-      --set XPRA_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb"
-      --set XORG_CONFIG_PREFIX ""
-      --prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib
-      --prefix PATH : ${lib.makeBinPath [ getopt xorgserver xauth which util-linux pulseaudio ]}
-  '' + lib.optionalString withNvenc ''
-      --prefix LD_LIBRARY_PATH : ${nvidia_x11}/lib
-  '' + ''
-    )
-  '';
-
-  postInstall = ''
-    # append module paths to xorg.conf
-    cat ${xorgModulePaths} >> $out/etc/xpra/xorg.conf
-    cat ${xorgModulePaths} >> $out/etc/xpra/xorg-uinput.conf
-
-    # make application icon visible to desktop environemnts
-    icon_dir="$out/share/icons/hicolor/64x64/apps"
-    mkdir -p "$icon_dir"
-    ln -sr "$out/share/icons/xpra.png" "$icon_dir"
-  '';
-
-  doCheck = false;
-
-  enableParallelBuilding = true;
-
-  passthru = {
-    inherit xf86videodummy;
-    updateScript = ./update.sh;
-  };
-
-  meta = with lib; {
-    homepage = "https://xpra.org/";
-    downloadPage = "https://xpra.org/src/";
-    description = "Persistent remote applications for X";
-    changelog = "https://github.com/Xpra-org/xpra/releases/tag/v${version}";
-    platforms = platforms.linux;
-    license = licenses.gpl2Only;
-    maintainers = with maintainers; [ offline numinit mvnetbiz ];
-  };
-}
diff --git a/pkgs/tools/X11/xpra/fix-122159.patch b/pkgs/tools/X11/xpra/fix-122159.patch
deleted file mode 100644
index 510b40422a2a..000000000000
--- a/pkgs/tools/X11/xpra/fix-122159.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/xpra/scripts/main.py b/xpra/scripts/main.py
-index 031a41f9e..6232ba830 100755
---- a/xpra/scripts/main.py
-+++ b/xpra/scripts/main.py
-@@ -377,11 +377,7 @@ def run_mode(script_file, cmdline, error_cb, options, args, mode, defaults):
-         "seamless", "desktop", "shadow", "expand",
-         "upgrade", "upgrade-seamless", "upgrade-desktop",
-         ) and not display_is_remote and use_systemd_run(options.systemd_run):
--        #make sure we run via the same interpreter,
--        #inject it into the command line if we have to:
-         argv = list(cmdline)
--        if argv[0].find("python")<0:
--            argv.insert(0, "python%i.%i" % (sys.version_info.major, sys.version_info.minor))
-         return systemd_run_wrap(mode, argv, options.systemd_run_args)
-     configure_env(options.env)
-     configure_logging(options, mode)
diff --git a/pkgs/tools/X11/xpra/fix-41106.patch b/pkgs/tools/X11/xpra/fix-41106.patch
deleted file mode 100644
index 81870fc1a2a1..000000000000
--- a/pkgs/tools/X11/xpra/fix-41106.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/xpra/server/server_util.py b/xpra/server/server_util.py
-index f46998ee9f..60068f21b6 100644
---- a/xpra/server/server_util.py
-+++ b/xpra/server/server_util.py
-@@ -157,6 +157,10 @@ def xpra_env_shell_script(socket_dir, env):
-     return b"\n".join(script)
- 
- def xpra_runner_shell_script(xpra_file, starting_dir):
-+    # Nixpkgs contortion:
-+    # xpra_file points to a shell wrapper, not to the python script.
-+    dirname, basename = os.path.split(xpra_file)
-+    xpra_file = os.path.join(dirname, "."+basename+"-wrapped")
-     script = []
-     # We ignore failures in cd'ing, b/c it's entirely possible that we were
-     # started from some temporary directory and all paths are absolute.
diff --git a/pkgs/tools/X11/xpra/fix-paths.patch b/pkgs/tools/X11/xpra/fix-paths.patch
deleted file mode 100644
index 9df7d835d031..000000000000
--- a/pkgs/tools/X11/xpra/fix-paths.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff --git a/xpra/x11/fakeXinerama.py b/xpra/x11/fakeXinerama.py
-index d5c1c8bb10..88c77e8142 100755
---- a/xpra/x11/fakeXinerama.py
-+++ b/xpra/x11/fakeXinerama.py
-@@ -22,31 +22,7 @@ fakeXinerama_config_files = [
-            ]
- 
- def find_libfakeXinerama():
--    libname = "fakeXinerama"
--    try:
--        from ctypes.util import find_library
--        flibname = find_library("fakeXinerama")
--        if flibname:
--            libname = flibname
--    except Exception:
--        pass
--    if POSIX:
--        for lib_dir in os.environ.get("LD_LIBRARY_PATH", "/usr/lib").split(os.pathsep):
--            lib_path = os.path.join(lib_dir, libname)
--            if not os.path.exists(lib_dir):
--                continue
--            if os.path.exists(lib_path) and os.path.isfile(lib_path):
--                return lib_path
--    if LINUX:
--        try:
--            libpath = find_lib_ldconfig("fakeXinerama")
--            if libpath:
--                return libpath
--        except Exception as e:
--            log("find_libfakeXinerama()", exc_info=True)
--            log.error("Error: cannot launch ldconfig -p to locate libfakeXinerama:")
--            log.error(" %s", e)
--    return find_lib("libfakeXinerama.so.1")
-+    return "@libfakeXinerama@/lib/libfakeXinerama.so.1.0"
- 
- current_xinerama_config = None
- 
diff --git a/pkgs/tools/X11/xpra/libfakeXinerama.nix b/pkgs/tools/X11/xpra/libfakeXinerama.nix
deleted file mode 100644
index 4ec1f7f4370d..000000000000
--- a/pkgs/tools/X11/xpra/libfakeXinerama.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ lib, stdenv, fetchurl, libX11, libXinerama }:
-
-stdenv.mkDerivation  rec {
-  pname = "libfakeXinerama";
-  version = "0.1.0";
-
-  src = fetchurl {
-    url = "https://www.xpra.org/src/${pname}-${version}.tar.bz2";
-    sha256 = "0gxb8jska2anbb3c1m8asbglgnwylgdr44x9lr8yh91hjxsqadkx";
-  };
-
-  buildInputs = [ libX11 libXinerama ];
-
-  buildPhase = ''
-    runHook preBuild
-
-    $CC -O2 -Wall fakeXinerama.c -fPIC -o libfakeXinerama.so.1.0 -shared
-
-    runHook postBuild
-  '';
-
-  installPhase = ''
-    runHook preInstall
-
-    install -Dm555 libfakeXinerama.so.1.0 -t "$out/lib"
-    ln -s libfakeXinerama.so.1.0 "$out/lib/libXinerama.so.1.0"
-    ln -s libXinerama.so.1.0 "$out/lib/libXinerama.so.1"
-    ln -s libXinerama.so.1 "$out/lib/libXinerama.so"
-
-    runHook postInstall
-  '';
-
-  meta = {
-    homepage = "http://xpra.org/";
-    description = "fakeXinerama for Xpra";
-    platforms = lib.platforms.linux;
-    maintainers = [ lib.maintainers.nickcao ];
-    license = lib.licenses.mit;
-  };
-}
diff --git a/pkgs/tools/X11/xpra/nvenc.pc b/pkgs/tools/X11/xpra/nvenc.pc
deleted file mode 100644
index 6d8d916a0251..000000000000
--- a/pkgs/tools/X11/xpra/nvenc.pc
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@out@
-includedir=${prefix}/include
-libdir=@nvidia_x11@/lib
-
-Name: nvenc
-Description: NVENC
-Version: 10
-Requires:
-Conflicts:
-Libs: -L${libdir} -lnvidia-encode
-Cflags: -I${includedir}
diff --git a/pkgs/tools/X11/xpra/update.sh b/pkgs/tools/X11/xpra/update.sh
deleted file mode 100755
index c1b408a0beef..000000000000
--- a/pkgs/tools/X11/xpra/update.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env nix-shell
-#!nix-shell -i bash -p curl perl common-updater-scripts
-
-version=$(curl https://xpra.org/src/ | perl -ne 'print "$1\n" if /xpra-([[:digit:].]+)\./' | sort -V | tail -n1)
-update-source-version xpra "$version"