SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,42 @@
- test_bsddb and test_bsddb3 are in the list below as they are only available
on i386 and amd64.
Index: Lib/test/regrtest.py
--- Lib/test/regrtest.py.orig
+++ Lib/test/regrtest.py
@@ -2047,22 +2047,16 @@ _expectations = {
""",
'openbsd3':
"""
- test_ascii_formatd
test_bsddb
test_bsddb3
test_ctypes
+ test_curses
test_dl
test_epoll
- test_gdbm
- test_locale
- test_normalization
+ test_gdb
test_ossaudiodev
- test_pep277
- test_tcl
test_tk
test_ttk_guionly
- test_ttk_textonly
- test_multiprocessing
""",
'netbsd3':
"""
@@ -2089,6 +2083,10 @@ _expectations['freebsd5'] = _expectations['freebsd4']
_expectations['freebsd6'] = _expectations['freebsd4']
_expectations['freebsd7'] = _expectations['freebsd4']
_expectations['freebsd8'] = _expectations['freebsd4']
+_expectations['openbsd4'] = _expectations['openbsd3']
+_expectations['openbsd5'] = _expectations['openbsd3']
+_expectations['openbsd6'] = _expectations['openbsd3']
+_expectations['openbsd7'] = _expectations['openbsd3']
class _ExpectedSkips:
def __init__(self):

View file

@ -0,0 +1,12 @@
Index: Lib/test/test_tempfile.py
--- Lib/test/test_tempfile.py.orig
+++ Lib/test/test_tempfile.py
@@ -28,7 +28,7 @@ has_spawnl = hasattr(os, 'spawnl')
# TEST_FILES may need to be tweaked for systems depending on the maximum
# number of files that can be opened at one time (see ulimit -n)
-if sys.platform in ('openbsd3', 'openbsd4'):
+if sys.platform in ('openbsd3', 'openbsd4', 'openbsd5', 'openbsd6', 'openbsd7'):
TEST_FILES = 48
else:
TEST_FILES = 100

View file

@ -0,0 +1,12 @@
Index: Makefile.pre.in
--- Makefile.pre.in.orig
+++ Makefile.pre.in
@@ -1161,7 +1161,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdi
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
# Create the PLATDIR source directory, if one wasn't distributed..
-$(srcdir)/Lib/$(PLATDIR):
+$(srcdir)/Lib/$(PLATDIR): pybuilddir.txt
mkdir $(srcdir)/Lib/$(PLATDIR)
cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
export PATH; PATH="`pwd`:$$PATH"; \

View file

@ -0,0 +1,13 @@
Index: Modules/_hashopenssl.c
--- Modules/_hashopenssl.c.orig
+++ Modules/_hashopenssl.c
@@ -56,7 +56,8 @@
#define _OPENSSL_SUPPORTS_SHA2
#endif
-#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
/* OpenSSL < 1.1.0 */
#define EVP_MD_CTX_new EVP_MD_CTX_create
#define EVP_MD_CTX_free EVP_MD_CTX_destroy

View file

@ -0,0 +1,16 @@
XXX maybe this can go away now we have auto-init, I'm not sure exactly
what python's lock protects
Index: Modules/_ssl.c
--- Modules/_ssl.c.orig
+++ Modules/_ssl.c
@@ -164,6 +164,9 @@ struct py_ssl_library_code {
#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2)
#define OPENSSL_NO_SSL2
#endif
+#if defined(LIBRESSL_VERSION_NUMBER) && defined(WITH_THREAD)
+#define HAVE_OPENSSL_CRYPTO_LOCK
+#endif
#ifndef PY_OPENSSL_1_1_API
/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */

View file

@ -0,0 +1,15 @@
Index: Modules/pyexpat.c
--- Modules/pyexpat.c.orig
+++ Modules/pyexpat.c
@@ -437,6 +437,11 @@ call_character_handler(xmlparseobject *self, const XML
noop_character_data_handler);
return -1;
}
+ if (!have_handler(self, CharacterData)) {
+ Py_DECREF(args);
+ flag_error(self);
+ return -1;
+ }
PyTuple_SET_ITEM(args, 0, temp);
/* temp is now a borrowed reference; consider it unused. */
self->in_callback = 1;

View file

@ -0,0 +1,35 @@
SOVERSION defaults to 1.0. SHARED_LIBS, however, could be changed
at any point. Ensure they are on sync in case INSTSONAME is used
by a third party.
Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -479,7 +479,7 @@ esac
if test $define_xopen_source = yes
then
- AC_DEFINE(_XOPEN_SOURCE, 600,
+ AC_DEFINE(_XOPEN_SOURCE, 700,
Define to the level of X/Open that your system supports)
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
@@ -489,7 +489,7 @@ then
AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
Define to activate Unix95-and-earlier features)
- AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
+ AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2001)
fi
@@ -930,6 +930,9 @@ if test $enable_shared = "yes"; then
case $ac_sys_system in
FreeBSD*)
SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
+ ;;
+ OpenBSD*)
+ SOVERSION=${LIBpython2.7_VERSION}
;;
esac
INSTSONAME="$LDLIBRARY".$SOVERSION

View file

@ -0,0 +1,98 @@
Index: setup.py
--- setup.py.orig
+++ setup.py
@@ -35,6 +35,11 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []
+def usrlocal(p):
+ return os.path.join(os.environ['LOCALBASE'], p)
+def usrx11r6(p):
+ return os.path.join(os.environ['X11BASE'], p)
+
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
1) 'dir' is not already in 'dirlist'
@@ -502,8 +507,8 @@ class PyBuildExt(build_ext):
def detect_modules(self):
# Ensure that /usr/local is always used
if not cross_compiling:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ add_dir_to_list(self.compiler.library_dirs, usrlocal('lib'))
+ add_dir_to_list(self.compiler.include_dirs, usrlocal('include'))
if cross_compiling:
self.add_gcc_paths()
self.add_multiarch_paths()
@@ -968,7 +973,7 @@ class PyBuildExt(build_ext):
# BerkeleyDB 4.6.x is not stable on many architectures.
arch = platform_machine()
if arch not in ('i386', 'i486', 'i586', 'i686',
- 'x86_64', 'ia64'):
+ 'x86_64', 'amd64', 'ia64'):
return False
return True
@@ -1038,6 +1043,7 @@ class PyBuildExt(build_ext):
std_variants.append(os.path.join(dn, "db3.%d"%x))
db_inc_paths = std_variants + db_inc_paths
+ db_inc_paths = [ usrlocal('include/db4') ]
db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)]
db_ver_inc_map = {}
@@ -1101,6 +1107,7 @@ class PyBuildExt(build_ext):
db_incdir.replace("include", 'lib64'),
db_incdir.replace("include", 'lib'),
]
+ db_dirs_to_check = [usrlocal('lib/db4')]
if host_platform != 'darwin':
db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check)
@@ -1123,6 +1130,7 @@ class PyBuildExt(build_ext):
# symlink to more general names?
for dblib in (('db-%d.%d' % db_ver),
('db%d%d' % db_ver),
+ ('db'),
('db%d' % db_ver[0])):
dblib_file = self.compiler.find_library_file(
db_dirs_to_check + lib_dirs, dblib )
@@ -1280,7 +1288,7 @@ class PyBuildExt(build_ext):
sysroot = macosx_sdk_root()
f = os.path.join(sysroot, f[1:])
- if os.path.exists(f) and not db_incs:
+ if os.path.exists(f):
data = open(f).read()
m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
if m is not None:
@@ -1881,7 +1889,7 @@ class PyBuildExt(build_ext):
# For 8.4a2, the X11 headers are not included. Rather than include a
# complicated search, this is a hard-coded path. It could bail out
# if X11 libs are not found...
- include_dirs.append('/usr/X11R6/include')
+ include_dirs.append(usrx11r6('include'))
frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
# All existing framework builds of Tcl/Tk don't support 64-bit
@@ -1980,17 +1988,9 @@ class PyBuildExt(build_ext):
if host_platform == 'sunos5':
include_dirs.append('/usr/openwin/include')
added_lib_dirs.append('/usr/openwin/lib')
- elif os.path.exists('/usr/X11R6/include'):
- include_dirs.append('/usr/X11R6/include')
- added_lib_dirs.append('/usr/X11R6/lib64')
- added_lib_dirs.append('/usr/X11R6/lib')
- elif os.path.exists('/usr/X11R5/include'):
- include_dirs.append('/usr/X11R5/include')
- added_lib_dirs.append('/usr/X11R5/lib')
- else:
- # Assume default location for X11
- include_dirs.append('/usr/X11/include')
- added_lib_dirs.append('/usr/X11/lib')
+ elif True:
+ include_dirs.append(usrx11r6('include'))
+ added_lib_dirs.append(usrx11r6('lib'))
# If Cygwin, then verify that X is installed before proceeding
if host_platform == 'cygwin':