Commit Graph

168 Commits

Author SHA1 Message Date
sthen a5d4cc6841 fix pydoc3 shebang line, spotted by/ok semarie@ 2025-01-31 12:46:51 +00:00
sthen a2ecae0b9d add a comment noting that DEBUG_PACKAGES in lang/python results in -g
getting added to _sysconfigdata, which results in some compiled Python
extensions picking it up.

noticed while investigating surprising memory use in LLVM 18+ while
compiling cython-generated C code (~700MB in LLVM 16/17; 10GB+ in 18).
llvm #124749
2025-01-28 15:08:56 +00:00
sthen 999161335d update python/3 to 3.12.8 and do some other overhaul while there
(since any python branch switch touches thousands of ports):

- stop using FLAVOR=python3 / MODPY_FLAVOR / etc in py3 ports.

- rename MODPY_EGG_VERSION (which refers to an obsolete packaging
format) with MODPY_DISTV (easier to type and line up in Makefiles)

bumps and adjustments to follow. lots of help from tb@, thanks!
2024-12-21 11:32:44 +00:00
sthen 4bb1058856 move some python 2.7-only CONFIGURE_ARGS to an .if block so they don't trigger
warnings from autoconf when building 3. change is a noop (same flags for 2.7,
and the flags were not supported in 3).
2024-09-12 11:40:45 +00:00
sthen dc0bb09e05 no more need for MODOY_DEFAULTONLY 2024-05-06 18:53:19 +00:00
sthen a645ab48e9 switch default py3 version to 3.11
looks reasonable to tb@
2024-05-06 12:20:20 +00:00
sthen 122c223f47 use "if [ ...; then; fi" rather than "[ ..." to avoid an error exit code
if the file doesn't exist; unbreaks 2.7/3.9, found by aja@
2024-03-24 08:50:43 +00:00
sthen 841deecf45 Include an EXTERNALLY-MANAGED file in the Python packages, which triggers
a warning if users attempt to install modules system-wide outside the
ports/packages system.  ok kmos@
2024-03-23 12:35:27 +00:00
jca 84d1bbdfc1 Drop --enable-optimizations to fix build with clang-16
Not waiting for maintainer because the port just doesn't build currently
and we need to get ports back into shape.

ok djm@ sthen@
2023-11-14 12:33:56 +00:00
espie 51acb67336 MASTER_SITES->SITES (apart from modules) 2023-09-26 12:02:00 +00:00
sthen 4c0261901a move USE_NOBTCFI next to USE_WXNEEDED and update the comment. 2023-08-30 08:50:28 +00:00
kmos 5b132f4026 Update to Python 3.10.12
https://docs.python.org/release/3.10.12/whatsnew/changelog.html#python-3-10-12-final

Add USE_NOBTCFI=Yes to Makefile.inc

ok sthen
2023-06-19 19:46:28 +00:00
sthen ed2bb52cd9 fix #! line in pip3.9/pip3.11 scripts, ok kmos@ 2022-12-25 13:42:05 +00:00
tb 712e4ab1ca python: remove workaround for python 3.11 to unbreak build 2022-12-21 09:59:35 +00:00
tb 411459a219 Python: set COMPILER_LANGS = c. The Pythons are no longer compiled with
--with-libcxx-main, so they no longer need to link against a C++ runtime.

help/ok sthen, ok kmos
2022-12-06 15:55:58 +00:00
sthen a8dd03208c Patch Modules/readline.c to workaround an issue with the readline module
with Python 3.9+'s definition of PyMODINIT_FUNC and our readline headers
https://github.com/openbsd/src/blob/master/gnu/lib/libreadline/rlstdc.h#L41

(Due to some other strangeness in the build system, on 3.9 it rebuilt a
working version after the first attempt failed and the file was moved out
of the way, but that no longer happens with 3.10+ where readline just
failed).

Fix up PLISTs and WANTLIB for Python 3.11 while there.

Joint work with landry@ tb@ kmos@, ok tb kmos
2022-11-01 16:18:22 +00:00
sthen 038dae1c19 allow adding to LIB_DEPENDS-main / WANTLIB-main from a subdir 2022-09-12 21:12:39 +00:00
jca 00b363c7a3 Don't enable profile-guided optimizations on armv7 (fails with out of memory)
Pointed out by phessler@, ok kmos@ (maintainer)
2022-08-14 23:35:01 +00:00
gkoehler 910c139702 Don't --enable-optimizations on powerpc
This unbreaks python 3.* on powerpc.  The build had enabled PGO
(Profile Guided Optimization), then got "Segmentation fault" from the
./python binary.  This seems to be a bug in clang or lld specific to
32-bit powerpc.  We continue to --enable-optimizations on powerpc64.

ok kmos@, sthen@
2022-08-07 17:00:43 +00:00
robert 1b98a91114 add --enable-optimizations configure flag to architectures using lld where
llvm-profdata is also available to enable PGO builds

