Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Add an option to get rid of the udev client libraries on Linux  (Read 8149 times)

0 Members and 1 Guest are viewing this topic.

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Hi,

You may have heard that Flatpak has been released. It's a tool that allows to build standalone apps on Linux (compatible with all the distributions that support it). For more information : http://flatpak.org/

The problem is that no runtimes (if you don't know what a "runtime" is in flatpak, please read the website) provides udev and none will ever do because udev is not ABI-compatible with each Linux distributions (see the discussions I had with the devs here : https://github.com/flatpak/flatpak/issues/12#issuecomment-230249440).

So, it's currently not possible to build SFML for flatpak as udev is not provided. That's why it would be great if SFML provides a build option to disable the udev dependency. The only problem is joysticks support as it is the only feature that requires udev in SFML. But it seems that it's not mandatory (SDL can work without udev if needed) except for the joystick hot plug.

aggsol

  • Newbie
  • *
  • Posts: 24
  • C++
    • View Profile
    • My Github Account
Re: Add an option to get rid of the udev client libraries on Linux
« Reply #1 on: March 26, 2018, 09:38:09 am »
How is the state today with Flatpack and SFML?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Add an option to get rid of the udev client libraries on Linux
« Reply #2 on: March 26, 2018, 09:57:30 am »
It's a niche situation. SFML can be modified by whoever wants to maintain the flatpak package, but we generally don't build in "features" to make it more compatible with some niche package manager, especially when it's about disabling functionality.

If there's a better alternative to udev, then making a proposal to adapt would probably be looked at.

FYI: Even the Debian packages are built with slight modifications to accommodate their quirky setup.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

aggsol

  • Newbie
  • *
  • Posts: 24
  • C++
    • View Profile
    • My Github Account
Re: Add an option to get rid of the udev client libraries on Linux
« Reply #3 on: March 26, 2018, 12:27:30 pm »
Sounds sensible. What is a good way to package an SML application for Linux then?

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: Add an option to get rid of the udev client libraries on Linux
« Reply #4 on: March 30, 2018, 11:24:20 am »
Honestly, AppImage is the simplest solution out there in my view.  It's essentially bundling your binary and all of your dependencies into one file, which the user can download, mark as executable, and then run. 

Taken from Wikipedia

Quote
AppImage does not install the application in the traditional Linux sense by putting its various files in the distro's appropriated places in the file system, just like its predecessors klik and portablelinuxapps. The AppImage file is just its compressed image; this is mounted with FUSE when it runs.

It uses one file per application. Each one is self-contained: it includes all libraries the application depends on that are not already part of the targeted base-system. An AppImage of version 1.0 is an ISO 9660 Rock Ridge file (which can be optionally zisofs compressed) containing a minimal AppDir and a tiny runtime.[4] (Version 2 may use other file system image formats like SquashFS [5][6]). An AppImage application can be added to a live CD by adding only one file to the live CD.

AppImage files are simpler than installing an application. No extraction tools are needed, nor is it necessary to modify the operating system or user environment. Regular users on the common Linux distributions can download it, make it executable, and run it.

https://appimage.org/

richardeigenmann

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: Add an option to get rid of the udev client libraries on Linux
« Reply #5 on: August 09, 2019, 11:07:01 pm »
There is a special version of udev on the Flatpak git repo that you can clone which overrides the incompatibility with the sandbox. By using that you can build SFML from source and then use that to compile your program against.

Here is an example project where this was implemented:
https://github.com/richardeigenmann/LearnSfml

 

anything