Compile wxPython 4.2.0 from PyPI using pyenv 2.3.3

Set environment variables for OpenSSL:

OPENSSL_DIR=/usr/local/ssl
LD_LIBRARY_PATH=${OPENSSL_DIR}/lib

Download, compile and install OpenSSL

wget -q https://www.openssl.org/source/openssl-1.1.1q.tar.gz 
tar -xzf openssl-1.1.1q.tar.gz
pushd openssl-1.1.1q
./config --prefix=${OPENSSL_DIR} --openssldir=${OPENSSL_DIR} shared zlib
make
sudo make install
popd
rm -rf openssl-1.1.1 openssl-1.1.1.tar.gz

Build Python with --enable-shared

CPPFLAGS="-O2 -I${OPENSSL_DIR}/include" \
CFLAGS="-I${OPENSSL_DIR}/include" \
LD_FLAGS="-L${LD_LIBRARY_PATH} -Wl,-rpath,${LD_LIBRARY_PATH}" \
LD_RUN_PATH="${LD_LIBRARY_PATH}" \
CONFIGURE_OPTS="--with-openssl=${OPENSSL_DIR}" \
PYTHON_CONFIGURE_OPTS="--enable-shared" \
pyenv install 3.10.6

Install wxPython 4.2.0 using python-config

attrdict3 needed for build wxPython 4.2.0 see issue

pyenv global 3.10.6
pyenv exec python -m pip install attrdict3 # issue/2225
pyenv exec python -m pip install wxpython

Testing wxPython: 4.2.0 gtk3 (phoenix) wxWidgets 3.2.0

pyenv exec python -c "import wx; print(wx.version());"

Download wheel