unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Carlos Carleos <carleos@uniovi.es>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: installing a modified package
Date: Wed, 24 Sep 2014 01:48:31 -0400	[thread overview]
Message-ID: <87d2alh8ls.fsf@yeeloong.lan> (raw)
In-Reply-To: <84sijifffn.fsf@carleos.epv.uniovi.es> (Carlos Carleos's message of "Tue, 23 Sep 2014 18:51:40 +0200")

Carlos Carleos <carleos@uniovi.es> 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

      parent reply	other threads:[~2014-09-24  5:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 16:51 installing a modified package Carlos Carleos
2014-09-23 17:25 ` Jason Self
2014-09-23 17:40 ` Thompson, David
2014-09-24 12:14   ` Overlays, custom package modules Ludovic Courtès
2014-09-24  5:48 ` Mark H Weaver [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2alh8ls.fsf@yeeloong.lan \
    --to=mhw@netris.org \
    --cc=carleos@uniovi.es \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).