changeset 56:585cf5a218ad

Allow to build PyPy-v7.3.14 on FreeBSD 13.2: This needs to handle: - AF_NETLINK support on FreeBSD - build of termios (with extra header termios.h)
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 07 Jan 2024 22:27:41 +0100
parents b1432f2f3bc4
children b0ce0cf90f22
files Makefile README bsd.pypy.mk distinfo.py27 files/patch-rpython_rlib___rsocket__rffi.py files/patch-rpython_rlib_rposix.py
diffstat 6 files changed, 71 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Feb 21 22:20:50 2023 +0100
+++ b/Makefile	Sun Jan 07 22:27:41 2024 +0100
@@ -121,7 +121,7 @@
 		${MKDIR} ${WRKDIR}/build; \
 		(cd ${WRKSRC}/pypy/goal; \
 			${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYPY_USESSION_BASENAME=${PORTNAME} \
-			${PYTHON_CMD} ../../rpython/bin/rpython --source -Ojit targetpypystandalone.py ${PYPY_ARGS}); \
+			${PYTHON_CMD} ../../rpython/bin/rpython --source --opt=jit targetpypystandalone.py ${PYPY_ARGS}); \
 	fi
 
 post-build:
--- a/README	Tue Feb 21 22:20:50 2023 +0100
+++ b/README	Sun Jan 07 22:27:41 2024 +0100
@@ -39,7 +39,7 @@
 
 Origin: lang/pypy
 
-Install -A gmake, binutils, expat, libunwind
+Install -A gmake, binutils, expat, libunwind, pkgconf
 
 Unbedingt auch sicherstellen, daß libffi und libz installiert sind
 
@@ -126,3 +126,35 @@
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 jeweils mit "FLAVOR=pypy" bauen
+
+
+
+Build von PyPy v7.3.14 auf FreeBSD-13.2
+=======================================
+
+.. note:: Auch das Kommanto :command:`pkg-config` scheint nun nötig zu
+          sein laut Dokumentation.
+
+
+``AF_NETLINK`` und :file:`linux/netlink.h`
+------------------------------------------
+
+FreeBSD-13.2 definiert im Gegensatz zu früheren Versionen nun auch
+``AF_NETLINK``. Aber PyPy (übrigends auch frühere Versionen) geht davon aus,
+daß ``AF_NETLINK`` nur unter Linux definiert sein kann und includiert dann
+fest das Include-File :file:`linux/netlink.h`; das gibt es aber unter
+FreeBSD nicht. Stattdessen ist es hier :file:'netlink/netlink.h`.
+
+  Deswegen in :file:`rpython/rlib/_rsocket_rffi.py` die entsprechende
+  Include-Definition patchen.
+
+
+termios
+-------
+
+PyPy v7.3.14 baut nun auch das `termios`-Modul. Der entsprechende nötige
+Header :file:`termios.h` ist aber unter FreeBSD nicht automatisch beim
+Compilieren mit dabei.
+
+  Deswegen in :file:`rpython/rlib/rposix.py` den Header :file:`termios.h`
+  in die Platform-Konfigurations-Includes mit aufnehmen unter FreeBSD.
--- a/bsd.pypy.mk	Tue Feb 21 22:20:50 2023 +0100
+++ b/bsd.pypy.mk	Sun Jan 07 22:27:41 2024 +0100
@@ -16,7 +16,7 @@
 
 .if ${PYTHON_IMPL} == pypy
 
-DISTVERSION=	7.3.11
+DISTVERSION=	7.3.14
 PY_VERSION_SHORT=	2.7
 PYPY_CFFI_VER=	${PYTHON_IMPL}-73
 PYPY_LDLIBRARY=	libpypy-c.so
--- a/distinfo.py27	Tue Feb 21 22:20:50 2023 +0100
+++ b/distinfo.py27	Sun Jan 07 22:27:41 2024 +0100
@@ -1,3 +1,3 @@
-TIMESTAMP = 1672768352
-SHA256 (pypy2.7-v7.3.11-src.tar.bz2) = 1117afb66831da4ea6f39d8d2084787a74689fd0229de0be301f9ed9b255093c
-SIZE (pypy2.7-v7.3.11-src.tar.bz2) = 19850421
+TIMESTAMP = 1704649912
+SHA256 (pypy2.7-v7.3.14-src.tar.bz2) = e096fe67ce2d8d4d5e7dceb84fe1ca854498f00766d31b27d32c8d8833131373
+SIZE (pypy2.7-v7.3.14-src.tar.bz2) = 19910947
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/files/patch-rpython_rlib___rsocket__rffi.py	Sun Jan 07 22:27:41 2024 +0100
@@ -0,0 +1,22 @@
+--- rpython/rlib/_rsocket_rffi.py.orig	2023-12-23 15:29:17 UTC
++++ rpython/rlib/_rsocket_rffi.py
+@@ -16,6 +16,7 @@ _MSVC  = target_platform.name == "msvc"
+ _MINGW = target_platform.name == "mingw32"
+ _SOLARIS = sys.platform == "sunos5"
+ _MACOSX = sys.platform == "darwin"
++_FREEBSD = sys.platform.startswith('freebsd')
+ _HAS_AF_PACKET = sys.platform.startswith('linux')   # only Linux for now
+ 
+ if _POSIX:
+@@ -42,7 +43,10 @@ if _POSIX:
+                      'sys/ioctl.h',
+                     )
+ 
+-    cond_includes = [('AF_NETLINK', 'linux/netlink.h')]
++    if _FREEBSD:
++        cond_includes = [('AF_NETLINK', 'netlink/netlink.h')]
++    else:
++        cond_includes = [('AF_NETLINK', 'linux/netlink.h')]
+ 
+     libraries = ()
+     calling_conv = 'c'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/files/patch-rpython_rlib_rposix.py	Sun Jan 07 22:27:41 2024 +0100
@@ -0,0 +1,11 @@
+--- rpython/rlib/rposix.py.orig	2023-12-23 15:29:17 UTC
++++ rpython/rlib/rposix.py
+@@ -214,6 +214,8 @@ else:
+         includes.append('sys/sysmacros.h')
+     if sys.platform.startswith('freebsd') or sys.platform.startswith('openbsd'):
+         includes.append('sys/ttycom.h')
++    if sys.platform.startswith('freebsd'):
++        includes.append('termios.h')
+     libraries = ['util']
+ 
+ eci = ExternalCompilationInfo(