Skip to content

Instantly share code, notes, and snippets.

Last active October 21, 2023 18:24
Show Gist options
  • Save oleksis/0746bff4db6e2fc58c3bddf3f2672887 to your computer and use it in GitHub Desktop.
Save oleksis/0746bff4db6e2fc58c3bddf3f2672887 to your computer and use it in GitHub Desktop.
Compile wxPython 4.1.2a1 on openSUSE Tumbleweed

Compile wxPython from source on openSUSE Tumbleweed

Dev Tools

sudo zypper -n install -t pattern devel_basis
sudo zypper -n install gcc-c++ git wget

Requirement for build Python from source (Build dependencies)

sudo zypper -n install \
    readline-devel sqlite3-devel libbz2-devel \
    zlib-devel libopenssl-devel libffi-devel \
    ncurses-devel tk-devel ca-certificates gcc

Install wxPython 4 Dependencies

sudo zypper -n install \
    gtk3-devel gtk3-tools webkit2gtk3-devel \
    libjbig2 libjbig-devel libjpeg8 libjpeg8-devel \
    libpng16-16 libpng16-devel libtiff-devel \
    libSDL2-2_0-0 libSDL2-devel libSM6 libSM-devel\
    gstreamer gstreamer-devel gstreamer-plugins-base-devel \
    freeglut-devel libnotify4 libnotify-devel \
    libSM6 libSM-devel liblzma5 libXtst6 libXv1 \
    gdk-pixbuf-loader-rsvg gdk-pixbuf-query-loaders

Install Pyenv

curl -L | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> $HOME/.bashrc
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> $HOME/.bashrc
echo 'eval "$(pyenv init -)"' >> $HOME/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> $HOME/.bashrc
source $HOME/.bashrc

Custom Python build with --enable-shared

PYTHON_CONFIGURE_OPTS="--enable-shared" \
    pyenv install 3.8.12

pyenv shell 3.8.12

Add python-config to the PATH

PATH=$(pyenv root)/versions/${PYENV_VERSION}/bin:$PATH

Build wxPython from source

git clone

cd Phoenix

git submodule update --init --recursive

pip install -r requirements.txt

python clean

python dox etg --nodoc sip build_wx -v

Create simbolic link to build/wxbld/gtk3/lib64

ln -s lib build/wxbld/gtk3/lib64

Continue with build for Python

python build_py -v

Create wheel

python bdist_wheel

Test wxPython

pip install dist/wxPython-4.1.2a1-cp38-cp38-linux_x86_64.whl
python -c "import wx; print(wx.version());"

Good Luck!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment