Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
283 changes: 283 additions & 0 deletions 10.9-libcxx/stable/main/finkinfo/languages/python311.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
# -*- coding: ascii; tab-width: 4; x-counterpart: python310.patch -*-
Info2: <<
Package: python%type_pkg[python]
Version: 3.11.2
Revision: 1
Type: python 3.11
# Free to modify, update, and take over
Maintainer: Derek Homeier <[email protected]>
Depends: <<
%N-shlibs (= %v-%r),
blt-shlibs,
bzip2-shlibs,
expat1-shlibs (>= 2.2.8-1),
fink (>= 0.34.8),
gdbm6-shlibs,
libffi8-shlibs,
libgettext8-shlibs,
liblzma5-shlibs,
libncursesw5-shlibs,
openssl300-shlibs (>= 3.0.1-1),
readline8-shlibs,
sqlite3-shlibs (>= 3.30.1-1),
tcltk (>= 8.4.1-1),
x11
<<
BuildDepends: <<
blt-dev (>= 2.4z-15),
bzip2-dev,
expat1 (>= 2.2.8-1),
fink (>= 0.32),
gdbm6,
gettext-bin,
gettext-tools,
libffi8,
libgettext8-dev,
liblzma5,
libncursesw5,
openssl300-dev (>= 3.0.1-1),
pkgconfig (>= 0.9.0-1),
readline8,
sqlite3-dev (>= 3.30.1-1),
tcltk-dev (>= 8.4.1-1),
x11-dev
<<
# See https://github.com/fink/fink-distributions/issues/193
BuildConflicts: uuid
# Python 3.4+ wants to install these packages but that conflicts with fink's.
Recommends: <<
pip-py%type_pkg[python],
setuptools-tng-py%type_pkg[python]
<<
Provides: <<
argparse-py%type_pkg[python],
enum34-py%type_pkg[python],
futures-py%type_pkg[python],
pathlib-py%type_pkg[python]
<<

Source: https://www.python.org/ftp/python/%v/Python-%v.tar.xz
Source-Checksum: SHA256(29e4b8f5f1658542a8c13e2dd277358c9c48f2b2f7318652ef1675e402b9d2af)

PatchFile: %n.patch
PatchFile-MD5: 2c1c108f70f54a8817d5d5b44f41fc1a

PatchScript: <<
#!/bin/sh -ex
sed 's|@PREFIX@|%p|g' < %{PatchFile} | patch -p1
# /tmp and /var/tmp are symlinks to /private/tmp and /private/var/tmp
# on OS X. That's fine except it can cause tests in some packages to
# fail since '/tmp' != '/private/tmp'. Default to using /private/tmp.
perl -pi -e "s|'/tmp', '/var/tmp'|'/private/tmp', '/private/var/tmp'|" Lib/tempfile.py
# reason for removing SystemStubs?
perl -pi -e 's/ -lSystemStubs//' ./configure
<<

ConfigureParams: <<
--enable-shared \
--enable-loadable-sqlite-extensions \
--enable-optimizations \
--with-dbmliborder=gdbm \
--with-pkgconfig=yes \
--with-system-expat \
--with-system-ffi \
--with-dtrace \
--without-ensurepip \
--enable-ipv6 \
TCLTK_CFLAGS="-I%p/include -I/opt/X11/include" \
TCLTK_LIBS="-L%p/lib -ltcl -ltk"
<<

CompileScript: <<
#!/bin/sh -ex
SDK_PATH="$(xcrun --sdk macosx --show-sdk-path)"
# for OS X 10.14, ensure full SDK is available, but include it after any fink specific versions.
#if [ "$(uname -r | cut -d. -f1)" -ge 18 ]; then
export CFLAGS="-Wno-nullability-completeness -Wno-expansion-to-defined"
# is this forced ordering needed on <= 10.14?
#export CPPFLAGS="-I%p/include -I%p/include/ncursesw -I$SDK_PATH/usr/include"
#perl -pi -e "s|/usr/include|$SDK_PATH/usr/include|" setup.py
#fi

