* +python2

* at least a few tests working

* clean up semverator dep
This commit is contained in:
Jacob Heider 2023-06-16 15:51:31 -04:00 committed by GitHub
parent 9be105f85d
commit 446534afbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 20 deletions

View file

@ -43,18 +43,31 @@ build:
tea.xyz/gx/cc: c99 tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*' tea.xyz/gx/make: '*'
freedesktop.org/pkg-config: ^0.29 freedesktop.org/pkg-config: ^0.29
crates.io/semverator: '*' gnu.org/patch: '*'
curl.se: '*'
script: script:
# MacPorts has a series of patches to keep python2 working
- run: |
for PATCH in $PYTHON2PATCHES; do
curl -sSL $PATCH | patch -p0
done
if: ^2
# fixes the build scripts so they use the standard environment variables we set # fixes the build scripts so they use the standard environment variables we set
- | - |
sed -i.bak -e 's|system_lib_dirs = .*|system_lib_dirs = os.getenv("LIBRARY_PATH").split(":")|' ./setup.py sed -i.bak -e 's|system_lib_dirs = .*|system_lib_dirs = os.getenv("LIBRARY_PATH").split(":")|' ./setup.py
sed -i.bak -e 's|system_include_dirs = .*|system_include_dirs = os.getenv("CPATH").split(":")|' ./setup.py sed -i.bak -e 's|system_include_dirs = .*|system_include_dirs = os.getenv("CPATH").split(":")|' ./setup.py
# older versions use a different config dir # older versions use a different config dir
- | - run: |
if semverator satisfies '<3.8' {{ version }}; then confdir="$libdir/config"
# older versions use a different config dir
# aarch64 not happy with this
ARGS=${ARGS/--with-ensurepip/--without-ensurepip}
if: ^2
# 3.7 and older use `3.7m` for config dir
- run: |
confdir=$(echo $confdir | sed -e 's/\(config-{{ version.marketing }}\)/\1m/') confdir=$(echo $confdir | sed -e 's/\(config-{{ version.marketing }}\)/\1m/')
# 3.7 and older use `python3.7m` for include dir # 3.7 and older use `python3.7m` for include dir
@ -62,7 +75,7 @@ build:
# 3.7 aborts on linux+aarch64 with this # 3.7 aborts on linux+aarch64 with this
ARGS=${ARGS/--with-ensurepip/--without-ensurepip} ARGS=${ARGS/--with-ensurepip/--without-ensurepip}
fi if: '>=3<3.8'
- ./configure $ARGS - ./configure $ARGS
- make --jobs {{ hw.concurrency }} - make --jobs {{ hw.concurrency }}
@ -150,6 +163,8 @@ build:
darwin: darwin:
confdir: confdir:
$libdir/config-{{version.marketing}}-darwin $libdir/config-{{version.marketing}}-darwin
PYTHON2PATCHES:
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-getpath.diff
linux: linux:
# ARGS: # ARGS:
# - --with-dbmliborder=bdb # - --with-dbmliborder=bdb
@ -164,6 +179,19 @@ build:
OPENSSL_INCLUDES: ${{ deps.openssl.org.prefix }}/include OPENSSL_INCLUDES: ${{ deps.openssl.org.prefix }}/include
OPENSSL_LDFLAGS: -L{{ deps.openssl.org.prefix }}/lib OPENSSL_LDFLAGS: -L{{ deps.openssl.org.prefix }}/lib
PYTHON2PATCHES:
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-Makefile.pre.in.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-setup.py.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-Lib-cgi.py.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-Lib-ctypes-macholib-dyld.py.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-configure.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-libedit.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/enable-loadable-sqlite-extensions.patch
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/patch-_osx_support.py.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/darwin20.diff
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/arm.patch
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/implicit.patch
- https://raw.githubusercontent.com/macports/macports-ports/master/lang/python27/files/openssl_ver.patch
test: test:
dependencies: dependencies:
@ -172,21 +200,24 @@ test:
script: script:
# Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions # Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions
# and it can occur that building sqlite silently fails if OSX's sqlite is used. # and it can occur that building sqlite silently fails if OSX's sqlite is used.
- python -c "import sqlite3" - run: python -c "import sqlite3"
# FIXME: v2
if: ^3
# check to see if we can create a venv # check to see if we can create a venv
# we can't ensurepip on 3.7 so, this won't work # we can't ensurepip on 3.7 so, this won't work
- | - run: python -m venv myvenv
if semverator satisfies '^3.8' {{ version }}; then if: ^3.8
python -m venv myvenv
fi
# Check if some other modules import. Then the linked libs are working. # Check if some other modules import. Then the linked libs are working.
- | - run: |
python -c "import _ctypes" python -v -c "import _ctypes"
# python -c "import _decimal" #FIXME # python -c "import _decimal" #FIXME
python -c "import pyexpat"
python -c "import zlib" python -c "import zlib"
# FIXME: v2
if: ^3
- python -c "import pyexpat"
# Verify that the selected DBM interface works # Verify that the selected DBM interface works
# FIXME: doen't work # FIXME: doen't work
@ -214,7 +245,7 @@ test:
#include <python{{version.major}}.{{version.minor}}/Python.h> #include <python{{version.major}}.{{version.minor}}/Python.h>
- run: | - run: |
if semverator satisfies '<3.8' {{ version }}; then if semverator satisfies '>=3<3.8' {{ version }}; then
SUFFIX=m SUFFIX=m
fi fi
test $(python $FIXTURE) = {{prefix}}/include/python{{version.marketing}}$SUFFIX test $(python $FIXTURE) = {{prefix}}/include/python{{version.marketing}}$SUFFIX

View file

@ -1,13 +1,13 @@
import site import site
import sys import sys
# tea considers /usr/local the “global install” location # tea considers /usr/local the "global install" location
# setting `sys.prefix` is kinda nuts but brew does the same # setting `sys.prefix` is kinda nuts but brew does the same
# so were assuming they vetted all options # so we're assuming they vetted all options
# sys.prefix = "/usr/local" # sys.prefix = "/usr/local"
# ^^ undid this because it broke `python -m venv` installing pip for some reason # ^^ undid this because it broke `python -m venv` installing pip for some reason
# enable automatic user installs if pip makes the decision # enable automatic user installs if pip makes the decision
# that this is good idea. eg. if /usr/local isnt writable # that this is good idea. eg. if /usr/local isn't writable
# this is what it will do # this is what it will do
site.ENABLE_USER_SITE = True site.ENABLE_USER_SITE = True