ok sthen@
2022-07-27 06:20:10 +00:00
stu 9f5da2e414 Move from using Tcl/Tk 8.5 to Tcl/Tk 8.6,
except for Python-2.7, which stays with 8.5.

Make COMMENTs and DESCRs consistent with Tk.

Fix typo in 3.10/files/CHANGES.OpenBSD.


OKs and thanks to kmos@, sthen@.
2022-06-09 14:49:29 +00:00
sthen f47c2920cc check that _hashlib/_ssl.so are built; OK'd a while ago by tb@ but I forgot
to commit it
2022-05-26 15:13:55 +00:00
sthen f7b24540a9 enable LTO for Python, from robert@ with some tweaks
earlier version ok kmos@
2022-04-28 14:47:56 +00:00
sthen b47a629bac Include pip in the non-default versions of Python, so that for example
if you want to run some software that needs an older or newer version
of Python you can do so in most cases. For the default versions (2.7, 3.9)
pip is available from the separate port (devel/py2-pip, devel/py-pip).
Factor out some common parts to ../Makefile.inc while there. OK kmos@
2022-03-28 15:48:24 +00:00
naddy e93f9d0ca9 drop RCS Ids 2022-03-11 19:28:46 +00:00
daniel c1a2df2200 eliminate PATCHLEVEL variable; it is no longer needed
ok kmos@ (MAINTAINER)
2022-01-29 17:44:59 +00:00
daniel 6b9e710437 use a FULL_VERSION variable in Python Makefiles
The goal is to shuffle things around allowing us to use this variable in
the packing lists. This should reduce a little bit of churn going
forward given some files get bumped with every point release.

For example in Python 3.9 we make the following update:

-lib/python3.9/lib2to3/Grammar3.9.10.final.0.pickle
+lib/python3.9/lib2to3/Grammar${FULL_VERSION}.final.0.pickle

-lib/python3.9/lib2to3/PatternGrammar3.9.10.final.0.pickle
+lib/python3.9/lib2to3/PatternGrammar${FULL_VERSION}.final.0.pickle

ok kmos@ (MAINTAINER), sthen@
2022-01-23 21:32:07 +00:00
sthen bc96ab094e simplify switching default Python versions, ok kmos@
Add a new SUBST_VARS variable that is set to "@comment " on
most Python versions, but is set to "" on the default one. This makes
it easier to swap between default versions because you don't need
to figure out which @comments should be kept and which should be moved.

While there I remove some existing lines with @comment markers for
files that are not created by any of our current Python ports:

@comment bin/pyvenv
@comment lib/libpython3.8m.so (etc)

The @comment -> ${PY_DEFAULTONLY} change doesn't affect the generated
PLISTs at all, so for that a REVISION bump is unnecessary, but removing
the pyvenv/libpython3.Xm.so does require a bump
2021-11-01 16:56:24 +00:00
landry 89cd0faf06 lang/python: stop leaking python build LDFLAGS/CFLAGS to python extensions build
right now the installed python retains paths to the python build objdir,
and also enforces -L/usr/local/lib when linking python shared extensions
(which might not be desired):

$python3 -m sysconfig|grep LDSH
        BLDSHARED = "cc -pthread -shared -fPIC -L/usr/local/lib/ -L/usr/obj/ports/Python-3.8.12/Python-3.8.12 -L/usr/local/lib/"
        LDSHARED = "cc -pthread -shared -fPIC -L/usr/local/lib/ -L/usr/obj/ports/Python-3.8.12/Python-3.8.12 -L/usr/local/lib/"