# https://bugs.python.org/issue28456 and radar://28372390
# https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/
./configure %c $DIST_CONFIG_PARAMS
perl -pi -e 's|\#define HAVE_POLL 1||' ./pyconfig.h
perl -pi -e 's|\#define HAVE_POLL_H 1||g' ./pyconfig.h
perl -pi -e 's|\#define HAVE_SYS_POLL_H 1||g' ./pyconfig.h
make
<<

InfoTest: <<
TestConflicts: apple-gdb
TestScript: <<
#!/bin/sh -ex
# Change install_name of lib during tests since DYLD_LIBRARY_PATH is not exported to test_subprocess on 10.11+.
if [ -x python.exe ]; then
python_exe=python.exe
else
python_exe=python
fi
install_name_tool -change %p/lib/libpython%type_raw[python].dylib %b/libpython%type_raw[python].dylib $python_exe
/usr/bin/find `ls -d %b/build/lib*` -name *.so -exec install_name_tool -change %p/lib/libpython%type_raw[python].dylib %b/libpython%type_raw[python].dylib {} \;
install_name_tool -id %b/libpython%type_raw[python].dylib libpython%type_raw[python].dylib

# test_socket can fail with some DNS settings.
# multiprocessing_spawn fails on "KeyboardInterrupt not raised by wait",
# test_ctypes is currently broken on 12.0 (py3.10.1)
# test_tcl and test_idle require an active $DISPLAY
# test_select is missing attribute 'poll'
# test_pkgutil fails on HFS+ https://bugs.python.org/issue41154 (marked resolved)
# test_grp was failing on 3.10
EXTRATESTOPTS='-w -unone -x test_idle test_select test_tcl'
LANG=en_US.UTF-8 make -k test EXTRATESTOPTS="$EXTRATESTOPTS" || TESTRETURN=$?

# Put install_name back.
install_name_tool -change %b/libpython%type_raw[python].dylib %p/lib/libpython%type_raw[python].dylib $python_exe
/usr/bin/find `ls -d %b/build/lib*` -name *.so -exec install_name_tool -change %b/libpython%type_raw[python].dylib %p/lib/libpython%type_raw[python].dylib {} \;
install_name_tool -id %p/lib/libpython%type_raw[python].dylib libpython%type_raw[python].dylib

# remove leftovers from testing
# these dirs are empty and only created if tests are run
find ./Tools -name __pycache__ -type d -depth -exec rm -rf "{}" \;
exit $TESTRETURN
<<
<<

