wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.33k stars 515 forks source link

Prerequisite libsdl-ttf2.0-0 (for Xenial) not mentioned anywhere #1028

Open bittner opened 6 years ago

bittner commented 6 years ago

We're installing wheels on Travis in a Xenial-based build environment, hence we run:

pip3 install --find-links \
    https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython

When the tests run and try to import wx in the test the following error occurs: (build details)

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pythonturtle/application.py:10: in <module>
    import wx.adv
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   from ._adv import *
E   ImportError: libSDL-1.2.so.0: cannot open shared object file: No such file or directory

Installing libsdl-ttf2.0-0 fixes the problem: (similar to PyGame facing the same issue)

sudo apt-get install libsdl-ttf2.0-0

It looks like libsdl-ttf2.0-0 is a prerequisite for the wheel built for Xenial. However, I don't see this documented anywhere, not in the wxPython WIki, at least.

Would it make sense to document this somewhere? The wheel can't enforce this dependency (can it?), right? Can it be made to print a warning?

RobinD42 commented 6 years ago

The exception is the warning ;-)

The Ubuntu 16.04 build VM is configured with these dev packages, I guess the libsdl1.2-dev package is also pulling in libsdl-ttf2.0-0.

apt-get install -y libgtk2.0-dev libgtk-3-dev
apt-get install -y libjpeg-dev libtiff-dev \
    libsdl1.2-dev libgstreamer-plugins-base0.10-dev \
    libgstreamer-plugins-base1.0-dev \
    libnotify-dev freeglut3 freeglut3-dev libsm-dev \
    libwebkitgtk-dev libwebkitgtk-3.0-dev

While it's not too hard to keep this up to date (because builds will break if it's wrong) keeping a runtime dependency list up to date will be a bit more work, because it's possible (and likely) to change on every release of every distro.

Perhaps there could be an automated tool that uses ldd on the wxPython .so files and reports missing libs? I probably don't have time or interest to work on that but I'll look at a contribution for it.

bittner commented 4 years ago

I face the same issue now on Ubuntu 18.04 Bionic, and the missing package that needs to be installed this time is libsdl2-2.0-0.

The way you find this out is via the Package Search on the Ubuntu Packages website.