oversteer icon indicating copy to clipboard operation
oversteer copied to clipboard

Flatpak Port

Open B0BP4G3 opened this issue 1 year ago • 7 comments

Any chance to have a port to Flatpak for easy installs on Steam Deck, or maybe you'd allow me or someone else to port it there?

B0BP4G3 avatar May 08 '23 14:05 B0BP4G3

I'm going to note here that I will gladly help on providing tips and guiding the porting of this to Flatpak. I'd appreciate a matrix channel though, for general project discussion as well as this.

Oversteer would need the following changes:

  • Use portals where possible
  • Use pkexec to install the udev rules
  • Go through Flatpak-spawn for pkexec if running in a sandbox
  • versions in the metadata file

Ideally oversteer would be Wayland-native to make sure it shows up well on Flathub too, if it isn't already. Oversteer should also stop assuming it's running in distro packages, and instead try and go for a more neutral style.

orowith2os avatar May 08 '23 15:05 orowith2os

PRs are welcome.

Edit: There's a Matrix channel dedicated to simracing projects here.

berarma avatar May 08 '23 16:05 berarma

Alright, I'll join it.

B0BP4G3 avatar May 08 '23 18:05 B0BP4G3

Hey i too can't make a thing on how to install this software! Is there any estimate for this simple flatpak package? Thank you alot

vrement avatar Oct 18 '23 18:10 vrement

Hi, is anyone working on this? I'm new to building flatpaks, but I'm willing to contribute. I've gotten as far as putting in most of the python dependencies in. As of now, the build fails when it tries to get udev via pkg-config and cmake:

Pkg-config binary for 1 is not cached.
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: /usr/bin/pkg-config (2.1.1)
Determining dependency 'udev' with pkg-config executable '/usr/bin/pkg-config'
env[PKG_CONFIG_PATH]: /app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
-----------
Called: `/usr/bin/pkg-config --modversion udev` -> 1
stderr:
Package udev was not found in the pkg-config search path.
Perhaps you should add the directory containing `udev.pc'
to the PKG_CONFIG_PATH environment variable
Package 'udev', required by 'virtual:world', not found
-----------
CMake binary for 1 is not cached
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: /usr/bin/cmake (3.28.3)
Extracting basic cmake information
Try CMake generator: auto
Calling CMake (['/usr/bin/cmake']) in /run/build/oversteer/_flatpak_build/meson-private/cmake_udev with:
  - "--trace-expand"
  - "--trace-format=json-v1"
  - "--no-warn-unused-cli"
  - "--trace-redirect=cmake_trace.txt"
  - "-DCMAKE_TOOLCHAIN_FILE=/run/build/oversteer/_flatpak_build/meson-private/cmake_udev/CMakeMesonToolchainFile.cmake"
  - "."
  -- Module search paths:    ['/', '/usr']
  -- CMake root:             /usr/share/cmake-3.28
  -- CMake architectures:    ['aarch64-linux-gnu', 'arm-linux-gnueabihf', 'i386-linux-gnu', 'x86_64-linux-gnu']
  -- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share', '', 'lib/aarch64-linux-gnu', 'lib/arm-linux-gnueabihf', 'lib/i386-linux-gnu', 'lib/x86_64-linux-gnu']
Preliminary CMake check failed. Aborting.
Run-time dependency udev found: NO (tried pkgconfig and cmake)

Looking at the meson.build file, its looking for udev, which afaik, isn't possible in a flatpak. Maybe it should look for libudev instead?

Edit: I realize that the meson build is looking for a path. I've created a workaround patch to set the path in meson_options.txt and apply it during the flatpak build.

jo5huajohn avatar Mar 08 '24 17:03 jo5huajohn

I've got the flatpak running, but as expected, it cannot detect devices. I'm sorta stuck here, trying to come up with a workaround.

jo5huajohn avatar Mar 09 '24 21:03 jo5huajohn

It was expected. Since Flatpak applications run inside containers they can't access udev directly.

I recall some weeks ago a Flatpak dev was asking for examples of applications which needed udev to work. I think it was on Twitter. You might want to ask them about that.

berarma avatar Mar 09 '24 21:03 berarma

I found the tweet and it looks like the idea is still being floated around. I let them know about oversteer in case they wanted to take a look. I guess we can get users to install the udev rules manually as a workaround? I got the application working after sharing the /sys/devices, sys/class/leds , and /run/udev directories. Sharing these directories isn't a good idea, but it is a workaround. I'm open to other ideas though.

jo5huajohn avatar Mar 17 '24 16:03 jo5huajohn

I've created https://github.com/berarma/oversteer/pull/198 if anyone wants to check it out.

jo5huajohn avatar Apr 21 '24 00:04 jo5huajohn

Please, follow at #198.

berarma avatar Apr 28 '24 09:04 berarma