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,14 @@
Make bsd make happy
Index: Makefile.pre.in
--- Makefile.pre.in.orig
+++ Makefile.pre.in
@@ -533,8 +533,6 @@ LIBMPDEC_OBJS= \
Modules/_decimal/libmpdec/numbertheory.o \
Modules/_decimal/libmpdec/sixstep.o \
Modules/_decimal/libmpdec/transpose.o
- # _decimal does not use signaling API
- # Modules/_decimal/libmpdec/mpsignal.o
LIBMPDEC_HEADERS= \
$(srcdir)/Modules/_decimal/libmpdec/basearith.h \

View file

@ -0,0 +1,69 @@
LibreSSL has NID_sha3_256 and NID_sha512_256 now, but it's simpler to
handle -stable updates if we keep the patch until 7.4 is out.
Index: Modules/_hashopenssl.c
--- Modules/_hashopenssl.c.orig
+++ Modules/_hashopenssl.c
@@ -45,10 +45,18 @@
#define MUNCH_SIZE INT_MAX
+#ifdef NID_id_scrypt
#define PY_OPENSSL_HAS_SCRYPT 1
+#endif
+#ifdef NID_sha3_256
#define PY_OPENSSL_HAS_SHA3 1
+#endif
+#ifdef NID_shake256
#define PY_OPENSSL_HAS_SHAKE 1
+#endif
+#ifdef NID_blake2s256
#define PY_OPENSSL_HAS_BLAKE2 1
+#endif
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
#define PY_EVP_MD EVP_MD
@@ -120,19 +128,27 @@ static const py_hashentry_t py_hashes[] = {
PY_HASH_ENTRY(Py_hash_sha384, "SHA384", SN_sha384, NID_sha384),
PY_HASH_ENTRY(Py_hash_sha512, "SHA512", SN_sha512, NID_sha512),
/* truncated sha2 */
+#ifdef NID_sha512_256
PY_HASH_ENTRY(Py_hash_sha512_224, "SHA512_224", SN_sha512_224, NID_sha512_224),
PY_HASH_ENTRY(Py_hash_sha512_256, "SHA512_256", SN_sha512_256, NID_sha512_256),
+#endif
/* sha3 */
+#ifdef PY_OPENSSL_HAS_SHA3
PY_HASH_ENTRY(Py_hash_sha3_224, NULL, SN_sha3_224, NID_sha3_224),
PY_HASH_ENTRY(Py_hash_sha3_256, NULL, SN_sha3_256, NID_sha3_256),
PY_HASH_ENTRY(Py_hash_sha3_384, NULL, SN_sha3_384, NID_sha3_384),
PY_HASH_ENTRY(Py_hash_sha3_512, NULL, SN_sha3_512, NID_sha3_512),
+#endif
/* sha3 shake */
+#ifdef PY_OPENSSL_HAS_SHAKE
PY_HASH_ENTRY(Py_hash_shake_128, NULL, SN_shake128, NID_shake128),
PY_HASH_ENTRY(Py_hash_shake_256, NULL, SN_shake256, NID_shake256),
+#endif
/* blake2 digest */
+#ifdef PY_OPENSSL_HAS_BLAKE2
PY_HASH_ENTRY(Py_hash_blake2s, "blake2s256", SN_blake2s256, NID_blake2s256),
PY_HASH_ENTRY(Py_hash_blake2b, "blake2b512", SN_blake2b512, NID_blake2b512),
+#endif
PY_HASH_ENTRY(NULL, NULL, NULL, 0),
};
@@ -873,11 +889,15 @@ py_evp_fromname(PyObject *module, const char *digestna
goto exit;
}
+#ifndef EVP_MD_FLAG_XOF
+ type = get_hashlib_state(module)->EVPtype;
+#else
if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
type = get_hashlib_state(module)->EVPXOFtype;
} else {
type = get_hashlib_state(module)->EVPtype;
}
+#endif
self = newEVPobject(type);
if (self == NULL) {

View file

@ -0,0 +1,15 @@
Index: Python/fileutils.c
--- Python/fileutils.c.orig
+++ Python/fileutils.c
@@ -2599,9 +2599,9 @@ done:
* non-opened fd in the middle.
* 2b. If fdwalk(3) isn't available, just do a plain close(2) loop.
*/
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
# define USE_CLOSEFROM
-#endif /* __FreeBSD__ */
+#endif /* __FreeBSD__ || __OpenBSD__ */
#ifdef HAVE_FDWALK
# define USE_FDWALK

View file

@ -0,0 +1,63 @@
#1: Set ports library version
#2: Don't pick up an installed linux/e2fsprogs libuuid.so
#3: llvm-ar (used for LTO) is installed as ar
#4: OpenBSD isn't multi-arch
#5: Try only the right tcl/tk string
Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -249,7 +249,7 @@ VERSION=PYTHON_VERSION
# Version number of Python's own shared library file.
AC_SUBST(SOVERSION)
-SOVERSION=1.0
+SOVERSION=${LIBpython3.11_VERSION}
# The later definition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
# certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
@@ -1096,6 +1096,7 @@ AC_MSG_CHECKING([for multiarch])
AS_CASE([$ac_sys_system],
[Darwin*], [MULTIARCH=""],
[FreeBSD*], [MULTIARCH=""],
+ [OpenBSD*], [MULTIARCH=""],
[MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
)
AC_SUBST([MULTIARCH])
@@ -1835,13 +1836,13 @@ esac
[AC_MSG_RESULT(no)])
if test "$Py_LTO" = 'true' ; then
case $CC in
- *clang*)
+ *clang*|cc)
LDFLAGS_NOLTO="-fno-lto"
dnl Clang linker requires -flto in order to link objects with LTO information.
dnl Thin LTO is faster and works for object files with full LTO information, too.
AX_CHECK_COMPILE_FLAG([-flto=thin],[LDFLAGS_NOLTO="-flto=thin"],[LDFLAGS_NOLTO="-flto"])
AC_SUBST(LLVM_AR)
- AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
+ AC_PATH_TOOL(LLVM_AR, ar, '', ${llvm_path})
AC_SUBST(LLVM_AR_FOUND)
if test -n "${LLVM_AR}" -a -x "${LLVM_AR}"
then
@@ -1956,7 +1957,7 @@ then
fi
LLVM_PROF_ERR=no
case $CC in
- *clang*)
+ *clang*|cc)
# Any changes made here should be reflected in the GCC+Darwin case below
PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
@@ -3876,11 +3877,7 @@ dnl Detect Tcl/Tk. Use pkg-config if available.
dnl
found_tcltk=no
for _QUERY in \
- "tcl >= 8.5.12 tk >= 8.5.12" \
- "tcl8.6 tk8.6" \
"tcl86 tk86" \
- "tcl8.5 >= 8.5.12 tk8.5 >= 8.5.12" \
- "tcl85 >= 8.5.12 tk85 >= 8.5.12" \
; do
PKG_CHECK_EXISTS([$_QUERY], [
PKG_CHECK_MODULES([TCLTK], [$_QUERY], [found_tcltk=yes], [found_tcltk=no])