all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* installing a modified package
@ 2014-09-23 16:51 Carlos Carleos
  2014-09-23 17:25 ` Jason Self
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Carlos Carleos @ 2014-09-23 16:51 UTC (permalink / raw)
  To: guix-devel


Hi! 

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.


-- 
     CARLOS CARLEOS                                    KAROLO EL KARLEOJ     
     Secretario                                               Sekretario     
     Departamento de Estadística             Departemento pri Statistiko     
     e Investigación Operativa                        kaj Operaciesploro     
     y Didáctica de la Matemática            kaj Didaktiko de Matematiko     
     Universidad Oviedo                              Universitato Oviedo     
     Principado de Asturias                          Princlando Asturujo     
     Reino de España                                  Reĝlando Hispanujo     
     Teléfono: 73353                               SMS: +34 66 004 66 05     

_____________________________________________________________________________
El cibercorreo no es SMS: dispone de       |        Retpoŝto malsamas ol SMS:
   - espacio suficiente                    |             - sufiĉas spaco     
   - comodidades adecuadas                 |             - taŭgas komfortaĵoj
para expresarse correctamente.             |        por ĝuste sin esprimi.   

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: installing a modified package
  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  5:48 ` installing a modified package Mark H Weaver
  2 siblings, 0 replies; 5+ messages in thread
From: Jason Self @ 2014-09-23 17:25 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

Carlos Carleos asked:
> What would be the similar sequence for GUIX?

Edit the package definition as appropriate to accomplish what you need
to do? Make a new package definition that uses the old one as an input
with whatever changes are needed? If the changes you're making would
be generally useful it might also be a good idea to share them so that
they can be included.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: installing a modified package
  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 ` installing a modified package Mark H Weaver
  2 siblings, 1 reply; 5+ messages in thread
From: Thompson, David @ 2014-09-23 17:40 UTC (permalink / raw)
  To: Carlos Carleos; +Cc: guix-devel

2014-09-23 12:51 GMT-04:00 Carlos Carleos <carleos@uniovi.es>:
>
> Hi!
>
> 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.
>

Since packages are Scheme expressions, you can simpley create a new
package object that inherits from the package you want to modify.

Untested code below:

    (use-modules (guix packages) (gnu packages emacs))

    (package (inherit emacs)  ...)

To install, I believe you need to use something like:

    guix package -e '(load "my-custom-emacs.scm")'

Where my-custom-emacs.scm is a file that contains the code above.
Having the 'package' form at the end of the file makes it the return
value of 'load'.

I'm writing this hastily, but I hope this helps.

- Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: installing a modified package
  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  5:48 ` Mark H Weaver
  2 siblings, 0 replies; 5+ messages in thread
From: Mark H Weaver @ 2014-09-24  5:48 UTC (permalink / raw)
  To: Carlos Carleos; +Cc: guix-devel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Overlays, custom package modules
  2014-09-23 17:40 ` Thompson, David
@ 2014-09-24 12:14   ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2014-09-24 12:14 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel, Carlos Carleos

"Thompson, David" <dthompson2@worcester.edu> skribis:

> Since packages are Scheme expressions, you can simpley create a new
> package object that inherits from the package you want to modify.
>
> Untested code below:
>
>     (use-modules (guix packages) (gnu packages emacs))
>
>     (package (inherit emacs)  ...)
>
> To install, I believe you need to use something like:
>
>     guix package -e '(load "my-custom-emacs.scm")'

This works OK but is inconvenient because that makes the user’s
modification second-class (and doesn’t work well with multiple-output
packages since -e ignores all but the first output.)

Mark H Weaver <mhw@netris.org> skribis:

> 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.

This approach doesn’t have the above drawbacks but is inconvenient.

I’ve finally bit the bullet.  Now it’s possible for users to write their
own package modules and then either run:

  guix package/build/... -L path/to/modules my-very-own-package ...

or:

  export GUIX_PACKAGE_PATH=/path/to/modules
  guix package -i my-very-own-package ...

The latter works with all the UIs, including the Emacs one.  So I think
it’s going to be pretty convenient (I’ve needed something like that a
couple of times, for local modifications of existing packages.)

Feedback welcome!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-24 12:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` installing a modified package Mark H Weaver

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.