RVGL now on Arch Linux AUR

Post your own tools and resources, as well as your cars and tracks.
User avatar
svito
Posts: 13
Joined: Fri Mar 22, 2019 12:48 pm
Location: Ukraine

RVGL now on Arch Linux AUR

Unread post by svito » Sun May 05, 2019 12:21 pm

Some basics written in my words:
  • Arch Linux is operating system that uses pacman package manager.
  • pacman can install, remove and update packages and its dependencies and track what files belong to them so it can remove those or prevent conflicts where one package has same files as another package
  • to create new package one writes PKGBUILD file that is simple bash script where one has to define few variables like name, version and where to get files to put in a package and some functions on what to do with those files
  • finally one runs makepkg utility that goes over those defined functions and creates archive that contains all the files how they will be installed on system and has some metadata that was defined in PKGBUILD variables
How whole process looks:
  • AUR package maintainer (me) submits PKGBUILD (by using git) which only contains instructions on where to get the sources and how to prepare them
  • User searches for rvgl on AUR, finds my PKGBUILD, downloads it, reads and checks if it does not do anything malicious
  • User runs makepkg and it creates a package that can be installed with pacman
Usually though Arch Linux users have one of the many AUR helper tools installed which makes installing RVGL as simple as typing something like:

Code: Select all

-> aur sync rvgl-bin
See metadata of package:

Code: Select all

-> pacman -Qi rvgl-bin
Name            : rvgl-bin
Version         : 19.0430-1
Description     : Rewrite of Re-Volt, popular 3D RC car racing game from 1999.
Architecture    : x86_64
URL             : https://rvgl.re-volt.io
Licenses        : custom
Groups          : None
Provides        : None
Depends On      : sdl2_image  openal  enet  libunistring
Optional Deps   : rvgl-dcpack: dreamcast version frontend, cars, rooftops track [installed]
                  rvgl-soundtrack: community-made soundtrack [installed]
                  rvgl-soundtrack-orig: dreamcast version original soundtrack
Required By     : rvgl-cars  rvgl-dcpack  rvgl-loadlevel  rvgl-music  rvgl-skins  rvgl-soundtrack
                  rvgl-tracks
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 128.49 MiB
Packager        : Unknown Packager
Build Date      : Sat May 4 23:49:10 2019
Install Date    : Sun May 5 00:14:05 2019
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : SHA-256 Sum
Remove package:

Code: Select all

~> sudo pacman -R rvgl-bin
Search for available packs:

Code: Select all

~> aur search rvgl
aur/rvgl-bin 19.0430-1 (+0 0.00%) 
    Rewrite of Re-Volt, popular 3D RC car racing game from 1999.
aur/rvgl-cars 19.0317-1 (+0 0.00%) 
    Additional RVGL cars used for official events.
aur/rvgl-cars-bonus 18.0916-1 (+0 0.00%) 
    Additional RVGL cars not used for official events.
aur/rvgl-dcpack 18.1126-1 (+0 0.00%) 
    RVGL dreamcast content pack.
aur/rvgl-loadlevel 18.0326-1 (+0 0.00%) 
    Loading screens for RVGL custom tracks.
aur/rvgl-music 19.0415-1 (+0 0.00%) 
    Extra music for RVGL additional community tracks.
aur/rvgl-skins 19.0414-1 (+0 0.00%) 
    Additional RVGL skins for default cars and more.
aur/rvgl-soundtrack 18.1126-1 (+0 0.00%) 
    RVGL community-made sountrack.
aur/rvgl-soundtrack-orig 18.0327-1 (+0 0.00%) 
    RVGL original Dreamcast soundtrack.
aur/rvgl-superpros 19.0414-1 (+0 0.00%) 
    Overpowered cars for RVGL special events.
aur/rvgl-tracks 19.0414-1 (+0 0.00%) 
    Additional RVGL tracks for official events.
aur/rvgl-tracks-bonus 19.0414-1 (+0 0.00%) 
    Additional RVGL tracks not used for official events.
As you see most packs are already packaged in AUR. I can upload the rest, which are 2 clockwork packs, lmstag and month tracks, although month tracks files conflict with io_tracks and does not look up to date with Re-Volt Race.

All packages are installed system wide with read only permissions so if you want to add some content you can modify PKGBUILD or create new one depending if it modifies existing pack content or adds new content. This way you can't install conflicting files and you keep your changed or added files in your own packages pacman can then replace with original ones when needed, deleting all the files of previous package from the system. This is especially useful for me as I like to change classes of cars for offline races.

For Windows users: pacman package manager is available from MSYS2, you can use io packs PKGBUILDs from AUR as is, but for rvgl-bin one has to change source for Windows one. I can make this later if somebody is interested.

What's next?

I'm pretty new to the community, but anyway I'm interested in package management system for RVGL user content.

I believe RVGL as platform should be continued beyond making sure old content works and that all content is user made, to user and developer experience:
  • RVGL game should include user interface to search, download, update and remove user content.
    Possibly special level accessible from Frontend or modified Frontend.
  • Content creators should be able to push updates to their levels directly to users, and users should be able to check for updates and download them from game menus.
  • Content should exist in version control system (git) and have useful metadata (see PKGBUILD and what you input on Re-Volt Zone) that can be exposed through UI and used for tracking updates and files.
  • Content packs should be metapackages that depend on user content packages, so you will be warned when trying to remove content that is used for online races and get updates for that one car without having to redownload whole big pack.
  • One should be able to join races and download missing user content from centralized repository.
  • Package manager should keep information in database such as reason to install (as dependency or explicitly installed), so when removing metapackages content that was manually installed previously is not removed when metapackage is removed.
  • If some packages have conflicting files they should not be able to be installed together so it does not lead to updates that break package without user notice and idea how that happened. For example depending on order in which you install bonus cars and superpros you might play or not superpros online using fd_s7 and fd_s9 because those parameters will be overwritten if you install bonus cars after superpros.
