Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] py2->3 fixes
Date: Tue, 10 Oct 2023 01:36:19 +0200	[thread overview]
Message-ID: <20231009233619.40uQCSU3UHSy0LJC-lnMZ03cu1NrMDlcsXuCHPWjlLQ@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-46515@inbox.vuxu.org>

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

There is an updated 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: 28146 bytes --]

From 4f5176021b8b464c773a1b597d1b15c7e4d1c8a6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 04:38:21 -0400
Subject: [PATCH 01/10] 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 18989597cc92c6a68eaf6ca20dccf26305a42865 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 04:51:37 -0400
Subject: [PATCH 02/10] 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 4814ee7adfa54410058661c56d59b1570271c8be Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 15:26:01 -0400
Subject: [PATCH 03/10] eclipse: works on python3

---
 srcpkgs/eclipse/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/eclipse/template b/srcpkgs/eclipse/template
index 4108117dabc67..f1b9064b58920 100644
--- a/srcpkgs/eclipse/template
+++ b/srcpkgs/eclipse/template
@@ -1,7 +1,7 @@
 # Template file for 'eclipse'
 pkgname=eclipse
 version=4.28
-revision=1
+revision=2
 #code name of version
 _release=2023-06
 archs="x86_64"
@@ -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 9cbf386ed2b67e8d01da487b9279dc6dfe2d6a14 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 6 Oct 2023 16:58:44 -0400
Subject: [PATCH 04/10] 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 cb322df764eb8a2f1e88f373a7d229df359d0a5e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 6 Oct 2023 17:12:55 -0400
Subject: [PATCH 05/10] 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"

From db3385604c9b2d51166ee70774b4a8816316d63e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 21:49:23 -0400
Subject: [PATCH 06/10] tvheadend: compatible with python3

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

diff --git a/srcpkgs/tvheadend/template b/srcpkgs/tvheadend/template
index a2004480332b2..9aea7de4ec705 100644
--- a/srcpkgs/tvheadend/template
+++ b/srcpkgs/tvheadend/template
@@ -7,7 +7,7 @@ configure_args="--enable-dvbscan --disable-ffmpeg_static
 --disable-hdhomerun_static --disable-bintray_cache --disable-libx264_static
 --disable-libx265_static --disable-libvpx_static --disable-libtheora_static
 --disable-libvorbis_static --disable-libfdkaac_static"
-hostmakedepends="gettext pkg-config python git which"
+hostmakedepends="gettext pkg-config python3 git which"
 makedepends="avahi-libs-devel openssl-devel zlib-devel libcurl-devel ffmpeg-devel"
 short_desc="TV streaming server"
 maintainer="lemmi <lemmi@nerd2nerd.org>"

From 77bb258370b36cf30d59a97e6a012d44c306379d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 7 Oct 2023 21:58:02 -0400
Subject: [PATCH 07/10] skktools: patch for python3

---
 srcpkgs/skktools/patches/python3.patch | 131 +++++++++++++++++++++++++
 srcpkgs/skktools/template              |   4 +-
 2 files changed, 133 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/skktools/patches/python3.patch

