conda-forge / sfml-feedstock

A conda-smithy repository for sfml.
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

Update feedstock to support Ubuntu 20.04 ? #4

Open traversaro opened 3 years ago

traversaro commented 3 years ago

I tried to use the sfml to build an example program (see https://github.com/traversaro/depend_on_me/pull/1/checks?check_run_id=3845501773), but it seems that on Ubuntu 20.04 it is not building correctly due to the missing library libudev.0, see:

[ 50%] Building CXX object src/CMakeFiles/sfml_program.dir/main.cpp.o
[100%] Linking CXX executable sfml_program
/usr/bin/ld: warning: libudev.so.0, needed by /usr/share/miniconda/envs/depend-on-me-env-env/lib/libsfml-window.so.2.5.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/share/miniconda/envs/depend-on-me-env-env/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_get_devnode'
/usr/bin/ld: /usr/share/miniconda/envs/depend-on-me-env-env/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_enable_receiving'
/usr/bin/ld: /usr/share/miniconda/envs/depend-on-me-env-env/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_new_from_syspath'
/usr/bin/ld: /usr/share/miniconda/envs/depend-on-me-env-env/lib/libsfml-window.so.2.5.1: undefined reference to `udev_device_unref'
/usr/bin/ld: /usr/share/miniconda/envs/depend-on-me-env-env/lib/libsfml-window.so.2.5.1: undefined reference to `udev_monitor_new_from_netlink'
/usr/bin/ld: /usr/share/miniconda/envs/depend-on-me-env-env/lib/libsfml-window.so.2.5.1: undefined reference to `udev_enumerate_get_list_entry

If I understood the issue correctly, for having a build of sfml that works correctly on Ubuntu 20.04 it could make sense to do what was done for libusb in https://github.com/conda-forge/libusb-feedstock/pull/16 , with a cos6 build that still uses the udev CDT, and a cos7 build that instead uses the libudev conda package. What do you think @conda-forge/sfml ? If you agree, I can prepare a PR for doing that.

wolfv commented 3 years ago

Just as a side note: an improper fix could be to install libudev0 from apt-get. It's a compatibility wrapper but I'm not sure it's available for all versions of ubuntu though.

traversaro commented 3 years ago

Just as a side note: an improper fix could be to install libudev0 from apt-get. It's a compatibility wrapper but I'm not sure it's available for all versions of ubuntu though.

I quickly checked and it does not seem that libudev0 is available in Focal 20.04 : https://packages.ubuntu.com/impish/libudev0 .

nthiery commented 10 months ago

For information: the problem seems to be still there. I am working around it by:

cd $CONDA_PREFIX/lib
ln -s libudev.so.1 libudev.so.0

but it's not quite satisfactory :-)

martinRenou commented 8 months ago

I wonder if the latest build fixes this? Do we see this with SFML 2.6?

traversaro commented 8 months ago

I do not a Ubuntu 20.04 system/image ready to test, if someone checked this for me it is ok to close.

nthiery commented 8 months ago

Will try later today!

RaulPPelaez commented 1 month ago

This is a problem for me in Fedora 40 still. This package tries to link with "libudev.so.0", but this is not a runtime dependency, so you get link errors:

x86_64-conda-linux-gnu/bin/ld: warning: libudev.so.0, needed by /home/raul/miniforge3/envs/test/lib/libsfml-window.so.2.6.1, not found (try using -rpath or -rpath-link)

One solution that works for me is to manually conda install libudev and then create the symlink as in https://github.com/conda-forge/sfml-feedstock/issues/4#issuecomment-1822459695

As the user points out this is not satisfactory -.-

traversaro commented 1 month ago

As now conda-forge moved on from cos6 and use cos7 as base, I think a simple solution is just to switch to depend on libudev.