Trying to apply DLC for a game installed by Guix (help!)

Trying to apply DLC for a game installed by Guix (Help!)

Here is my my dilemma:
There is a game in the Guix repository called tome4. This game has DLC that can be obtained through the website, which i have. The directory where the game looks for the DLC is located in the store, so i can’t just drop the files there like i normally would on any other system. I’ve downloaded the game’s source from the website (the same place that is specified in the tome4 package definition), uncompressed it, added the DLC to the correct directory, recompressed, tried specifying this file on my machine instead of the file at in a new tome4.scm (this is where i really start to get lost), and then tried to pass the new tome4.scm to guix to install it.

  1. Am i even going about this in the right way?
  2. How do i designate a file path on my machine instead of a URL within a package definition?
  3. How do i install a package from a .scm file containing a package defintion that i’ve created or modified?

Here is the tome4 package defintion for reference:
tome4.scm (4.6 KB)

First of all, guix has excellent built-in capabilities for modifying existing packages.
Perhaps the easiest way is to use package transformation options:

guix install tome4 --with-source=file:///home/user/random-directory/tome4.tar.gz

The other way is to define package variants. It is essentially the same as the first, but is done at the package definition level:

(define-module (my-tome4)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (gnu packages games))

(define-public my-tome4
    (inherit tome4)
       (method url-fetch)
       (uri "file:///home/user/random-directory/tome4.tar.gz")
        (base32 "sha256checksumgoeshere"))
       (modules '((guix build utils)))))))   

Here’s a tip on how to use your own guile modules with guix packages.
Also remember that the module names and file names in guile must match each other:
(packages tome4) = packages/tome4.scm
If the names of your package and the original package are the same, you can use the --install-from-expression= option to specify which module the package should be taken from:

guix package -e '(@ (my-tome4) tome4)'

Lastly, I believe this should be done the way it is done in the obs package. There is a search path variable that specifies where the plugins should be loaded from, and thus the plugins can be packaged separately.

1 Like

Thank you so much for your detailed response! I appreciate the references to the manual. Using the package transformation option and the package defintion variant you provided both installed ToME with the DLC files and it works just like it should.