python 3.x provides LDFLAGS_NODIST/CFLAGS_NODIST to avoid that (cf
https://docs.python.org/3/using/configure.html#envvar-CONFIGURE_LDFLAGS_NODIST),
but sadly if we only use it (and remove CPPFLAGS/LDFLAGS pointing at
/usr/local from CONFIGURE_ENV), libintl/textdomain detection during
configure fails.

So, taking inspiration from freebsd PR181721, dont add
CONFIGURE_LDFLAGS/CONFIGURE_CPPFLAGS to PY_LDFLAGS/PY_CPPFLAGS.

extend CHANGES.OpenBSD to explain the change (reminded by sthen@).

went in a bulk build (thanks ajacoutot@!) with a single fallout
(devel/gdb) that will get fixed shortly.
2021-11-01 07:43:39 +00:00
kmos 53f471957a Update Python 3.8 to 3.8.11 and Python 3.9 to 3.9.7
https://docs.python.org/release/3.8.12/whatsnew/changelog.html#changelog

https://docs.python.org/release/3.9.7/whatsnew/changelog.html#changelog

Each has security fixes

Take MAINTAINER from Remi Pointel with his blessing

Bump revisions in 2.7 due to maintainer update

ok remi
2021-09-01 17:41:47 +00:00
sthen abb55fc128 avoid some more hardcoding of 'openbsd6' 2021-07-30 20:01:19 +00:00
sthen d108ea0c09 don't hardcode 'openbsd6', use 'openbsd${OSMAJOR}' 2021-07-30 19:54:18 +00:00
sthen e82c1acb6c install the gdb autoload helper for the various Python versions,
allows some additional debugging features for Python-based software
(for example there's a new "py-bt" command to print a Python backtrace
which can give clues if a py process is hanging).

ok rpointel@
2021-03-22 17:35:26 +00:00
daniel 43446f11cd retire python 3.7
An earlier diff was okayed by rpointel@, kmos@. sthen@ requested to move
the @conflict and @pkgpath markers from 3.7 to 3.8 in the same commit (a
better approach). Final diff was ok sthen@.
2020-12-29 23:59:06 +00:00
sthen ef465900cd Fix python upgrade paths, problem reported by Mikolaj Kucharski and I had
already run into it myself. Add comments to hopefully make it simpler
and more understandable for future changes to the default version.
Zero feedback but tests well here, committing before I forget about
it because people will run into this with 6.7.
2020-02-11 11:45:31 +00:00
ajacoutot 8e232da1bf Provide all python debug packages. 2019-11-11 17:47:41 +00:00
kmos b0e3d2d064 Add Python 3.8.0 to the tree. The default python3 version will remain
3.7.5 for now, but this will allow easier testing for the eventual
switchover.

Input from landry and sthen

ok sthen
2019-11-07 16:14:09 +00:00
sthen 33dd92ca69 this should have been part of rpointel's python 2.7.17 update 2019-11-01 21:43:24 +00:00
sthen 3318ced016 replace simple PERMIT_PACKAGE_CDROM=Yes with PERMIT_PACKAGE=Yes 2019-07-12 20:46:54 +00:00
naddy ebf751b927 Update gettext to 0.20.1.
Follow the upstream recommendations for packagers and switch to
multi-packages:
devel/gettext       -> devel/gettext,-runtime
devel/gettext-tools -> devel/gettext,-tools
(new)                  devel/gettext,-textstyle
2019-05-20 22:15:00 +00:00
sthen c3e90e6a46 python tweaks;
- sync WANTLIB
- use do-gen instead of post-patch for the "subst and regen
autoconf files" target
- ALL_TARGET needs setting differently between 2.7 and 3.x;
rather than checking against 3.6 for "all", check against 2.7
for "all ./Lib/plat-openbsd6". needed for newer 3.x.
2019-04-21 09:32:19 +00:00
sthen 2a83c63018 add MODGCC4_CPPLIBDEP to LIB_DEPENDS-main to unbreak !clang arches -
on clang arches this is a noop, on !clang arches this gives a path to
the estdc++ WANTLIB. needed because this is a multi-package port and
LIB_DEPENDS-main doesn't include the default LIB_DEPENDS added by
gcc4.port.mk.
2018-10-31 23:48:19 +00:00
sthen 25f0e460f2 Add COMPILER lines to c++ ports which currently use the default. Adjust
some existing COMPILER lines with arch restrictions etc. In the usual
case this is now using "COMPILER = base-clang ports-gcc base-gcc" on
ports with c++ libraries in WANTLIB.

This is basically intended to be a noop on architectures using clang
as the system compiler, but help with other architectures where we
currently have many ports knocked out due to building with an unsuitable
compiler -

- some ports require c++11/newer so the GCC version in base that is used
on these archirtectures is too old.

- some ports have conflicts where an executable is built with one compiler
(e.g. gcc from base) but a library dependency is built with a different
one (e.g. gcc from ports), resulted in mixing incompatible libraries in the
same address space.

devel/gmp is intentionally skipped as it's on the path to building gcc -
the c++ library there is unused in ports (and not built by default upstream)
so intending to disable building gmpcxx in a future commit.
2018-10-24 14:27:57 +00:00
danj 7d569fc533 Tweak MASTER_SITES and HOMEPAGE
Switch to https and remove dead mirror.
Noticed by rsadowski@, ok rpointel@
2018-09-18 16:43:12 +00:00
ajacoutot d2bf181df8 Provide symlinks for python2, python3 and friends like most other OSes do.
This will allow us to drop patches and substitutions in our ports tree. Nowadays
most upstreams don't hardcode the path to python but instead use env(1) to find
the path.

bulk tested
ok sthen@
ok and input from rpointel@ (on an older patch)
2017-11-03 13:13:05 +00:00
espie 8ac47fd9c6 use COMPILER_LIBCXX where applicable 2017-07-16 19:18:47 +00:00
sthen bcbf44ab87 use LIBCXX 2017-04-10 11:46:18 +00:00
phessler 9e7b773b4a 10 years ago, we needed to build python with c++ to make sure modules
with native c++ code worked fine.  We no longer need to do that, and
llvm errors out with the non-sensical combination of "c++ -std=c99".

this fixes the python build on arm64

tested by sthen@ in an i386 bulk, thanks!

OK sthen@, rpointel@ (maintainer)
2017-02-20 11:04:27 +00:00
phessler 0df7a040a4 remove a sparc leftover 2017-02-17 10:01:28 +00:00
rpointel 47d293372a adapt ALL_TARGET for Python 3.6. 2016-12-26 19:41:45 +00:00