guix-devel
[Top][All Lists]
Advanced

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

Re: installing a modified package


From: Mark H Weaver
Subject: Re: installing a modified package
Date: Wed, 24 Sep 2014 01:48:31 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Carlos Carleos <address@hidden> writes:

> I know I should be RTFM carefully, but...
>
> In Debian, I can follow these steps to customize a package (more or less):
>
> 1. # apt-get build-dep PACKAGE
>
> 2. $ apt-get source PACKAGE
>
> 3. $ cd PACKAGE-...; ...tweak...; dpkg-buildpackage...
>
> 4. # dpkg -i PACKAGE.deb
>
> What would be the similar sequence for GUIX?  Thank you very much.

IMO, the best approach is to clone the Guix git repo, create your own
private branch with your preferred modifications, and periodically merge
or rebase with Guix upstream.  When running Guix directly from the git
repo, there's no need to run "make install", instead prefix commands
with /path/to/guix-git-working-dir/pre-inst-env.  I also put a shell
script in ~/bin/guix that does: /path/to/guix/pre-inst-env guix "$@"

Since Guix aims to create reproducable builds, we do not support a mode
where you first unpack a source tree, tweak things by hand, and then
build it right there.  Instead, as Jason said, you need to edit the
package definition in gnu/packages/*.scm (guix package -A tells you
where).  In some cases, you might simply change the configure flags or
build inputs.  Other times you might need to add a patch to
gnu/packages/patches/* and add it to 'patches' in the 'origin' of the
package (search for 'search-patch' in gnu/packages/*.scm for examples).

For patching, I usually start by unpacking the source plus existing Guix
patches using "tar xf $(guix build -S <PACKAGE>)".

To test your modified package, run "make" in the top-level source
directory, then "./pre-inst-env guix build -K <PACKAGE-NAME>", and if it
succeeds, you can install it in your profile with "./pre-inst-env guix
package -i <PACKAGE-NAME>".

Does this work for you?

      Mark



reply via email to

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