diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix index 688c0e12d938..a18ee18668b7 100644 --- a/pkgs/tools/X11/xpra/default.nix +++ b/pkgs/tools/X11/xpra/default.nix @@ -1,15 +1,17 @@ { stdenv, fetchurl, buildPythonPackage , python, cython, pkgconfig , xorg, gtk, glib, pango, cairo, gdk_pixbuf, pygtk, atk, pygobject, pycairo -, ffmpeg, x264, libvpx, pil, libwebp }: +, makeWrapper, xkbcomp, xorgserver, getopt, xauth, utillinux, which, fontsConf, xkeyboard_config +, ffmpeg, x264, libvpx, pil, libwebp +, libfakeXinerama }: buildPythonPackage rec { - name = "xpra-0.11.6"; + name = "xpra-0.14.19"; namePrefix = ""; src = fetchurl { - url = "http://xpra.org/src/${name}.tar.bz2"; - sha256 = "0n3lr8nrfmrll83lgi1nzalng902wv0dcmcyx4awnman848dxij0"; + url = "https://www.xpra.org/src/${name}.tar.xz"; + sha256 = "0jifaysz4br1v0zibnzgd0k02rgybbsysvwrgbar1452sjb3db5m"; }; buildInputs = [ @@ -18,25 +20,27 @@ buildPythonPackage rec { xorg.libX11 xorg.renderproto xorg.libXrender xorg.libXi xorg.inputproto xorg.kbproto xorg.randrproto xorg.damageproto xorg.compositeproto xorg.xextproto xorg.recordproto xorg.xproto xorg.fixesproto xorg.libXtst xorg.libXfixes xorg.libXcomposite xorg.libXdamage - xorg.libXrandr + xorg.libXrandr xorg.libxkbfile pango cairo gdk_pixbuf atk gtk glib ffmpeg libvpx x264 libwebp + + makeWrapper ]; propagatedBuildInputs = [ pil pygtk pygobject ]; - # Even after i tried monkey patching, their tests just fail, looks like - # they don't have automated testing out of the box? http://xpra.org/trac/ticket/177 - doCheck = false; + postPatch = '' + sed -i 's|DEFAULT_XVFB_COMMAND = "Xvfb|DEFAULT_XVFB_COMMAND = "Xvfb -xkbdir ${xkeyboard_config}/etc/X11/xkb|' xpra/platform/features.py + ''; preBuild = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0) $(pkg-config --cflags pygtk-2.0) $(pkg-config --cflags xtst)" ''; - setupPyBuildFlags = ["--enable-Xdummy"]; + setupPyBuildFlags = ["--with-Xdummy"]; preInstall = '' # see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix @@ -44,9 +48,26 @@ buildPythonPackage rec { sed -i '/ = data_files/d' setup.py ''; + postInstall = '' + wrapProgram $out/bin/xpra \ + --set XKB_BINDIR "${xkbcomp}/bin" \ + --set FONTCONFIG_FILE "${fontsConf}" \ + --prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib \ + --prefix PATH : ${getopt}/bin:${xorgserver}/bin:${xauth}/bin:${which}/bin:${utillinux}/bin + ''; + + #TODO: replace postInstall with postFixup to avoid double wrapping of xpra; needs more work though + #postFixup = '' + # sed -i '2iexport XKB_BINDIR="${xkbcomp}/bin"' $out/bin/xpra + # sed -i '3iexport FONTCONFIG_FILE="${fontsConf}"' $out/bin/xpra + # sed -i '4iexport PATH=${getopt}/bin:${xorgserver}/bin:${xauth}/bin:${which}/bin:${utillinux}/bin\${PATH:+:}\$PATH' $out/bin/xpra + #''; + + meta = { homepage = http://xpra.org/; description = "Persistent remote applications for X"; platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ tstrobel ]; }; } diff --git a/pkgs/tools/X11/xpra/gtk3.nix b/pkgs/tools/X11/xpra/gtk3.nix new file mode 100644 index 000000000000..04bcd1195147 --- /dev/null +++ b/pkgs/tools/X11/xpra/gtk3.nix @@ -0,0 +1,73 @@ +{ stdenv, fetchurl, buildPythonPackage +, python, cython, pkgconfig +, xorg, gtk3, glib, pango, cairo, gdk_pixbuf, atk, pygobject3, pycairo, gobjectIntrospection +, makeWrapper, xkbcomp, xorgserver, getopt, xauth, utillinux, which, fontsConf, xkeyboard_config +, ffmpeg, x264, libvpx, libwebp +, libfakeXinerama }: + +buildPythonPackage rec { + name = "xpra-0.14.19"; + namePrefix = ""; + + src = fetchurl { + url = "https://www.xpra.org/src/${name}.tar.xz"; + sha256 = "0jifaysz4br1v0zibnzgd0k02rgybbsysvwrgbar1452sjb3db5m"; + }; + + buildInputs = [ + pkgconfig + + xorg.libX11 xorg.renderproto xorg.libXrender xorg.libXi xorg.inputproto xorg.kbproto + xorg.randrproto xorg.damageproto xorg.compositeproto xorg.xextproto xorg.recordproto + xorg.xproto xorg.fixesproto xorg.libXtst xorg.libXfixes xorg.libXcomposite xorg.libXdamage + xorg.libXrandr xorg.libxkbfile + + pango cairo gdk_pixbuf atk gtk3 glib gobjectIntrospection + + ffmpeg libvpx x264 libwebp + + makeWrapper + ]; + + propagatedBuildInputs = [ + pygobject3 pycairo cython + ]; + + postPatch = '' + sed -i 's|DEFAULT_XVFB_COMMAND = "Xvfb|DEFAULT_XVFB_COMMAND = "Xvfb -xkbdir ${xkeyboard_config}/etc/X11/xkb|' xpra/platform/features.py + ''; + + preBuild = '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-3.0) $(pkg-config --cflags xtst)" + ''; + setupPyBuildFlags = [ "--with-gtk3" "--without-gtk2" "--with-Xdummy" ]; + + + preInstall = '' + # see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix + ${python}/bin/${python.executable} setup.py install_data --install-dir=$out --root=$out + sed -i '/ = data_files/d' setup.py + ''; + + postInstall = '' + wrapProgram $out/bin/xpra \ + --set XKB_BINDIR "${xkbcomp}/bin" \ + --set FONTCONFIG_FILE "${fontsConf}" \ + --prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib \ + --prefix PATH : ${getopt}/bin:${xorgserver}/bin:${xauth}/bin:${which}/bin:${utillinux}/bin + ''; + + #TODO: replace postInstall with postFixup to avoid double wrapping of xpra; needs more work though + #postFixup = '' + # sed -i '2iexport XKB_BINDIR="${xkbcomp}/bin"' $out/bin/xpra + # sed -i '3iexport FONTCONFIG_FILE="${fontsConf}"' $out/bin/xpra + # sed -i '4iexport PATH=${getopt}/bin:${xorgserver}/bin:${xauth}/bin:${which}/bin:${utillinux}/bin\${PATH:+:}\$PATH' $out/bin/xpra + #''; + + + meta = { + homepage = http://xpra.org/; + description = "Persistent remote applications for X"; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/tools/X11/xpra/libfakeXinerama.nix b/pkgs/tools/X11/xpra/libfakeXinerama.nix new file mode 100644 index 000000000000..4ca509f8b936 --- /dev/null +++ b/pkgs/tools/X11/xpra/libfakeXinerama.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, libX11, libXinerama }: + +stdenv.mkDerivation rec { + name = "libfakeXinerama-${version}"; + version = "0.1.0"; + + src = fetchurl { + url = "https://www.xpra.org/src/${name}.tar.bz2"; + sha256 = "0gxb8jska2anbb3c1m8asbglgnwylgdr44x9lr8yh91hjxsqadkx"; + }; + + buildInputs = [ libX11 libXinerama ]; + + phases = [ "unpackPhase" "buildPhase" "installPhase" ]; + + buildPhase = '' + gcc -O2 -Wall fakeXinerama.c -fPIC -o libfakeXinerama.so.1.0 -shared + ''; + + installPhase = '' + mkdir -p $out/lib + cp libfakeXinerama.so.1.0 $out/lib + ln -s libXinerama.so.1.0 $out/lib/libXinerama.so.1 + ln -s libXinerama.so.1 $out/lib/libXinerama.so + ''; + + meta = { + homepage = http://xpra.org/; + description = "fakeXinerama for Xpra"; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ tstrobel ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4dea95572d6e..c0e75a7cde2b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12078,7 +12078,10 @@ let libxpdf = callPackage ../applications/misc/xpdf/libxpdf.nix { }; - xpra = callPackage ../tools/X11/xpra { }; + xpra = callPackage ../tools/X11/xpra { inherit (texFunctions) fontsConf; }; + libfakeXinerama = callPackage ../tools/X11/xpra/libfakeXinerama.nix { inherit (xlibs) libXinerama; }; + #TODO: 'pil' is not available for python3, yet + xpraGtk3 = callPackage ../tools/X11/xpra/gtk3.nix { inherit (texFunctions) fontsConf; inherit (python3Packages) buildPythonPackage python cython pygobject3 pycairo; }; xrestop = callPackage ../tools/X11/xrestop { };