devel/py-p4python: Update to 2022.2.2425690

Remove BROKEN (this version is 7 years newer). Python 2 no longer
supported.

PR:		270704
Approved by:	antonfb@hesiod.org (maintainer)
This commit is contained in:
Craig Leres 2023-04-08 18:31:00 -07:00
parent c3c2129c94
commit 021ceba2e8
5 changed files with 67 additions and 81 deletions

View file

@ -1,19 +1,16 @@
PORTNAME= p4python PORTNAME= p4python
PORTVERSION= 2016.1.1447008 PORTVERSION= 2022.2.2425690
PORTREVISION= 2
CATEGORIES= devel python CATEGORIES= devel python
MASTER_SITES= PYPI MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= antonfb@hesiod.org MAINTAINER= antonfb@hesiod.org
COMMENT= Python bindings for the Perforce API COMMENT= Python bindings for the Perforce API
WWW= https://www.perforce.com/perforce/r14.2/manuals/p4script/python.programming.html WWW= https://www.perforce.com/manuals/p4python/Content/P4Python/Home-p4python.html
LICENSE= BSD2CLAUSE LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.txt LICENSE_FILE= ${WRKSRC}/LICENSE.txt
BROKEN_riscv64= fails to build: TypeError: can only concatenate str (not "NoneType") to str
BUILD_DEPENDS+= ${LOCALBASE}/lib/perforce/libclient.a:devel/p4api BUILD_DEPENDS+= ${LOCALBASE}/lib/perforce/libclient.a:devel/p4api
RUN_DEPENDS:= ${BUILD_DEPENDS} RUN_DEPENDS:= ${BUILD_DEPENDS}

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1517419395 TIMESTAMP = 1680624240
SHA256 (p4python-2016.1.1447008.tar.gz) = 1907f3c7ace54763651c1ccf20b92e6e9e72de58b240c591d6291ebb24ef0f1b SHA256 (p4python-2022.2.2425690.tar.gz) = 3d2a6135b7cc31226d71a056d14abe7b2e120e683e93a6187e651480d2ad64df
SIZE (p4python-2016.1.1447008.tar.gz) = 84231 SIZE (p4python-2022.2.2425690.tar.gz) = 83439

View file

@ -1,10 +0,0 @@
--- P4PythonDebug.cpp.orig 2023-04-01 20:37:16 UTC
+++ P4PythonDebug.cpp
@@ -29,6 +29,7 @@ $Id$
#include <Python.h>
#include <iostream>
+#include <stdhdrs.h>
#include <debug.h>
#include "P4PythonDebug.h"

View file

