help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packaging existing software for Guix


From: Bird
Subject: Re: Packaging existing software for Guix
Date: Sat, 02 Apr 2022 17:00:20 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Cássio Tavares <cassio.ufg@gmail.com> writes:

>> The exception might be that some upstream software provides a guix.scm
>> to be able to build from the current git checkout. For example, the GNU
>> Mes project:
>>
>>   https://git.savannah.gnu.org/cgit/mes.git/tree/guix.scm
>>
>
> OK, I checked this scheme file, and it's just a four-line program, but I
> don't get it. So, help me here ─ what is this *↓↓↓* `mes` code actually
> doing?
>
> (define %source-dir (dirname (current-filename)))
> (add-to-load-path (string-append %source-dir "/guix")) (use-modules
> (git mes))

This defines a variable called "%source-dir" which contains the
directory name of current file (which is guix.scm). If we assume the
current file is in ~/mes/guix.scm, it'll be ~/mes

Then it adds the ~/mes/guix in the places guix will look for
code. (load-path).

For more info, run: info "(guile) Modules and the File System"

The (use-modules (git mes)) line says to find a filename "mes.scm" under
directory "git". Guix searches in the directories defined in load-path
and it'll find ~/mes/git/mes.scm file.

The mes.scm file defines some packages including mes.git . Putting the
name of package at the end means you can use `guix build -f guix.scm' or `guix
install -f guix.scm' directly without specifying an exact package

>
> Thanks again,
> Cássio
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]