This all is just prospects of where I'll personally push the project, but in the meantime it makes sense to focus on replacing old content with user-made content that can be licensed and redistributed, then getting involved through contributions into RVGL and fixing underlying issues that prevents it from being free to the public and distributed to all the platforms.

If you made it to the end of post thank you! More posts are coming, sending my regards form Ukraine :sirblob:
User avatar
Huki
Developer
Posts: 196
Joined: Wed Dec 06, 2017 5:54 am
Discord: Huki#1668

Re: RVGL now on Arch Linux AUR

Unread post by Huki » Tue May 07, 2019 7:37 am

Excellent packaging, much thanks from a fellow Arch user! I think there are a couple of points that could be improved though:

1) The game files are part of rvgl-bin. This could cause the game files to be downloaded unecessarily for each subsequent RVGL update (unless makepkg reuses downloaded sources if checksum is unchanged?). Also note how rvgl-bin implies a binary-only package but here it installs the full game. Ideally, rvgl-game-files should be a seperate package that's included as a dependency for rvgl-bin. The tricky part is to ensure that old assets from game_files.zip (eg, strings) don't overwrite newer RVGL files. I'm not sure how this can be handled yet.

2) RVGL uses the alure utility library to manage audio, however it's statically linked. So we don't depend directly on alure, but alure's optional dependencies are relevant for RVGL. So you could add these dependencies for rvgl-bin:

Code: Select all

flac (optional) - for FLAC support
fluidsynth (optional) - for SoundFont 2 support
libsndfile (optional) - for uncompressed audio support
libvorbis (optional) - for OGG Vorbis support
mpg123 (optional) - for MPEG support

3) I see two sections in the rvgl-dcpack PGKBUILD:

Code: Select all

    # Enable dreamcast car selection box layout
    for file in frontend.fin frontend.fob
    do
        mv levels/frontend/custom/dc/$file levels/frontend/custom
    done
I feel enabling dreamcast layout should be left to the user. Keep in mind that using DC layout for the championship cups require editing the config files (see docs), so replacing the carbox layout alone isn't enough. It's better that installing rvgl-dcpack leaves the installation with the default layout.

Code: Select all

    # Remove conflicting files shipped with game
    rm gfx/roof.bmp gfx/roof.bmq levels/frontend/frontend.fob
The 'levels/frontend/frontend.fob' included in the DC pack is different from the stock one. It's modified to add BigVolt and BossVolt to the stack while keeping the PC layout. Installing rvgl-dcpack is supposed to overwrite the original frontend.fob with this one, so these files shouldn't be removed from the package. Does pacman complain about conflicting files if the file already exists in the filesystem?
User avatar
svito
Posts: 13
Joined: Fri Mar 22, 2019 12:48 pm
Location: Ukraine

Re: RVGL now on Arch Linux AUR

Unread post by svito » Wed May 08, 2019 1:32 am

Huki wrote:
Tue May 07, 2019 7:37 am
1) The game files are part of rvgl-bin. This could cause the game files to be downloaded unnecessarily for each subsequent RVGL update (unless makepkg reuses downloaded sources if checksum is unchanged?).
I does not re-download them, I did not look into details. But yes, resulting package would have to be re-downloaded in whole if it were distributed that way.
Huki wrote:
Tue May 07, 2019 7:37 am
Also note how rvgl-bin implies a binary-only package but here it installs the full game.
-bin packages are packages that take already compiled binary in contrast to building it from source. These only apply to AUR as AUR packages are expected to build everything from source, and does not apply to official repository and other binary repositories.
Huki wrote:
Tue May 07, 2019 7:37 am
Ideally, rvgl-game-files should be a separate package that's included as a dependency for rvgl-bin. The tricky part is to ensure that old assets from game_files.zip (eg, strings) don't overwrite newer RVGL files. I'm not sure how this can be handled yet.
Archives are automatically extracted by makepkg in order in which they are listed, with RVGL as second overwriting content from game_files that is extracted first. This is not different to what Marv's installer script for Linux does, where if either game_files or RVGL is updated new RVGL version is extracted afterwards.
Huki wrote:
Tue May 07, 2019 7:37 am
2) … you could add these dependencies for rvgl-bin …
3) I feel enabling dreamcast layout should be left to the user.
Added optional deps and commented out line enabling DC layout.
Huki wrote:
Tue May 07, 2019 7:37 am
Installing rvgl-dcpack is supposed to overwrite the original frontend.fob with this one, so these files shouldn't be removed from the package. Does pacman complain about conflicting files if the file already exists in the filesystem?
Yes, I found way around that one and moved PC+BigVolt/BossVolt frontend.fob to frontend/custom folder.
User avatar
Huki
Developer
Posts: 196
Joined: Wed Dec 06, 2017 5:54 am
Discord: Huki#1668

Re: RVGL now on Arch Linux AUR

Unread post by Huki » Wed May 08, 2019 8:22 am

Ok, nice work, and thanks for the explanation.

I believe you need to add 2 more dependencies to rvgl-bin:
- sdl2
- libgl

Otherwise everything looks fine. I'm going to try it out later this week.
Post Reply