Subject: [bug#49828] [PATCH 00/20] Add minetest mods

From: Maxime Devos <[email-masked]>
Date: Thu, 05 Aug 2021 23:10:45 +0200

Hi,

Andrew Ward schreef op do 05-08-2021 om 13:46 [+0100]:
> Hi, I'm a Minetest core dev and the creator of ContentDB (the service the powers
> the built-in mod/game/etc manager in Minetest).
> 
> It's very annoying when distros include mods but then never update them.
> It causes confusion with users, as mods change over time and there can be breakages.
> So, I'd like to make sure that these packages are kept in sync with ContentDB.

When the mod is being ‘built’ in Guix, the 'check' phase will start Minetest
with a new world where the mod and its dependencies are activated.  It is verified
there are no errors in the log.  That should help with detecting breakage.
It actually detected some breakage: ".mts" files were not being installed, leading
to errors at load time.  This is fixed now.

To keep in sync, there is "guix refresh minetest-MODA minetest-MODB ..." which
can automatically upgrade packages to the latest version.  It currently doesn't
know about ContentDB however, so it has to fall-back to the generic updaters
which do not appear to work well with Minetest mods:

gnu/packages/minetest.scm:345:13: 1.3 is already the latest version of minetest-worldedit
gnu/packages/minetest.scm:365:2: warning: no updater for minetest-unifieddyes
gnu/packages/minetest.scm:173:2: warning: no updater for minetest-mobs
gnu/packages/minetest.scm:143:13: minetest-mesecons would be upgraded from 1.2.1-0.db58797 to 2017.03.05
   ^ this is actually a downgrade IIRC
gnu/packages/minetest.scm:227:2: warning: no updater for minetest-pipeworks

Hopefully that can be improved in the future (maybe keep the "release date" in
the 'properties' field of the Guix package and use that to determine if an update
is available?).

> ContentDB also provides two other features: it only provides you with versions of
> mods/games that support your Minetest version. It also handles dependencies, so I
> hope this is set up correctly.

The ContentDB->guix importer handles dependencies.  It reads the dependencies
from ContentDB (with the /api/packages/AUTHOR/NAME/dependencies/ API) and
adds the hard dependencies to 'propagated-inputs', so "minetest-mobs-animal"
has "minetest-mobs" in its 'propagated-inputs'.  See also the 'check' phase
mentioned above.

> If you are disabling ContentDB completely, you should have the vast majority of mods,
> games, and texture packs available - especially all the hard dependencies needed, as
> not having these will cause load issues. Minetest is all about customisation.

In the original patch series I sent, ContentDB was indeed disabled completely when
guix-installed mods are present.  But with the revised patch (using the MINETEST_MOD_PATH
patch I submitted <https://github.com/minetest/minetest/pull/11515>), this is no
longer the case --- ContentDB and Guix can be used together.

I tested installing mods with both Minetest's built-in installer and guix.  They can
be used together.

> I recommend adding a button and core.open_url call to the guix dialog that replaces
> the content store. It should link to a page describing how to install mods using guix,
> and how to allow use of ContentDB again if the user desires

ContentDB and mods installed with guix can be used together with the revised patches.
It would be useful though to add some kind of dialog or something, telling the user
that mods can be installed with guix, and how to do so.

> Anyway, sorry for being critical - it's great to see more distro support and integration

Greetings,
Maxime (aka maximed aka emixa-d).