aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-03-27 18:35:39 -0300
committerLeo <thinkabit.ukim@gmail.com>2020-03-28 09:42:10 +0000
commit6cac8ccac18985dd70c69118f500ac2306a1be56 (patch)
treeea93d2c7a8757240eac74f943b9ad8cfc0cb3e35
parentc1a6926484739c337a89489c34e4f63e365c375e (diff)
downloadaports-6cac8ccac18985dd70c69118f500ac2306a1be56.tar.gz
aports-6cac8ccac18985dd70c69118f500ac2306a1be56.tar.bz2
aports-6cac8ccac18985dd70c69118f500ac2306a1be56.tar.xz
main/xf86-video-qxl: use python3 with xspice
-rw-r--r--main/xf86-video-qxl/APKBUILD19
-rw-r--r--main/xf86-video-qxl/convert-xspice-python3.patch154
2 files changed, 163 insertions, 10 deletions
diff --git a/main/xf86-video-qxl/APKBUILD b/main/xf86-video-qxl/APKBUILD
index 6ce3409052..1924b85f6d 100644
--- a/main/xf86-video-qxl/APKBUILD
+++ b/main/xf86-video-qxl/APKBUILD
@@ -2,21 +2,20 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xf86-video-qxl
pkgver=0.1.5
-pkgrel=5
+pkgrel=6
pkgdesc="Xorg X11 qxl video driver"
+options="!check" # No testsuite
url="https://www.x.org"
arch="x86 x86_64"
license="MIT"
-depends=
-makedepends="xorg-server-dev spice-dev xorg-server python2 xorgproto"
-install=""
-source="https://www.x.org/releases/individual/driver/xf86-video-qxl-$pkgver.tar.bz2"
+makedepends="xorg-server-dev spice-dev xorg-server xorgproto libpciaccess-dev"
+source="https://www.x.org/releases/individual/driver/xf86-video-qxl-$pkgver.tar.bz2
+ convert-xspice-python3.patch
+ "
-builddir="$srcdir"/xf86-video-qxl-$pkgver
subpackages="$pkgname-doc xspice"
build() {
- cd "$builddir"
export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
./configure \
--build=$CBUILD \
@@ -31,13 +30,12 @@ build() {
}
package() {
- cd "$builddir"
make DESTDIR="$pkgdir" install
}
xspice() {
pkgdesc="X server that can be accessed by a Spice client"
- depends="python2"
+ depends="python3"
mkdir -p "$subpkgdir"/usr/lib/xorg/modules/drivers \
"$subpkgdir"/etc/X11
mv "$pkgdir"/usr/lib/xorg/modules/drivers/spiceqxl_drv.so \
@@ -47,4 +45,5 @@ xspice() {
"$subpkgdir"/etc/X11/spiceqxl.xorg.conf
}
-sha512sums="7510b2d037b3e978df6063b29e2406f3d1270695a239f29fdaec9b1dc65a30ab10cb959f15eb336f78e93aa708d41c64c5ea43803958feffc64542229605b782 xf86-video-qxl-0.1.5.tar.bz2"
+sha512sums="7510b2d037b3e978df6063b29e2406f3d1270695a239f29fdaec9b1dc65a30ab10cb959f15eb336f78e93aa708d41c64c5ea43803958feffc64542229605b782 xf86-video-qxl-0.1.5.tar.bz2
+ac2ba5a7878f97b77aba2912d617a43916ee0b94a6759119caee5c26a5ea15f0494a41a32feb3030e9187171a241dfd2c1b092eefdf7d83bde0aa1553312bf4e convert-xspice-python3.patch"
diff --git a/main/xf86-video-qxl/convert-xspice-python3.patch b/main/xf86-video-qxl/convert-xspice-python3.patch
new file mode 100644
index 0000000000..145d3e3029
--- /dev/null
+++ b/main/xf86-video-qxl/convert-xspice-python3.patch
@@ -0,0 +1,154 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Christophe Fergeau <cfergeau@redhat.com>
+Date: Wed, 8 Feb 2017 15:23:56 +0100
+Subject: [PATCH] Xspice: Use print("") instead of print ""
+
+This allows Xspice to run when using python3 instead of python2
+---
+ scripts/Xspice | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/scripts/Xspice b/scripts/Xspice
+index ada99d1..30d10fa 100755
+--- a/scripts/Xspice
++++ b/scripts/Xspice
+@@ -34,7 +34,7 @@ def which(x):
+ candidate = os.path.join(p, x)
+ if os.path.exists(candidate):
+ return candidate
+- print 'Warning: failed to find executable %s' % x
++ print('Warning: failed to find executable %s' % x)
+ return None
+
+ if 'XSPICE_ENABLE_GDB' in os.environ:
+@@ -128,10 +128,10 @@ args, xorg_args = parser.parse_known_args(sys.argv[1:])
+ def agents_new_enough(args):
+ for f in [args.vdagent_exec, args.vdagentd_exec]:
+ if not f:
+- print 'please specify path to vdagent/vdagentd executables'
++ print('please specify path to vdagent/vdagentd executables')
+ return False
+ if not os.path.exists(f):
+- print 'error: file not found ', f
++ print('error: file not found ', f)
+ return False
+
+ for f in [args.vdagent_exec, args.vdagentd_exec]:
+@@ -169,11 +169,11 @@ def tls_files(args):
+ # and it isn't supplied spice will still abort, and Xorg with it.
+ for key, filename in tls_files(args).items():
+ if not os.path.exists(filename):
+- print "missing %s - %s does not exist" % (key, filename)
++ print("missing %s - %s does not exist" % (key, filename))
+ sys.exit(1)
+
+ def error(msg, exit_code=1):
+- print "Xspice: %s" % msg
++ print("Xspice: %s" % msg)
+ sys.exit(exit_code)
+
+ if not args.xorg:
+@@ -319,7 +319,7 @@ for arg in xorg_args:
+ if arg.startswith(":"):
+ display = arg
+ if not display:
+- print "Error: missing display on line (i.e. :3)"
++ print("Error: missing display on line (i.e. :3)")
+ raise SystemExit
+ os.environ ['DISPLAY'] = display
+
+@@ -343,7 +343,7 @@ time.sleep(2)
+
+ retpid,rc = os.waitpid(xorg.pid, os.WNOHANG)
+ if retpid != 0:
+- print "Error: X server is not running"
++ print("Error: X server is not running")
+ else:
+ if args.vdagent_enabled and args.vdagent_launch:
+ # XXX use systemd --user for this?
+@@ -361,4 +361,4 @@ else:
+ xorg.wait()
+ except KeyboardInterrupt:
+ # Catch Ctrl-C as that is the common way of ending this script
+- print "Keyboard Interrupt"
++ print("Keyboard Interrupt")
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Christophe Fergeau <cfergeau@redhat.com>
+Date: Wed, 8 Feb 2017 17:07:39 +0100
+Subject: [PATCH] Xspice: Remove extra space before assignment
+
+---
+ scripts/Xspice | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/Xspice b/scripts/Xspice
+index 30d10fa..41fd80c 100755
+--- a/scripts/Xspice
++++ b/scripts/Xspice
+@@ -211,7 +211,7 @@ signal.signal(signal.SIGTERM, cleanup)
+ atexit.register(cleanup)
+
+ if args.auto:
+- temp_dir = tempfile.mkdtemp(prefix="Xspice-")
++ temp_dir = tempfile.mkdtemp(prefix="Xspice-")
+ cleanup_dirs.append(temp_dir)
+
+ args.config = temp_dir + "/xorg.conf"
+@@ -275,7 +275,7 @@ if args.vdagent_enabled:
+ os.unlink(f)
+
+ if not temp_dir:
+- temp_dir = tempfile.mkdtemp(prefix="Xspice-")
++ temp_dir = tempfile.mkdtemp(prefix="Xspice-")
+ cleanup_dirs.append(temp_dir)
+
+ # Auto generate temporary files for vdagent
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Christophe Fergeau <cfergeau@redhat.com>
+Date: Wed, 8 Feb 2017 17:07:56 +0100
+Subject: [PATCH] Xspice: Fix Python3 str() vs bytes() confusion
+
+With python3, without universal_newlines=True, Popen().stdout.read()
+will return a byte array, while find(str) expects to operate on a
+string.
+I've checked that this still works with python2 as well.
+---
+ scripts/Xspice | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/Xspice b/scripts/Xspice
+index 41fd80c..927dcb1 100755
+--- a/scripts/Xspice
++++ b/scripts/Xspice
+@@ -135,7 +135,7 @@ def agents_new_enough(args):
+ return False
+
+ for f in [args.vdagent_exec, args.vdagentd_exec]:
+- if Popen(args=[f, '-h'], stdout=PIPE).stdout.read().find('-S') == -1:
++ if Popen(args=[f, '-h'], stdout=PIPE, universal_newlines=True).stdout.read().find('-S') == -1:
+ return False
+ return True
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Christophe Fergeau <cfergeau@redhat.com>
+Date: Thu, 17 May 2018 15:31:05 +0200
+Subject: [PATCH] Xspice: Adjust shebang to explicitly mention python3
+
+---
+ scripts/Xspice | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/Xspice b/scripts/Xspice
+index 927dcb1..78d0794 100755
+--- a/scripts/Xspice
++++ b/scripts/Xspice
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+
+ """
+ Xspice
+
+