Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] py2->3 fixes
@ 2023-10-08  1:36 classabbyamp
  2023-10-08  1:58 ` [PR PATCH] [Updated] " classabbyamp
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: classabbyamp @ 2023-10-08  1:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages py2
https://github.com/void-linux/void-packages/pull/46515

py2->3 fixes
[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/46515.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-py2-46515.patch --]
[-- Type: text/x-diff, Size: 13856 bytes --]

From d6f9d04eda8f5220ae4f733c94a784a1ec5fcd57 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 04:38:21 -0400
Subject: [PATCH 1/5] gtksourceview2: patch for python3

---
 srcpkgs/gtksourceview2/patches/python3.patch | 59 ++++++++++++++++++++
 srcpkgs/gtksourceview2/template              |  5 +-
 2 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/gtksourceview2/patches/python3.patch

diff --git a/srcpkgs/gtksourceview2/patches/python3.patch b/srcpkgs/gtksourceview2/patches/python3.patch
new file mode 100644
index 0000000000000..0a05b38556d66
--- /dev/null
+++ b/srcpkgs/gtksourceview2/patches/python3.patch
@@ -0,0 +1,59 @@
+--- a/gtksourceview/language-specs/convert.py
++++ b/gtksourceview/language-specs/convert.py
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env python
+ 
+ import xml.dom.minidom as dom
+-import cgi
++import html
+ 
+ default_styles = {
+     'Comment' : 'def:comment',
+@@ -29,7 +29,7 @@
+     raise RuntimeError("don't know how to escape '%s'" % (ch,))
+ 
+ def escape_regex(s):
+-    return cgi.escape(s)
++    return html.escape(s)
+ 
+ def normalize_id(id):
+     if id == "C#":
+@@ -91,9 +91,9 @@
+         if self.mimetypes or self.globs:
+             string += indent + '<metadata>\n'
+             if self.mimetypes:
+-                string += 2*indent + '<property name="mimetypes">%s</property>\n' % (cgi.escape(self.mimetypes),)
++                string += 2*indent + '<property name="mimetypes">%s</property>\n' % (html.escape(self.mimetypes),)
+             if self.globs:
+-                string += 2*indent + '<property name="globs">%s</property>\n' % (cgi.escape(self.globs),)
++                string += 2*indent + '<property name="globs">%s</property>\n' % (html.escape(self.globs),)
+             string += indent + '</metadata>\n\n'
+ 
+         return string
+@@ -175,7 +175,7 @@
+         self.is_container = False
+ 
+     def format(self, indent, esc_ctx, line_esc_ctx):
+-        print "Implement me: %s.format()" % (type(self).__name__,)
++        print("Implement me: %s.format()" % (type(self).__name__,))
+         return indent*2 + '<context id="%s"/>\n' % (self.id)
+ 
+     def format_escape(self, indent, esc_ctx, line_esc_ctx):
+@@ -472,7 +472,7 @@
+     elif cur.tagName == "syntax-item":
+         ctx = parseSyntaxItem(cur, name, _name, style)
+     else:
+-        print "Unknown tag: %s" % (cur.tagName,)
++        print("Unknown tag: %s" % (cur.tagName,))
+         ctx = None
+ 
+     return ctx
+@@ -510,7 +510,7 @@
+     import sys
+ 
+     if not sys.argv[1:]:
+-        print "usage: %s LANG_FILE" % (sys.argv[0])
++        print("usage: %s LANG_FILE" % (sys.argv[0]))
+         sys.exit(1)
+ 
+     lang_file = parse_file(sys.argv[1])
diff --git a/srcpkgs/gtksourceview2/template b/srcpkgs/gtksourceview2/template
index 1ffb434669413..09d1301526530 100644
--- a/srcpkgs/gtksourceview2/template
+++ b/srcpkgs/gtksourceview2/template
@@ -1,7 +1,7 @@
 # Template file for 'gtksourceview2'
 pkgname=gtksourceview2
 version=2.10.5
-revision=7
+revision=8
 build_style=gnu-configure
 configure_args="--disable-static"
 hostmakedepends="pkg-config intltool glib-devel"
@@ -12,8 +12,7 @@ license="GPL-2.0-or-later"
 homepage="http://www.gnome.org"
 distfiles="${GNOME_SITE}/gtksourceview/2.10/gtksourceview-${version}.tar.bz2"
 checksum=c585773743b1df8a04b1be7f7d90eecdf22681490d6810be54c81a7ae152191e
-# convert.py:178
-python_version=2
+python_version=3
 
 post_patch() {
 	vsed -i -e 's/DATADIRNAME=lib/DATADIRNAME=share/' configure

From dffae39d70ee2c7be09ffff9d69a658402599ec0 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 04:51:37 -0400
Subject: [PATCH 2/5] kcachegrind: patch for python3

---
 srcpkgs/kcachegrind/patches/python3.patch | 77 +++++++++++++++++++++++
 srcpkgs/kcachegrind/template              |  4 +-
 2 files changed, 79 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/kcachegrind/patches/python3.patch

diff --git a/srcpkgs/kcachegrind/patches/python3.patch b/srcpkgs/kcachegrind/patches/python3.patch
new file mode 100644
index 0000000000000..1d701ddf0321c
--- /dev/null
+++ b/srcpkgs/kcachegrind/patches/python3.patch
@@ -0,0 +1,77 @@
+--- a/converters/hotshot2calltree.in
++++ b/converters/hotshot2calltree.in
+@@ -147,8 +147,8 @@
+         if (file_limit > 0) and (filecount > file_limit):
+             break
+     
+-    print
+-    print "total_cost: % d Ticks",total_cost
++    print()
++    print("total_cost: % d Ticks",total_cost)
+     dumpResults(output, call_dict, total_cost, cost_per_pos, cost_per_function)
+ 
+ def convertHandleFilename(inputfilename, caller_stack, call_dict, cost_per_pos, cost_per_function, filecount):
+@@ -234,9 +234,9 @@
+             return_from_call(caller_stack, call_dict, total_cost)
+ 
+     except IOError:
+-        print "could not open inputfile '%s', ignore this." % inputfilename
+-    except EOFError, m:
+-        print "EOF: %s" % (m,)
++        print("could not open inputfile '%s', ignore this." % inputfilename)
++    except EOFError as m:
++        print("EOF: %s" % (m,))
+     return total_cost
+ 
+ def pretty_name(file, function):
+@@ -252,7 +252,7 @@
+         self.last_values = {}
+ 
+     def clearTag(self, tag):
+-        if self.last_values.has_key(tag):
++        if tag in self.last_values.keys():
+             del self.last_values[ tag ]
+     def clear(self):
+         self.last_values = {}
+@@ -316,16 +316,16 @@
+ def run_without_optparse():
+     """parse the options without optparse, use sys.argv"""
+     if  len(sys.argv) < 4 or sys.argv[1] != "-o" :
+-        print "usage: hotshot2cachegrind -o outputfile in1 [in2 [in3 [...]]]"
++        print("usage: hotshot2cachegrind -o outputfile in1 [in2 [in3 [...]]]")
+         return
+     outputfilename = sys.argv[2]
+     try:
+-        output = file(outputfilename, "w")
++        output = open(outputfilename, "w")
+         args = sys.argv[3:]
+         convertProfFiles(output, args)
+         output.close()
+     except IOError:
+-        print "could not open '%s' for writing." % outputfilename
++        print("could not open '%s' for writing." % outputfilename)
+ 
+ def run_with_optparse():
+     """parse the options with optparse"""
+@@ -346,10 +346,10 @@
+     file_limit = int(options.file_limit)
+     try:
+         if options.outputfilename and options.outputfilename != "-":
+-            output = file(options.outputfilename, "w")
++            output = open(options.outputfilename, "w")
+             close_output = 1
+     except IOError:
+-        print "could not open '%s' for writing." % options.outputfilename
++        print("could not open '%s' for writing." % options.outputfilename)
+     if output:
+         convertProfFiles(output, args)
+         if close_output:
+@@ -364,7 +364,7 @@
+         prof.runcall(run)
+         prof.close()
+     else:
+-        print "not profiling myself, since '%s' exists, running normal" % filename
++        print("not profiling myself, since '%s' exists, running normal" % filename)
+         run()
+ 
+ # check if optparse is available.
diff --git a/srcpkgs/kcachegrind/template b/srcpkgs/kcachegrind/template
index 0d812ba71f46a..6c295a6f5bf07 100644
--- a/srcpkgs/kcachegrind/template
+++ b/srcpkgs/kcachegrind/template
@@ -1,7 +1,7 @@
 # Template file for 'kcachegrind'
 pkgname=kcachegrind
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons kdoctools
  pkg-config qt5-host-tools qt5-qmake"
@@ -14,4 +14,4 @@ homepage="https://kde.org/applications/development/kcachegrind/"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kcachegrind"
 distfiles="${KDE_SITE}/release-service/${version}/src/kcachegrind-${version}.tar.xz"
 checksum=7c577d3d2e7115c1461ca50f1b128996719222a19d4d102376420dcc2b510781
-python_version=2
+python_version=3

From a39027e2e990743fd69dc9e32973e1361fbcd612 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 15:26:01 -0400
Subject: [PATCH 3/5] eclipse: works on python3

---
 srcpkgs/eclipse/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/eclipse/template b/srcpkgs/eclipse/template
index 4108117dabc67..56e8f67373236 100644
--- a/srcpkgs/eclipse/template
+++ b/srcpkgs/eclipse/template
@@ -19,7 +19,7 @@ _edition=java
 _mirror="http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse"
 distfiles="${_mirror}/technology/epp/downloads/release/${_release}/${_patch}/eclipse-${_edition}-${_release}-R-linux-gtk-x86_64.tar.gz"
 checksum=142e33831fbbe52f53255a746b35a038dff0366a04cb4d3be2d8fe0ce76f34e8
-python_version=2
+python_version=3
 
 do_install() {
 	vmkdir usr/lib/eclipse

From 5c0261d4654a2edcd6ea1ba86b0eb1fb87743489 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 6 Oct 2023 16:58:44 -0400
Subject: [PATCH 4/5] libdbusmenu-glib: work on python3

---
 .../libdbusmenu-glib/patches/python3.patch    | 60 +++++++++++++++++++
 srcpkgs/libdbusmenu-glib/template             |  3 +-
 2 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/libdbusmenu-glib/patches/python3.patch

diff --git a/srcpkgs/libdbusmenu-glib/patches/python3.patch b/srcpkgs/libdbusmenu-glib/patches/python3.patch
new file mode 100644
index 0000000000000..830a19005be58
--- /dev/null
+++ b/srcpkgs/libdbusmenu-glib/patches/python3.patch
@@ -0,0 +1,60 @@
+--- a/tools/dbusmenu-bench
++++ b/tools/dbusmenu-bench
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # encoding: utf-8
+ """
+ A library to communicate a menu object set accross DBus and
+@@ -61,7 +61,7 @@
+ 
+ def dump_properties(properties, prepend=""):
+     for key, value in properties.items():
+-        print "%s- %s: %s" % (prepend, key, value)
++        print("%s- %s: %s" % (prepend, key, value))
+ 
+ 
+ def run_test_sequence(menu, dump=False):
+@@ -74,9 +74,9 @@
+     revision, layout = menu.GetLayout(dbus.Int32(0))
+     times["GetLayout"] = chrono.elapsed()
+     if dump:
+-        print "revision:", revision
+-        print "layout:"
+-        print layout
++        print("revision:", revision)
++        print("layout:")
++        print(layout)
+ 
+     # Get ids
+     tree = ET.fromstring(layout)
+@@ -89,17 +89,17 @@
+     children = menu.GetChildren(dbus.Int32(root_id), property_names)
+     times["GetChildren"] = chrono.elapsed()
+     if dump:
+-        print "children:"
++        print("children:")
+         for child in children:
+             id, properties = child
+-            print "- %d:" % id
++            print("- %d:" % id)
+             dump_properties(properties, prepend=" ")
+ 
+     chrono.restart()
+     properties = menu.GetProperties(dbus.Int32(child_id), property_names)
+     times["GetProperties"] = chrono.elapsed()
+     if dump:
+-        print "properties:"
++        print("properties:")
+         dump_properties(properties)
+ 
+     return times
+@@ -109,7 +109,7 @@
+ 
+ def print_probe(prefix, name, value, timestamp):
+     value = int(value * 1000000)
+-    print "%(prefix)s.%(name)s:%(value)d@%(timestamp)d" % locals()
++    print("%(prefix)s.%(name)s:%(value)d@%(timestamp)d" % locals())
+ 
+ def main():
+     parser = OptionParser(usage = "%prog [options]")
diff --git a/srcpkgs/libdbusmenu-glib/template b/srcpkgs/libdbusmenu-glib/template
index 8981401214cba..26c7d3f201f94 100644
--- a/srcpkgs/libdbusmenu-glib/template
+++ b/srcpkgs/libdbusmenu-glib/template
@@ -1,7 +1,7 @@
 # Template file for 'libdbusmenu-glib'
 pkgname=libdbusmenu-glib
 version=16.04.0
-revision=5
+revision=6
 build_style=gnu-configure
 build_helper="gir"
 configure_args="--disable-dumper --disable-static --disable-tests
@@ -15,7 +15,6 @@ license="GPL-3, LGPL-2.1, LGPL-3"
 homepage="https://launchpad.net/libdbusmenu"
 distfiles="${homepage}/${version%.*}/${version}/+download/libdbusmenu-${version}.tar.gz"
 checksum=b9cc4a2acd74509435892823607d966d424bd9ad5d0b00938f27240a1bfa878a
-python_version=2 #unverified
 
 build_options="gir"
 build_options_default="gir"

From 3ffb4baccc9ae3594ed29dc66006400928f29d4e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 6 Oct 2023 17:12:55 -0400
Subject: [PATCH 5/5] nitroshare: work on python3

---
 srcpkgs/nitroshare/patches/python3.patch | 13 +++++++++++++
 srcpkgs/nitroshare/template              |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/nitroshare/patches/python3.patch

diff --git a/srcpkgs/nitroshare/patches/python3.patch b/srcpkgs/nitroshare/patches/python3.patch
new file mode 100644
index 0000000000000..f30aaaca3d5c4
--- /dev/null
+++ b/srcpkgs/nitroshare/patches/python3.patch
@@ -0,0 +1,13 @@
+--- a/src/dist/nitroshare.py.in
++++ b/src/dist/nitroshare.py.in
+@@ -27,8 +27,8 @@
+ 
+ from json import loads
+ from os import path
+-from urllib import url2pathname
+-from urlparse import urlparse
++from urllib.request import url2pathname
++from urllib.parse import urlparse
+ 
+ import gi
+ gi.require_version('Gtk', '3.0')
diff --git a/srcpkgs/nitroshare/template b/srcpkgs/nitroshare/template
index 50f1a6f62a91c..0850074b28cfd 100644
--- a/srcpkgs/nitroshare/template
+++ b/srcpkgs/nitroshare/template
@@ -1,7 +1,7 @@
 # Template file for 'nitroshare'
 pkgname=nitroshare
 version=0.3.4
-revision=1
+revision=2
 build_style=cmake
 pycompile_dirs="usr/share/nautilus-python/extensions
  usr/share/nemo-python/extensions
@@ -15,7 +15,7 @@ license="MIT"
 homepage="http://nitroshare.net"
 distfiles="https://github.com/nitroshare/nitroshare-desktop/archive/${version}.tar.gz"
 checksum=29874e5909c29211a3c9e13f8c0f49b901ec2996e5d60d80af80d2fb80c3d7ec
-python_version=2 #unverified
+python_version=3
 
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" qt5-host-tools"

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-10-10  1:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-08  1:36 [PR PATCH] py2->3 fixes classabbyamp
2023-10-08  1:58 ` [PR PATCH] [Updated] " classabbyamp
2023-10-08  6:03 ` classabbyamp
2023-10-08  6:04 ` classabbyamp
2023-10-08  6:43 ` classabbyamp
2023-10-08  7:37 ` classabbyamp
2023-10-08 10:28 ` [PR REVIEW] " r-ricci
2023-10-08 10:30 ` r-ricci
2023-10-08 14:30 ` classabbyamp
2023-10-08 19:56 ` [PR PATCH] [Updated] " classabbyamp
2023-10-09 23:36 ` classabbyamp
2023-10-10  1:39 ` classabbyamp
2023-10-10  1:41 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).