Commit graph

44 commits

Author SHA1 Message Date
Rodrigo Tobar c3a6d96988 Ports: Patch Python to deal with Serenity's strftime
The xmlrpc.client module has some trial-and-error logic at module import
time to figure out how to properly format years using strftime. There
have already been problems in the past with this code in Python (see
https://bugs.python.org/issue13305, which is still open), and Serenity
only adds to that.

This problem has been reported at https://bugs.python.org/issue45386, so
hopefully in time we won't need this patch anymore.
2021-10-06 13:57:52 +01:00
Rodrigo Tobar c38c93bff1 Ports: Patch Python's http.client due to unimplemented socket option
This problem has been reported on https://bugs.python.org/issue45328 and
a fix has been provided, potential review and merge are pending.
2021-10-06 13:57:52 +01:00
Rodrigo Tobar 3c192f492a Ports: Compile Python against OpenSSL to gain ssl module
Compiling against an OpenSSL thread-enabled shared library (see #10207)
lets Python compile its _ssl module, which yields an importable ssl
module.

The ssl module suffers from the same problem described in #10014 though,
namely that python crashes when importing different modules results in
multiple libcrypto.so loads, and its functions are later invoked by one
of the modules. Once #10277 is merged though the module becomes quite
usable.
2021-10-05 15:45:08 +01:00
Tim Schumacher c07f91474d Ports: Make array-like settings actual arrays
We may need entries with spaces in makeopts, installopts, and
configopts, and at that point we should also convert depends and
auth_opts to avoid confusion.
2021-10-05 02:13:08 +02:00
Linus Groh fb98e12f86 Ports: Update Python to 3.10.0
Released on 2021-10-04.
https://www.python.org/downloads/release/python-3100/
2021-10-04 21:46:25 +01:00
Linus Groh 5426901521 Ports: Update Python to 3.10.0rc2
Released on 2021-09-07.
https://www.python.org/downloads/release/python-3100rc2/
2021-09-18 21:20:18 +02:00
Linus Groh 6595db9ecf Ports: Build Python with --enable-optimizations
This no longer results in linker errors as the FIXME states, so let's
get some perf for free :^)
2021-09-11 00:28:39 +02:00
Linus Groh 6b15faed30 Ports: Build Python with libuuid
This makes the _uuid module work :^)
2021-09-11 00:28:39 +02:00
Rodrigo Tobar 430e5d27aa Ports: Fix compilation of python3 socket module 2021-09-09 17:51:15 +01:00
Linus Groh 81784afbe1 Ports: Fix Python's expected SHA256 sum
Fixes #9265.
2021-08-07 15:10:50 +01:00
Linus Groh 18f507520e Ports: Update Python to 3.10.0rc1
Released on 2021-08-02.
https://www.python.org/downloads/release/python-3100rc1/

