RVGL now on Arch Linux AUR

Post your own tools and resources, as well as your cars and tracks.
svito
Posts: 39

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: 397

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?
svito
Posts: 39

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: 397

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.
svito
Posts: 39

Re: RVGL now on Arch Linux AUR

Unread post by svito » Mon Jul 27, 2020 11:55 pm

Flagged rvgl-io-cars, rvgl-io-cars-bonus, rvgl-io-lmstag, rvgl-io-skins, rvgl-io-tracks, rvgl-io-tracks-bonus as out-of-date.

If you need help updating them add me as co-maintainer. I already have local PKGBUILDs for 20.0623 update.

Here script to replace pkgver and pkgrel, adapt to your needs. If you have better one or use tool that can do that, share it.

Code: Select all

#!/bin/bash
sed -i 's/^\(pkgver=\)\(.*\)$/\1'$1'/' PKGBUILD
sed -i 's/^\(pkgrel=\)\(.*\)$/\1'$2'/' PKGBUILD
Usage:

Code: Select all

chmod +x updver.sh
./updver.sh 20.0623 1
Last edited by svito on Tue Jul 28, 2020 7:53 pm, edited 1 time in total.
User avatar
Huki
Developer
Posts: 397

Re: RVGL now on Arch Linux AUR

Unread post by Huki » Tue Jul 28, 2020 7:35 pm

svito wrote: Mon Jul 27, 2020 11:55 pm Flagged rvgl-io-cars, rvgl-io-cars-bonus, rvgl-io-lmstag, rvgl-io-skins, rvgl-io-tracks, rvgl-io-tracks-bonus as out-of-date.

If you need help updating them add me as co-maintainer. I already have local PKGBUILDs for 20.0623 update.
Oh, thanks for the reminder. I added you as co-maintainer.
Here script to replace pkgver and pkgrel, adapt to your needs. If you have better one or use tool that can do that, share it.
I thought there was a built-in PKGBUILD function for that. If not, then this is a good solution too.
svito
Posts: 39

Re: RVGL now on Arch Linux AUR

Unread post by svito » Sat Aug 01, 2020 9:03 pm

I'm thinking maybe we should make /opt/rvgl/ directory and all the files writable by any user (666, game binary should be 755 and .desktop file -- 644).

Reason to do that is users might want to mod their game conents and we should not prevent to do that.
User avatar
Huki
Developer
Posts: 397

Re: RVGL now on Arch Linux AUR

Unread post by Huki » Thu Aug 06, 2020 6:05 pm

svito wrote: Sat Aug 01, 2020 9:03 pm I'm thinking maybe we should make /opt/rvgl/ directory and all the files writable by any user (666, game binary should be 755 and .desktop file -- 644).

Reason to do that is users might want to mod their game conents and we should not prevent to do that.
Ok, let's do it. What about folders though? We don't explicitly handle folders, so I think they inherit permissions of "/opt".
svito
Posts: 39

Re: RVGL now on Arch Linux AUR

Unread post by svito » Thu Aug 06, 2020 6:25 pm

Opt would need to be creates separately first with standard permissions:

mkdir -m 644 $pkgdir/opt

Then when installing files:

install -Dm666 (this would create directories with same permission I think, so /opt/rvgl and below directories will have 666 and be writable).
User avatar
Huki
Developer
Posts: 397

Re: RVGL now on Arch Linux AUR

Unread post by Huki » Sat Aug 08, 2020 5:18 am

svito wrote: Thu Aug 06, 2020 6:25 pm Opt would need to be creates separately first with standard permissions:

mkdir -m 644 $pkgdir/opt

Then when installing files:

install -Dm666 (this would create directories with same permission I think, so /opt/rvgl and below directories will have 666 and be writable).
Directories need executable permission, so it must be mkdir -m 755.
Also, I think most systems already have an /opt directory. It's better to create "/opt/rvgl" instead.

But I tried something like this:

Code: Select all

install -dm777 "$pkgdir/opt/rvgl"
find * -type f -exec install -Dm666 {} "$pkgdir/opt/rvgl/{}" \;
and the automatically created folders still use default permissions. Below is a sample result from the resulting pkg tarball:

Code: Select all

drwxrwxrwx root/root         0 2020-08-08 10:39 opt/rvgl/
drwxr-xr-x root/root         0 2020-08-08 10:39 opt/rvgl/cars/
drwxr-xr-x root/root         0 2020-08-08 10:39 opt/rvgl/cars/bigvolt/
-rw-rw-rw- root/root       496 2020-08-08 10:39 opt/rvgl/cars/bigvolt/axle.prm
I'll see if I can find a better solution...
User avatar
URV
Administrator
Posts: 173
From: Europe 3

Re: RVGL now on Arch Linux AUR

Unread post by URV » Fri Nov 20, 2020 2:20 pm

Hi there, I just got around to trying this out on Manjaro. Thank you for setting it up.

A couple of things to note: First off, it seemed like it took a very long time to download everything. Not certain whether this is on my side or the server—I am using a mobile connection right now, but it's also not a bad one. Are the packages downloaded from AUR or RVIO?

Secondly, about adding permissions for opt/rvgl: wouldn't it be better to move some content to the home folder? Namely the profile, replays and times folders, as it would make sense to have them there. Additionally, what if the user were to place additional cars and tracks in the home folder, and symlinks of those could be generated in opt/rvgl instead? The actual implementation might be a bit tricky, but ultimately I feel it'd be more intuitive on the user's end, and it would also allow each user to have different mod configurations.

For the time being I prefer a different method for installing/maintaining RVGL, but it's always good to have options. This one is definitely among the easiest to set up.
Post Reply