@ -1,73 +1,59 @@
--- setup.py.orig 2018-02-02 16:50:17 UTC --- setup.py.orig 2023-04-04 23:31:58 UTC
+++ setup.py +++ setup.py
@@ -102,7 +102,12 @@ class P4APIFtp: @@ -243,7 +243,7 @@ class p4build_ext(build_ext_module):
pathToFile = os.path.join(p, "openssl")
if os.path.exists(pathToFile) and os.access(pathToFile, os.X_OK):
entry = subprocess.check_output("ldd {0} | grep libssl".format(pathToFile),
- executable="/bin/bash", shell="True")
+ executable="/bin/sh", shell="True")
if entry is not False:
libpath = os.path.dirname(entry.split()[2])
elif system == "FreeBSD": @@ -275,7 +275,7 @@ class p4build_ext(build_ext_module):
platform_str += "freebsd"
- release = uname.release
+ if sys.version_info.major == 3:
+ release = uname.release
+ elif sys.version_info.major == 2:
+ release = uname[2]
+ else:
+ raise Exception("Unknown python version %s" % sys.version)
value = int(''.join(itertools.takewhile(lambda s: s.isdigit(), release))) ssl_ver = ""
if not p4_ssl_dir:
- if (not self.ssl) and (sys.platform == "linux" or sys.platform == "linux2"):
+ if (not self.ssl):
# check for a version of SSL already installed via 'openssl version'
self.ssl, ssl_ver = self.check_installed_ssl() # return libpath or None
@@ -217,6 +222,8 @@ class VersionInfo: @@ -313,7 +313,7 @@ class p4build_ext(build_ext_module):
verFile = os.path.join(p4ApiDir, "sample", "Version") p4_api_dir = self.apidir
if not os.path.exists(verFile):
verFile = os.path.join(p4ApiDir, "Version")
+ if not os.path.exists(verFile):
+ verFile = os.path.join(p4ApiDir, "share", "examples", "p4api", "Version")
input = open(verFile)
for line in input:
for pattern, handler in self.patterns:
@@ -398,9 +405,16 @@ class PlatformInfo:
arch = self.architecture(unameOut[4])
elif unameOut[0] == 'FreeBSD':
unix = "FREEBSD"
- release = unameOut[2][0]
- if release == '5':
- release += unameOut[2][2]
+ if sys.version_info.major == 3:
+ release = unameOut.release.split(".")[0]
+ if release == '5':
+ release += unameOut.release.split(".")[1]
+ elif sys.version_info.major == 2:
+ release = unameOut[2].split(".")[0]
+ if release == '5':
+ release += unameOut[2].split(".")[1]
+ else:
+ raise Exception("Unknown python version %s" % sys.version)
arch = self.architecture(unameOut[4]) try:
elif unameOut[0] == 'CYGWIN_NT-5.1': - apiVersion = VersionInfo(p4_api_dir)
@@ -475,8 +489,16 @@ def do_setup(p4_api_dir, ssl): + apiVersion = VersionInfo(".")
else: releaseVersion = VersionInfo(".")
print ("API Release %s.%s" % (ryear, rversion)) except IOError:
print("Cannot find Version file in API dir {0}.".format(p4_api_dir))
@@ -334,9 +334,18 @@ class p4build_ext(build_ext_module):
#spawn._nt_quote_args = monkey_nt_quote_args
- inc_path = [p4_api_dir, os.path.join(p4_api_dir, "include", "p4")] # add the paths for p4 headers and library
- lib_path = [p4_api_dir, os.path.join(p4_api_dir, "lib")] - inc_path = [str(os.path.join(p4_api_dir, "include", "p4"))]
+ inc_dir = os.path.join(p4_api_dir, "include", "p4") - lib_path = [str(os.path.join(p4_api_dir, "lib")), str(p4_ssl_dir)]
+ if not os.path.exists(inc_dir): + inc_dir = os.path.join(p4_api_dir, "include", "p4")
+ inc_dir = os.path.join(p4_api_dir, "include", "perforce") + if not os.path.exists(inc_dir):
+ inc_dir = os.path.join(p4_api_dir, "include", "perforce")
+ lib_dir = os.path.join(p4_api_dir, "lib", "perforce")
+ if not os.path.exists(lib_dir):
+ lib_dir = os.path.join(p4_api_dir, "lib")
+ +
+ lib_dir = os.path.join(p4_api_dir, "lib", "perforce") + inc_path = [p4_api_dir, inc_dir]
+ if not os.path.exists(lib_dir): + lib_path = [p4_api_dir, lib_dir]
+ lib_dir = os.path.join(p4_api_dir, "lib")
+ +
+ inc_path = [p4_api_dir, inc_dir] +
+ lib_path = [p4_api_dir, lib_dir] # check if the interpreter is mayapy.exe
if ssl: namedir = os.path.dirname(os.path.dirname(sys.executable))
lib_path.append( ssl ) if "maya" in namedir.lower():
@@ -469,7 +478,7 @@ def cleanup_api(api_dir, tarball):
@@ -608,7 +630,7 @@ if __name__ == "__main__":
if os.path.exists(distdir):
shutil.rmtree(distdir, False, force_remove_file)
- p4_api_dir = get_api_dir() # declare some evil globals
+ p4_api_dir = "%%LOCALBASE%%" -p4_api_dir = ""
+p4_api_dir = "%%LOCALBASE%%"
ssl = None p4_ssl_dir = ""
if '--ssl' in sys.argv: p4_ssl_ver = ""
ssl_tarball = ""

View file

@ -0,0 +1,13 @@
--- tools/PlatformInfo.py.orig 2023-04-05 20:18:00 UTC
+++ tools/PlatformInfo.py
@@ -131,9 +131,7 @@ class PlatformInfo:
arch = self.architecture(unameOut[4])
elif unameOut[0] == 'FreeBSD':
unix = "FREEBSD"
- release = unameOut[2][0]
- if release == '5':
- release += unameOut[2][2]
+ release = re.match("(\d+.\d)", unameOut[2]).group(1).replace(".","")
arch = self.architecture(unameOut[4])
elif unameOut[0] == 'CYGWIN_NT-5.1':