InstallScript: <<
#!/bin/sh -ex
# Rebuild _sysconfigdata.py if we ran tests.
find ./build -name _sysconfigdata.py -delete
make
# Remove stray .pyc that get made during tests (including preliminary ones in CompileScript) to keep validator happy.
find ./Lib ./Parser ./Tools ./build -name '*.pyc' -delete
# Change interpreter name in scripts to versioned executable.
perl -pi -e 's|(/usr/bin/env python)(3?)$|${1}%type_raw[python]|' ./Tools/scripts/*
# _sysconfigdata.py contains build-time variables that point to %b.
# This is harmless but upsets fink's validator.
# Change to %p/lib to make fink happy.
perl -pi -e 's,%b,%p/lib/python%type_raw[python]/config-%type_raw[python]-darwin,' `cat pybuilddir.txt`/_sysconfigdata__darwin_darwin.py
# Don't propagate -lintl to other packages.
perl -pi -e 's/-lintl //' `cat pybuilddir.txt`/_sysconfigdata__darwin_darwin.py
# install fails with -j greater than 1
export MAKEFLAGS=-j1
make install DESTDIR=%d

# we don't want -lintl to appear in LIBS otherwise python-config will propagate it
perl -pi -e 's/-lintl //' %i/lib/python%type_raw[python]/config-%type_raw[python]-darwin/Makefile
perl -pi -e 's,%b,%p/lib/python%type_raw[python]/config-%type_raw[python]-darwin,' %i/lib/python%type_raw[python]/config-%type_raw[python]-darwin/Makefile
# Fix all main things to be python-versioned filenames with unversioned symlinks to them.
pushd %i/bin
for f in idle3 pydoc3; do
mv ${f} ${f}-%type_raw[python]
ln -s ${f}-%type_raw[python] %i/bin/${f}
done
#Remove this for now to avoid conflicting with 'python' package.
rm 2to3
popd

# Add symlink to %p/lib/python%type_raw[python]/config-%type_raw[python]-darwin.
ln -s %p/lib/libpython%type_raw[python].dylib %i/lib/python%type_raw[python]/config-%type_raw[python]-darwin/libpython%type_raw[python].dylib

# install some docs and other useful tidbits
rm -rf Misc/RPM
/bin/cp -R Misc Tools %i/lib/python%type_raw[python]

# Some stuff still seems to be rebuilt/byte-compiled after `make`; empty f-string error in c-analyzer/c_parser/parser/_delim.py
pushd %i/lib/python%type_raw[python]
perl -pi -e 's,%b,%p/lib/python%type_raw[python]/config-%type_raw[python]-darwin,;s/-lintl //' _sysconfigdata__darwin_darwin.py
DYLD_LIBRARY_PATH=%i/lib %i/bin/python%type_raw[python] -m compileall -f -o 0 -o 1 -o 2 _sysconfigdata__darwin_darwin.py Tools || echo 'some files were not byte-compiled'

# Doc tarball missing upstream.
# mkdir -p %i/share/doc/%n/html
# /bin/cp -R ../python-%v-docs-html/ %i/share/doc/%n/html
<<
SplitOff: <<
Package: %N-shlibs
Depends: libgettext8-shlibs
Files: <<
lib/libpython%type_raw[python].dylib
lib/python%type_raw[python]/config-%type_raw[python]-darwin/libpython%type_raw[python].dylib
<<
Shlibs: %p/lib/libpython%type_raw[python].dylib 3.11.0 %n (>= 3.11.0-1)
DocFiles: README.rst LICENSE
<<
SplitOff2: <<
Package: python3
Depends: %N (>= %v-%r)
Files: <<
bin/idle3
bin/pydoc3
bin/python3
bin/python3-config
lib/pkgconfig/python3.pc
lib/pkgconfig/python3-embed.pc
share/man/man1/python3.1
<<
DocFiles: README.rst LICENSE
Description: Generic commands to invoke python%type_pkg[python]
DescDetail: <<
This package only contains non-versioned symlinks to the binaries included
with python%type_pkg[python].
<<
DescUsage: <<
This package should only be used when you don't care which version of the
python 3.x interpreter you need.
<<
<<
DocFiles: README.rst LICENSE
Description: Interpreted, object-oriented language
DescDetail: <<
Python is often compared to Tcl, Perl, Scheme or Java.
This package installs unix python - not the OSX Framework version.
Builds a two-level namespace dynamic libpython (needed for koffice).

The interpreter is installed as "python%type_raw[python]", and all associated
commands are similarly named with the python-version in them. To get
the simple "python3" command, install the fink package "python3" (note:
the "python3" command there is not guaranteed to be python%type_raw[python]!).
<<
DescUsage: <<
Python 3.10+ changes the compiler options used to compile
third-party python modules. Please do not add %type_raw[python] variants
to them without actually testing that they build cleanly.
<<

DescPackaging: <<
Adjust "python3" unversioned link to be a symlink not a hard link.

New in 3.2, .pyc files are saved in the __pycache__ directory
at the same level as the matching .py file. Any packages that
expect the .pyc file to be next to the .py file will need adjustment.

The .pyc and .so files also include the python version in the name.

Don't run ensurepip since it installs files that conflict with
the pip and setuptools packages.

Previous python packages went to great lengths to patch to use
%p/lib/python%type_raw[python]/config-%type_raw[python]-darwin
for libpython instead of %p/lib. Revert to using default library
location but make symlink in config dir.

Upstream no longer links extensions to libpython and use of
-undefined dynamic_lookup is recommended instead so remove those
patches.
<<
DescPort: <<
libpython needs to link to CF because that lib has the parent
thread that load modules that need to have CF available. See:
http://bugs.python.org/issue7085

bsddb is gone so drop db* patch and dep.
Patch setup.py to find ncursesw headers and drop libncurses5 dep.
Ensure $(LDFLAGS) is used linking libpython or else it can't find libintl.

Patch ctypes to look in %p/lib for libraries.

Call build executable by correct filename in test suite
(python on case-sensitive, python.exe on -insensitive file systems).
<<
License: OSI-Approved
Homepage: https://www.python.org/
<<
Loading