diff --git a/srcpkgs/skktools/patches/python3.patch b/srcpkgs/skktools/patches/python3.patch
new file mode 100644
index 0000000000000..efd52da4af257
--- /dev/null
+++ b/srcpkgs/skktools/patches/python3.patch
@@ -0,0 +1,131 @@
+--- a/skk2cdb.py
++++ b/skk2cdb.py
+@@ -16,11 +16,12 @@
+ import sys, os
+ from struct import pack, unpack
+ from array import array
++from functools import reduce
+ 
+ 
+ # calc hash value with a given key
+-def cdbhash(s, n=0L):
+-  return reduce(lambda h,c: ((h*33) ^ ord(c)) & 0xffffffffL, s, n+5381L)
++def cdbhash(s, n=0):
++  return reduce(lambda h,c: ((h*33) ^ ord(c)) & 0xffffffff, s, n+5381)
+ 
+ if pack('=i',1) == pack('>i',1):
+   # big endian
+@@ -62,9 +63,9 @@
+   
+   def __init__(self, cdbname, docache=1):
+     self.name = cdbname
+-    self._fp = file(cdbname, 'rb')
++    self._fp = open(cdbname, 'rb')
+     hash0 = decode(self._fp.read(2048))
+-    self._hash0 = [ (hash0[i], hash0[i+1]) for i in xrange(0, 512, 2) ]
++    self._hash0 = [ (hash0[i], hash0[i+1]) for i in range(0, 512, 2) ]
+     self._hash1 = [ None ] * 256
+     (self._eod,_) = self._hash0[0]
+     self._docache = docache
+@@ -93,7 +94,7 @@
+       self._hash1[h1] = hs
+     i = ((h >> 8) % ncells) * 2
+     n = ncells*2
+-    for _ in xrange(ncells):
++    for _ in range(ncells):
+       p1 = hs[i+1]
+       if p1 == 0: raise KeyError(k)
+       if hs[i] == h:
+@@ -122,7 +123,7 @@
+       return False
+ 
+   def __contains__(self, k):
+-    return self.has_key(k)
++    return k in self
+ 
+   def firstkey(self):
+     self._keyiter = None
+@@ -132,7 +133,7 @@
+     if not self._keyiter:
+       self._keyiter = ( k for (k,v) in cdbiter(self._fp, self._eod) )
+     try:
+-      return self._keyiter.next()
++      return next(self._keyiter)
+     except StopIteration:
+       return None
+ 
+@@ -140,7 +141,7 @@
+     if not self._eachiter:
+       self._eachiter = cdbiter(self._fp, self._eod)
+     try:
+-      return self._eachiter.next()
++      return next(self._eachiter)
+     except StopIteration:
+       return None
+   
+@@ -159,9 +160,9 @@
+     self.fn = cdbname
+     self.fntmp = tmpname
+     self.numentries = 0
+-    self._fp = file(tmpname, 'wb')
++    self._fp = open(tmpname, 'wb')
+     self._pos = 2048                    # sizeof((h,p))*256
+-    self._bucket = [ array('I') for _ in xrange(256) ]
++    self._bucket = [ array('I') for _ in range(256) ]
+     return
+ 
+   def __len__(self):
+@@ -197,7 +198,7 @@
+       if not b1: continue
+       blen = len(b1)
+       a = array('I', [0]*blen*2)
+-      for j in xrange(0, blen, 2):
++      for j in range(0, blen, 2):
+         (h,p) = (b1[j],b1[j+1])
+         i = ((h >> 8) % blen)*2
+         while a[i+1]:             # is cell[i] already occupied?
+@@ -238,7 +239,7 @@
+ 
+ # cdbdump
+ def cdbdump(cdbname):
+-  fp = file(cdbname, 'rb')
++  fp = open(cdbname, 'rb')
+   (eor,) = unpack('<I', fp.read(4))
+   return cdbiter(fp, eor)
+ 
+@@ -248,7 +249,7 @@
+   q = []
+   for it in iters:
+     try:
+-      q.append((it.next(),it))
++      q.append((next(it),it))
+     except StopIteration:
+       pass
+   k0 = None
+@@ -262,7 +263,7 @@
+     vs.append(v)
+     k0 = k
+     try:
+-      q.append((it.next(),it))
++      q.append((next(it),it))
+     except StopIteration:
+       continue
+   if vs: yield (k0,vs)
+@@ -280,7 +281,7 @@
+   import fileinput
+   import os.path
+   def usage():
+-    print 'usage: %s [-f] outfile [infile ...]' % argv[0]
++    print('usage: %s [-f] outfile [infile ...]' % argv[0])
+     return 100
+   try:
+     (opts, args) = getopt.getopt(argv[1:], 'dfo:')
+@@ -292,7 +293,7 @@
+   if not args: return usage()
+   outfile = args.pop(0)
+   if not force and os.path.exists(outfile):
+-    print >>sys.stderr, 'file exists: %r' % outfile
++    print('file exists: %r' % outfile, file=sys.stderr)
+     return 1
+   #
+   maker = CDBMaker(outfile, outfile+'.tmp')
diff --git a/srcpkgs/skktools/template b/srcpkgs/skktools/template
index 4c1ddda99c00e..3cfa8fe3168c5 100644
--- a/srcpkgs/skktools/template
+++ b/srcpkgs/skktools/template
@@ -1,7 +1,7 @@
 # Template file for 'skktools'
 pkgname=skktools
 version=1.3.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-gdbm"
 hostmakedepends="pkg-config glib-devel"
@@ -12,7 +12,7 @@ license="GPL-2.0-or-later"
 homepage="http://openlab.ring.gr.jp/skk/"
 distfiles="http://openlab.ring.gr.jp/skk/tools/${pkgname}-${version}.tar.gz"
 checksum=84cc5d3344362372e0dfe93a84790a193d93730178401a96248961ef161f2168
