# -*- coding: ascii; tab-width: 4; x-counterpart: python27.patch -*- Info2: << Package: python%type_pkg[python] Version: 2.7.18 Revision: 2 Epoch: 1 Type: python 2.7 Maintainer: Daniel Johnson Depends: << %N-shlibs (= %e:%v-%r), blt-shlibs, bzip2-shlibs, db53-aes-shlibs, expat1-shlibs (>= 2.2.5-1), fink (>= 0.34.8), gdbm4-shlibs, libffi6-shlibs, libgettext8-shlibs, libncursesw5-shlibs, openssl110-shlibs (>= 1.1.1d-1), readline7-shlibs, sqlite3-shlibs (>= 3.23.1-1), tcltk (>= 8.4.1-1), x11 << BuildDepends: << blt-dev (>= 2.4z-15), bzip2-dev, db53-aes, expat1 (>= 2.2.5-1), fink (>= 0.32), gdbm4, gettext-bin, gettext-tools, libffi6, libgettext8-dev, libncursesw5, readline7, sqlite3-dev (>= 3.23.1-1), openssl110-dev (>= 1.1.1d-1), tcltk-dev (>= 8.4.1-1), x11-dev << # Python 2.7.9+ 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] Source: http://python.org/ftp/python/%v/Python-%v.tar.xz Source-Checksum: SHA256(b62c0e7937551d0cc02b8fd5cb0f544f9405bafc9a54d3808ed4594812edef43) Source2: http://www.python.org/ftp/python/doc/%v/python-%v-docs-html.tar.bz2 Source2-Checksum: SHA256(20445e9a571cacdd350f702f0980e4dc559b6ff81f1d69affe9b0a862fef2f0e) PatchFile: %n.patch PatchFile-MD5: 828380d012fe11d6fc03dea8647bec99 PatchScript: << 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 perl -pi -e 's/ -lSystemStubs//' ./configure perl -pi -e 's/-O3/-fwrapv -O3/' ./configure perl -pi -e 's|num_missing != 5:|num_missing != 7:|g; s|have 5 missing|have 7 missing|' ./setup.py << UseMaxBuildJobs: true ConfigureParams: << --enable-shared \ --with-dbmliborder=gdbm \ --with-system-expat \ --with-system-ffi \ --with-tcltk-includes="-I%p/include -I/opt/X11/include" \ --with-tcltk-libs="-L%p/lib -ltcl -ltk" \ --without-ensurepip \ --disable-toolbox-glue << CompileScript: << #!/bin/sh -ex # 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 SDK_PATH="$(xcrun --sdk macosx --show-sdk-path)" export CFLAGS="-Wno-nullability-completeness" export CPPFLAGS="-I%p/include -I%p/include/ncursesw -I$SDK_PATH/usr/include" 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 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 echo "If the build fails here, please see" echo "http://www.finkproject.org/faq/comp-general.php?phpLang=en#missing-usr-include-headers" echo "for the most likely solution." << InfoTest: << TestConflicts: pyxml-py%type_pkg[python], gnome-applets, 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/python%type_raw[python]/config/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/python%type_raw[python]/config/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", # the other 4 hang indefinitely EXTRATESTOPTS='-w -x test_socket test_distutils test_ssl test_multiprocessing_spawn test_asyncio test_httpservers test_logging test_xmlrpc' 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/python%type_raw[python]/config/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/python%type_raw[python]/config/libpython%type_raw[python].dylib {} \; install_name_tool -id %p/lib/python%type_raw[python]/config/libpython%type_raw[python].dylib libpython%type_raw[python].dylib # Remove stray .pyc that get made during tests to keep validator happy. find ./Tools -name "*.pyc" -delete exit $TESTRETURN << << InstallScript: << #!/bin/sh -ex # Rebuild _sysconfigdata.py if we ran tests. make # _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,' `ls -d %b/build/lib*`/_sysconfigdata.py # Don't propagate -lintl to other packages. perl -pi -e 's/-lintl //' `ls -d %b/build/lib*`/_sysconfigdata.py 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/Makefile # fix all main things to be python-versioned filenames with # unversioned symlinks to them pushd %i/bin for f in 2to3 idle pydoc smtpd.py; do mv ${f} ${f}%type_raw[python] ln -s ${f}%type_raw[python] %i/bin/${f} done popd ln -s python%type_raw[python].1 %i/share/man/man1/python%type_pkg[python].1 # Add symlink to %p/lib. ln -s %p/lib/python%type_raw[python]/config/libpython%type_raw[python].dylib %i/lib/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] mkdir -p %i/share/doc/%n /bin/cp -R Demo Doc %i/share/doc/%n mkdir -p %i/share/doc/%n/html /bin/cp -R ../python-%v-docs-html/ %i/share/doc/%n/html << SplitOff: << Package: %N-shlibs Files: lib/libpython%type_raw[python].dylib lib/python%type_raw[python]/config/libpython%type_raw[python].dylib Shlibs: %p/lib/python2.7/config/libpython2.7.dylib 2.7.0 %n (>= 1:2.7-1) DocFiles: README LICENSE << SplitOff2: << Package: python Depends: %N (>= %e:%v-%r) Conflicts: python-nox Replaces: python-nox, python25 (<< 1:2.5.1-3) Files: << bin/2to3 bin/idle bin/pydoc bin/python bin/python2 bin/python-config bin/python2-config bin/smtpd.py lib/pkgconfig/python.pc lib/pkgconfig/python2.pc share/man/man1/python.1 << DocFiles: README 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 2.x interpreter you need. << << DocFiles: README 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 interpretter is installed as "python%type_raw[python]", and all associated commands are similarly named with the python-version in them. To get the simple "python" command, install the fink package "python" (note: the "python" command there is not guaranteed to be python%type_raw[python]!). << DescUsage: << python%type_raw[python] 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: << Patch a lot of things to impliment shared-lib support for non-Framework build on Darwin. Static libpython is installed in lib/pythonX.X/config/ but shared goes in %p/lib by default. Fink's packaging has always placed manually-built shared lib in config/ along side static, This gives consistency regardless of -search_paths_first. Continue this practice so that -pyXX varianted packages don't need special-casing for certain variants. Make sure all compiled modules link against libpython%type_raw[python] (and propagate this to third-party compiled modules) to ensure that all symbols resolved at compile-time to avoid packager mistakes and user runtime surprises. Play lots of games to make sure we get expected support libraries. Adjust "python" unversioned link to be a symlink not a hard link. Must remain Epoch'ed so that this "python" pkg to be newer than the one from lower %v pkgs. Shared lib is buried next to static one instead of being in %p/lib because that's where it's always been in the fink package series. Why would they be in different places? Patch -config script to continue this tradition (bug in previous versions accidentally did the Right Thing here). << DescPort: << Patch setup.py to find ncursesw headers and drop libncurses5 dep. platform.mac_ver now works on 64 bit, but leave our posix.uname fallback in just in case. Fink's gdbm3 installs %p/include/ndbm.h but python expects %p/include/gdbm/ndbm.h so python ends up using /usr/include/ndbm.h but the lib from gdbm3 which is, shall we say, bad. Force it to find %p/include/ndbm.h instead. test_ctypes fails with clang unless _ctypes/_ctypes_test.c is built with -O0 so force that in setup.py. Patch ctypes to look in %p/lib for libraries. Upstream patch to build with readline 6.3. Upstream patch from https://bugs.python.org/issue27369 to fix tests with expat 2.2.0. Call build executable by correct filename in test suite (python on case-sensitive, python.exe on -insensitive file systems). << License: OSI-Approved Homepage: http://www.python.org <<