This contains the first upstreamed change for SerenityOS, making the
webbrowser module work with Browser out of the box :^)
2021-08-03 21:01:07 +01:00
Linus Groh 5a0a426c18 Ports: Make Python version check work with suffixed versions
E.g. a1, b1, rc1. Simply don't parse anything beyond major and minor.
2021-08-03 21:01:07 +01:00
Linus Groh a613e00caa Ports: Change Python's auth_type to sha256 2021-08-03 21:01:07 +01:00
Linus Groh 84efed502a Ports: Add a launcher for Python
We're even downloading an additional older icon from the git repo
instead of using their current ones for accurate look and feel :^)
2021-07-20 00:58:26 +01:00
Linus Groh c77215fc61 Ports: Build Python with ncurses and termcap
Neither the _curses nor the termios module builds to completion
currently due to some missing functions, but we can let it try
nonetheless - it'll likely get fixed at some point :^)
2021-07-10 11:13:02 +01:00
Linus Groh b2d68913d3 Ports: Build Python with sqlite
This makes the _sqlite3 module work :^)
2021-07-10 11:13:02 +01:00
Linus Groh 3b863561d7 Ports: Build Python with bzip2
This makes the _bz2 module work :^)
2021-07-10 11:13:02 +01:00
Linus Groh 5e3af8b7db Ports: Build Python with readline
This provides a *much* improved REPL experience :^)
2021-07-10 11:13:02 +01:00
Linus Groh 123c2f2f7f Ports: Add a patch for Python's setup.py to consider /usr/local
This makes it find more includes and libraries than by default when
crosscompiling.
2021-07-10 11:13:02 +01:00
Linus Groh 96331d7d87 Ports: Export CC with added --sysroot for building Python
This is used in the setup.py file when adding include and lib paths to
the list when crosscompiling, if it's not found in any of the checked
environment variables they don't get added.
2021-07-10 11:13:02 +01:00
Linus Groh 2c78fa066f Ports: Remove Python setlocale patch that's no longer needed
Since 4cd45f5, setlocale() always pretends to succeed.
2021-07-09 20:14:08 +01:00
Linus Groh 116f1c5c56 Ports: Update Python to 3.9.6
Released on 2021-06-28.
https://www.python.org/downloads/release/python-396/
2021-07-07 20:24:48 +01:00
Linus Groh 25cf59f2f6 Ports: Add note about Python webbrowser patch upstreaming 2021-05-09 17:15:15 +01:00
Linus Groh 2cbe510e89 Ports: Remove obsolete rlimit patch for Python
Stubs for getrlimit()/setrlimit() have been added in 1c3c072.
2021-05-09 17:11:02 +01:00
Linus Groh f1791eca13 Ports: Always set Python MACHDEP to version-less 'serenityos'
This is used for `sys.platform`, so it's important to get it right and
ideally never change it again. When not cross-compiling this would
append the `uname -r` version number, so let's explicitly override the
generated value and set it to `serenityos`. Various other systems do
this as well.
2021-05-06 16:46:43 +01:00
Linus Groh 8cfbeb78ff Ports: Remove Python printf fraction length patch
This functionality was implemented in f0fe449, making the patch
unnecessary.
2021-05-06 15:26:49 +01:00
Linus Groh 9f970c3459 Ports: Register Browser in the Python webbrowser module
This makes the following work:

    >>> import webbrowser
    >>> webbrowser.open("http://serenityos.org")

As well as this well-known easter egg:

    >>> import antigravity

Pretty cool! :^)
2021-05-06 14:26:09 +01:00
Linus Groh e76342e242 Ports: Update Python to 3.9.5
Released on 2021-05-03.
https://www.python.org/downloads/release/python-395/
2021-05-06 13:04:38 +01:00
Gunnar Beutner adaf2b347c Ports: Remove obsolete patches for Python
This enables shared library support for Python and removes
a few patches which are not necessary anymore now that
we have dlfcn support.
2021-04-25 10:14:50 +02:00
Brian Gianforcaro 0398e4a48a Ports: Fix python3 package so linting script doesn't error out.
I have my environment configured to use https://pre-commit.com/.
I guess the scripts were changed recently to lint all ports, and
the python port was barfing on my system because of this bug.
2021-04-25 00:57:36 +02:00
Linus Groh b06f68c3d2 Ports: Fix Python _crypt module linkage error
we need to link against LibCrypt and subsubsequently LibCore (which
LibCrypt does not link against itself due to a circular dependency
issue).
Not sure why this broke, it worked when I last updated the port.
2021-04-21 23:35:35 +02:00
Panagiotis Vasilopoulos e45e0eeb47 Everywhere: Replace SERENITY_ROOT with SERENITY_SOURCE_DIR 2021-04-20 15:27:52 +02:00
Linus Groh a9fa3fb095 Ports: Update Python to 3.9.4
Released on 2021-04-04 as a hotfix release superseding 3.9.3.
https://www.python.org/downloads/release/python-394/
2021-04-06 22:25:33 +02:00
Linus Groh 563712abce Ports: Build Python with --disable-ipv6
The addition of some IPv6 related things makes the configure script
think we support it now. We don't.
2021-04-01 22:49:44 +02:00
Linus Groh 4e2d4b193a Ports: Get Python's --build value from config.guess 2021-04-01 20:54:05 +02:00
Linus Groh f318ab6bed Ports: Replace hardcoded Build/ paths with SERENITY_BUILD_DIR
Fixes #5710.
2021-03-11 21:01:29 +01:00
Linus Groh 4166765292 Ports: Update Python to 3.9.2
Released on 2021-02-19, no patch changes required.
https://www.python.org/downloads/release/python-392/
2021-02-21 21:44:52 +01:00
Ben Wiederhake 87e4bcdf69 Everywhere: Canonicalize 'ReadMe' capitalization
We now follow a common capitalization throughout the project:

./Ports/openssh/ReadMe.md
./Ports/python3/patches/ReadMe.md
./Ports/ReadMe.md
./Meta/Lagom/ReadMe.md
./ReadMe.md

This filename is still obvious enough to be seen immediately.
2021-02-15 07:41:16 +01:00
Linus Groh de676bbf97 Ports: Build python3 with zlib
With the right include paths and linker flags, the _zlib module now
builds & works. :^)
2021-02-02 16:53:06 +01:00
Linus Groh 404dab5383 Ports: Build most python3 extension modules statically
Attempting to import C-extensions (lib-dynload/*.so) currently asserts
in the dynamic loader - let's just build them statically instead for the
time being.
This makes a large number of modules available for use and the port a
lot more functional! :^)
2021-02-02 16:53:06 +01:00
Linus Groh 92908259b8 Ports: Tweak shebang of python3's package.sh
This was missed in c702845.
2021-01-23 08:28:25 +01:00
Linus Groh efc091df81 Ports: Build python3 with libffi
This makes building the _ctypes module succeed. We still can't import
it, but hey, that's progress! :^)
2021-01-22 11:10:01 +01:00
Linus Groh cb8e4be3b5 Ports: Add missing version.sh file to python3 port
I thought I had committed this, but it's .gitignore'd. Add an exception
to Ports/.gitignore and add it for real this time. :^)

Fixes #5008.
2021-01-19 22:18:32 +01:00
Linus Groh 39af1f8519 Ports: Add Python 3.9
The current version of our Python port (3.6.0) is over four years old by
now and has (or had, I haven't actually tried it in a while) some
limitations - time for an upgrade! The latest Python release is 3.9.1,
so I used that version. It's a from-scratch port, no patches are taken
from the previous port to ensure the smallest possible amount of code is
patched. The BuildPython.sh script is useful so I kept it, with some
tweaks. I added a short document explaining each patch to ease judging
their underlying problem and necessity in the future.

Compared to the old Python port, this one does support both the time
module as well as threading (at least _thread) just fine. Importing
modules written in C (everything in /usr/local/lib/python3.9/lib-dynload)
currently asserts in Serenity's dynamic loader, which is unfortunate but
probably solvable. Possibly related to #4642. I didn't try building
Python statically, which might be one possibility to circumvent this
issue.

I also renamed the directory to just "python3", which is analogous to
the Python 3.x package most Linux distributions provide. That implicitly
means that we likely will not support multiple versions of the Python
port at any given time, but again, neither do many other systems by
default. Recent versions are usually backwards compatible anyway though,
so having the latest shouldn't be a problem.
On the other hand bumping the version should now be be as simple as
updating the variables in version.sh, given that no new patches are
required.

These core modules to currently not build - I chose to ignore that for
now rather than adding more patches to make them work somehow, which
means they're fully unavailable. This should probably be fixed in
Serenity itself.

    _ctypes, _decimal, _socket, mmap, resource, termios

These optional modules requiring 3rd-party dependencies do currently not
build (even with depends="ncurses openssl zlib"). Especially the absence
of a readline port makes the REPL a bit painful to use. :^)

    _bz2, _curses, _curses_panel, _dbm, _gdbm, _hashlib, _lzma, _sqlite3,
    _ssl, _tkinter, _uuid, nis, ossaudiodev, readline, spwd, zlib

I did some work on LibC and LibM beforehand to add at least stubs of
missing required functions, it still encounters an ASSERT_NOT_REACHED()
/ TODO() every now and then, notably frexp() (implementations of that
can be found online easily if you want to get that working right now).
But then again that's our fault and not this port's. :^)
2021-01-18 22:28:56 +01:00