-python_version=2 #unverified
+python_version=3
 
 post_install() {
 	vmkdir usr/share/${pkgname}

From a04191c68535495cb510fe078cf4e4ca2441624a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sun, 8 Oct 2023 02:03:37 -0400
Subject: [PATCH 08/10] tacacs: convert script to python3

---
 srcpkgs/tacacs/patches/python3.patch | 98 ++++++++++++++++++++++++++++
 srcpkgs/tacacs/template              |  6 +-
 2 files changed, 101 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tacacs/patches/python3.patch

diff --git a/srcpkgs/tacacs/patches/python3.patch b/srcpkgs/tacacs/patches/python3.patch
new file mode 100644
index 0000000000000..c8183d69a8b3e
--- /dev/null
+++ b/srcpkgs/tacacs/patches/python3.patch
@@ -0,0 +1,98 @@
+--- a/do_auth.py
++++ b/do_auth.py
+@@ -211,7 +211,7 @@
+ Written by Dan Schmidt - Please visit tacacs.org to check for updates.
+ '''
+ 
+-import sys,re,getopt,ConfigParser
++import sys,re,getopt,configparser
+ from time import strftime
+ 
+ # I really don't want to deal with these exceptions more than once
+@@ -230,23 +230,23 @@
+     #Should not have any exceptions - BUT, just in case
+     try:
+         attributes = config.get(the_section, the_option)
+-    except ConfigParser.NoSectionError:
++    except configparser.NoSectionError:
+         log_file.write(strftime("%Y-%m-%d %H:%M:%S: ")
+                 + "Error: Section '%s' Doesn't Exist!\n" 
+                 % (the_section))
+         sys.exit(1)
+-    except ConfigParser.DuplicateSectionError:
++    except configparser.DuplicateSectionError:
+         log_file.write(strftime("%Y-%m-%d %H:%M:%S: ")
+                 + "Error: Duplicate section '%s'\n" 
+                 % (the_section))
+         sys.exit(1)
+-    except ConfigParser.NoOptionError:
++    except configparser.NoOptionError:
+         log_file.write(strftime("%Y-%m-%d %H:%M:%S: ")
+                     + "Error: '%s' not found in section '%s\n'" 
+                      % (the_option, the_section))
+         sys.exit(1)
+     #To do: finish exceptions. 
+-    except ConfigParser.ParsingError:
++    except configparser.ParsingError:
+         log_file.write(strftime("%Y-%m-%d %H:%M:%S: ")
+                 + "Error: Can't parse file '%s'! (You got me)\n" 
+              % (filename))
+@@ -298,9 +298,9 @@
+     argv = sys.argv
+     try:
+         optlist, args = getopt.getopt(sys.argv[1:], 'i:u:f:l:d:?:D', ['fix_crs_bug','?', '-?', 'help', 'Help'])
+-    except getopt.GetoptError, err:
+-        print str(err) 
+-        print __doc__
++    except getopt.GetoptError as err:
++        print(str(err)) 
++        print(__doc__)
+         sys.exit(1)
+     for (i, j) in optlist:
+         if i == '-i':
+@@ -314,15 +314,15 @@
+         elif i == '-d':
+             device = j
+         elif i in ('?', '-?', 'help', 'Help'):
+-            print __doc__
++            print(__doc__)
+             sys.exit(1)
+         elif i == '-D':
+             is_debug = True
+         else:
+-            print 'Unknown option:', i
++            print('Unknown option:', i)
+             sys.exit(1)
+     if len(argv) < 7:
+-        print __doc__
++        print(__doc__)
+         sys.exit(1)
+     log_file = open (log_name, "a")
+ #DEBUG!  We at least got CALLED
+@@ -384,7 +384,7 @@
+         log_file.write(strftime("%Y-%m-%d %H:%M:%S: ")
+                 + "Error: No username entered!\n")
+         sys.exit(1)
+-    config = ConfigParser.SafeConfigParser()
++    config = configparser.SafeConfigParser()
+     if not (filename in config.read(filename)):
+         log_file.write(strftime("%Y-%m-%d %H:%M:%S: ")
+                 + "Error: Can't open/parse '%s'\n" 
+@@ -491,7 +491,7 @@
+                     for item in return_pairs:
+                         #DEBUG
+                         # log_file.write("Returning:%s\n" % item.strip())
+-                        print item.strip('\n')
++                        print(item.strip('\n'))
+                     if want_tac_pairs:
+                         #DEBUG
+                         # log_file.write("Exiting status 2\n")
+@@ -507,7 +507,7 @@
+             for item in return_pairs:
+                 #DEBUG
+                 # log_file.write("Returning:%s\n" % item.strip())
+-                print item.strip('\n')
++                print(item.strip('\n'))
+             log_file.write(strftime("%Y-%m-%d %H:%M:%S: ")
+                  + "User '%s' granted access to device '%s' in group '%s' from '%s'\n"
+                  % (user_name, device, this_group, ip_addr))
diff --git a/srcpkgs/tacacs/template b/srcpkgs/tacacs/template
index 1cb4f17935297..179fc1fa161ee 100644
--- a/srcpkgs/tacacs/template
+++ b/srcpkgs/tacacs/template
@@ -1,7 +1,7 @@
 # Template file for 'tacacs'
 pkgname=tacacs
 version=4.0.4.28
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--with-libwrap=no"
 hostmakedepends="flex perl"
@@ -10,9 +10,9 @@ short_desc="Modified version of Cisco's tacacs+ (tac_plus) developer's kit"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Cisco"
 homepage="http://www.shrubbery.net/tac_plus/"
-distfiles="ftp://ftp.shrubbery.net/pub/tac_plus/$pkgname-F$version.tar.gz"
+distfiles="ftp://ftp.shrubbery.net/pub/tac_plus/tacacs-F$version.tar.gz"
 checksum=147f2dc98d26d2f93f0aba76c988ced196ffe1c001dc2e91f788a1a2c747219e
-python_version=2
+python_version=3
 disable_parallel_build=yes
 
 pre_configure() {

From 38daeb0c63179d1b712bc322ebb8a2ca049c9e03 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sun, 8 Oct 2023 02:43:33 -0400
Subject: [PATCH 09/10] vdrift: remove sconscript files

---
 srcpkgs/vdrift/template | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/vdrift/template b/srcpkgs/vdrift/template
index 643cb08847d19..90b702affecbc 100644
--- a/srcpkgs/vdrift/template
+++ b/srcpkgs/vdrift/template
@@ -1,7 +1,7 @@
 # Template file for 'vdrift'
 pkgname=vdrift
 version=2014.10.20
-revision=11
+revision=12
 build_style=scons
 scons_use_destdir=yes
 make_build_args="release=1 force_feedback=1 extbullet=1 datadir=share/${pkgname}"
@@ -16,7 +16,7 @@ license="GPL-3.0-or-later"
 homepage="http://vdrift.net/"
 distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version//./-}.tar.bz2"
 checksum=458d45d59075c2ce943ec6bc271a5bd0eb6bc6ed123670b65038703345020be3
-python_version=2
+python_version=3
 
 post_install() {
 	# install .desktop file
@@ -31,6 +31,9 @@ post_install() {
 	done
 	vinstall data/textures/icons/vdrift-64x64.png 644 \
 		usr/share/pixmaps vdrift.png
+
+	# remove unnecessary build system files
+	find "${DESTDIR}"/usr/share/vdrift -name '*SConscript*' -delete
 }
 
 vdrift-data_package() {

From c29734098aaca82fcbf092a399ca624d82bbd384 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sun, 8 Oct 2023 03:37:04 -0400
Subject: [PATCH 10/10] flightgear: patch for python3

---
 srcpkgs/flightgear/template | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/flightgear/template b/srcpkgs/flightgear/template
index 9715c576d4e6c..6f4f9ffdfb75b 100644
--- a/srcpkgs/flightgear/template
+++ b/srcpkgs/flightgear/template
@@ -1,7 +1,7 @@
 # Template file for 'flightgear'
 pkgname=flightgear
 version=2020.3.17
-revision=2
+revision=3
 # XXX: always keep in sync with simgear version!
 create_wrksrc=yes
 build_style=cmake
@@ -26,7 +26,6 @@ distfiles="
  $SOURCEFORGE_SITE/project/flightgear/release-${version%.*}/FlightGear-${version}-data.txz"
 checksum="6670dedeaca2683aca77f9f06bf9d1d8062ae32a2a5459dddc8aa0989c5f1854
  2a5eba2b9ae67a3691285833a6ce3f6bbdf3f20229f5871d7c940e151d54d8e8"
-python_version=2
 # the test suite doesn't get built, if enabled it segfaults
 make_check=no
 
@@ -48,5 +47,8 @@ flightgear-data_package() {
 	pkg_install() {
 		vmkdir usr/share/flightgear
 		mv fgdata ${PKGDESTDIR}/usr/share/flightgear
+		# python 2 build scripts
+		rm "${PKGDESTDIR}"/usr/share/flightgear/fgdata/Aircraft/c172p/Models/Interior/Panel/Instruments/asi/asi.py \
+			"${PKGDESTDIR}"/usr/share/flightgear/fgdata/Docs/compile_docs.py
 	}
 }

  parent reply	other threads:[~2023-10-09 23:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08  1:36 [PR PATCH] " 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 [this message]
2023-10-10  1:39 ` classabbyamp
2023-10-10  1:41 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231009233619.40uQCSU3UHSy0LJC-lnMZ03cu1NrMDlcsXuCHPWjlLQ@z \
    --to=classabbyamp@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).