code:
@node Contribuer
@chapter Contribuer

Ce projet est un effort coopératif et nous avons besoin de votre aide pour
le faire grandir ! Contactez-nous sur @email{guix-devel@@gnu.org} et
@code{#guix} sur le réseau IRC Freenode.  Nous accueillons les idées, les
rapports de bogues, les correctifs et tout ce qui pourrait aider le projet.
Nous apprécions particulièrement toute aide sur la création de paquets
(@pxref{Consignes d'empaquetage}).

@cindex code de conduite, des contributeurs
@cindex convention de contribution
Nous souhaitons fournir un environnement chaleureux, amical et sans
harcèlement pour que tout le monde puisse contribuer au mieux de ses
capacités.  Pour cela notre projet a une « Convention de contribution »
adaptée de @url{http://contributor-covenant.org/}.  Vous pouvez trouver une
version locale dans le fichier @file{CODE-OF-CONDUCT} dans l'arborescence
des sources.

Les contributeurs n'ont pas besoin d'utiliser leur nom légal dans leurs
correctifs et leurs communications en ligne ; ils peuvent utiliser n'importe
quel nom ou pseudonyme de leur choix.

@menu
* Construire depuis Git::    toujours le plus récent.
* Lancer Guix avant qu'il ne soit installé::  Astuces pour les hackers.
* La configuration parfaite::  Les bons outils.
* Style de code::            Hygiène du contributeur.
* Envoyer des correctifs::   Partager votre travail.
@end menu

@node Construire depuis Git
@section Construire depuis Git

Si vous souhaitez travailler sur Guix lui-même, il est recommandé d'utiliser
la dernière version du dépôt Git :

@example
git clone https://git.savannah.gnu.org/git/guix.git
@end example

Lors de la construction de Guix depuis un extrait, les paquets suivants sont
requis en plus de ceux mentionnés dans les instructions d'installation
(@pxref{Prérequis}).

@itemize
@item @url{http://gnu.org/software/autoconf/, GNU Autoconf};
@item @url{http://gnu.org/software/automake/, GNU Automake};
@item @url{http://gnu.org/software/gettext/, GNU Gettext};
@item @url{http://gnu.org/software/texinfo/, GNU Texinfo};
@item @url{http://www.graphviz.org/, Graphviz};
@item @url{http://www.gnu.org/software/help2man/, GNU Help2man (facultatif)}.
@end itemize

La manière la plus simple de configurer un environnement de développement
pour Guix est, bien sûr, d'utiliser Guix ! La commande suivante démarre un
nouveau shell où toutes les dépendances et les variables d'environnements
appropriées sont configurés pour travailler sur Guix :

@example
guix environment guix
@end example

@xref{Invoquer guix environment}, pour plus d'information sur cette
commande.  On peut ajouter des dépendances supplémentaires avec
@option{--ad-hoc} :

@example
guix environment guix --ad-hoc help2man git strace
@end example

Lancez @command{./bootstrap} pour générer l'infrastructure du système de
construction avec Autoconf et Automake.  Si vous avez une erreur comme :

@example
configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
@end example

@noindent
cela signifie probablement qu'Autoconf n'a pas pu trouver @file{pkg.m4} qui
est fournit par pkg-config.  Assurez-vous que @file{pkg.m4} est disponible.
C'est aussi vrai pour l'ensemble de macros de @file{guile.m4} fournies par
Guile.  Par exemple, si vous avez installé Automake dans @file{/usr/local},
il ne cherchera pas les fichiers @file{.m4} dans @file{/usr/share}.  Dans ce
case vous devez invoquer la commande suivante :

@example
export ACLOCAL_PATH=/usr/share/aclocal
@end example

@xref{Macro Search Path,,, automake, The GNU Automake Manual}, pour plus
d'information.

Ensuite, lancez @command{./configure} comme d'habitude.  Assurez-vous de
passer @code{--localstatedir=@var{directory}} où @var{directory} est la
valeur @code{localstatedir} utilisée par votre installation actuelle
(@pxref{Le dépôt} pour plus d'informations à ce propos).

Finalement, vous devez invoquer @code{make check} pour lancer les tests
(@pxref{Lancer la suite de tests}).  Si quelque chose échoue, jetez un œil
aux instructions d'installation (@pxref{Installation}) ou envoyez un message
à la list @email{guix-devel@@gnu.org}.

@node Lancer Guix avant qu'il ne soit installé
@section Lancer Guix avant qu'il ne soit installé

Pour garder un environnement de travail sain, il est utile de tester les
changement localement sans les installer pour de vrai.  Pour pouvoir
distinguer votre rôle « d'utilisateur final » de celui parfois haut en
couleur de « développeur ».

To that end, all the command-line tools can be used even if you have not run
@code{make install}.  To do that, you first need to have an environment with
all the dependencies available (@pxref{Construire depuis Git}), and then simply
prefix each command with @command{./pre-inst-env} (the @file{pre-inst-env}
script lives in the top build tree of Guix), as in@footnote{The @option{-E}
flag to @command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly
set such that @command{guix-daemon} and the tools it uses can find the Guile
modules they need.}:

@example
$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
$ ./pre-inst-env guix build hello
@end example

@noindent
De même, pour une session Guile qui utilise les modules Guix :

@example
$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'

;;; ("x86_64-linux")
@end example

@noindent
@cindex REPL
@cindex read-eval-print loop
@dots{} et pour un REPL (@pxref{Using Guile Interactively,,, guile, Guile
Reference Manual})

@example
$ ./pre-inst-env guile
scheme@@(guile-user)> ,use(guix)
scheme@@(guile-user)> ,use(gnu)
scheme@@(guile-user)> (define snakes
                       (fold-packages
                         (lambda (package lst)
                           (if (string-prefix? "python"
                                               (package-name package))
                               (cons package lst)
                               lst))
                         '()))
scheme@@(guile-user)> (length snakes)
$1 = 361
@end example

Le script @command{pre-inst-env} paramètre toutes les variables
d'environnement nécessaires, dont @env{PATH} et @env{GUILE_LOAD_PATH}.

Remarquez que @command{./pre-inst-env guix pull} ne met @emph{pas} à jour
l'arborescence des sources locale ; cela met seulement à jour le lien
symbolique de @file{~/.config/guix/current} (@pxref{Invoquer guix pull}).
Lancez @command{git pull} à la place si vous voulez mettre à jour votre
arborescence des source locale.

@node La configuration parfaite
@section La configuration parfaite

La configuration parfaite pour travailler sur Guix est simplement la
configuration parfaite pour travailler en Guile (@pxref{Using Guile in
Emacs,,, guile, Guile Reference Manual}).  Tout d'abord, vous avez besoin de
mieux qu'un éditeur de texte, vous avez besoin de
@url{http://www.gnu.org/software/emacs, Emacs}, amélioré par le superbe
@url{http://nongnu.org/geiser/, Geiser}.

Geiser permet le développement interactif et incrémental depuis Emacs : la
compilation du code et son évaluation depuis les buffers, l'accès à la
documentation en ligne (docstrings), la complétion sensible au contexte,
@kbd{M-.} pour sauter à la définition d'un objet, un REPL pour tester votre
code, et bien plus (@pxref{Introduction,,, geiser, Geiser User Manual}).
Pour travailler confortablement sur Guix, assurez-vous de modifier le chemin
de chargement de Guile pour qu'il trouve les fichiers source de votre dépôt
:

@lisp
;; @r{Si l'extrait est dans ~/src/guix.}
(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/src/guix"))
@end lisp

Pour effectivement éditer le code, Emacs a déjà un très bon mode Scheme.
Mais en plus de ça, vous ne devez pas rater
@url{http://www.emacswiki.org/emacs/ParEdit, Paredit}.  Il fournit des
fonctionnalités pour opérer directement sur l'arbre de syntaxe, comme
relever une s-expression ou l'envelopper, absorber ou rejeter la
s-expression suivante, etc.

@cindex extraits de code
@cindex modèles
@cindex réduire la quantité de code commun
Nous fournissons aussi des modèles pour les messages de commit git communs
et les définitions de paquets dans le répertoire @file{etc/snippets}.  Ces
modèles s'utilisent avec @url{http://joaotavora.github.io/yasnippet/,
YASnippet} pour développer des chaînes courtes de déclenchement en extraits
de texte interactifs.  Vous pouvez ajouter le répertoire des modèles dans la
variables @var{yas-snippet-dirs} d'Emacs.

@lisp
;; @r{Si l'extrait est dans ~/src/guix.}
(with-eval-after-load 'yasnippet
  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
@end lisp

The commit message snippets depend on @url{https://magit.vc/, Magit} to
display staged files.  When editing a commit message type @code{add}
followed by @kbd{TAB} to insert a commit message template for adding a
package; type @code{update} followed by @kbd{TAB} to insert a template for
updating a package; type @code{https} followed by @kbd{TAB} to insert a
template for changing the home page URI of a package to HTTPS.

L'extrait principal pour @code{scheme-mode} est lancé en tapant
@code{package…} suivi par @kbd{TAB}.  Cet extrait insère aussi la chaîne de
déclenchement @code{origin…}, qui peut aussi être étendue.  L'extrait
@code{origin} lui-même peut aussi insérer des chaînes de déclenchement qui
finissent sur @code{…}, qui peuvent aussi être étendues.

@node Style de code
@section Style de code

En général notre code suit le Standard de Code GNU (@pxref{Top,,, standards,
GNU Coding Standards}).  Cependant, il ne parle pas beaucoup de Scheme, donc
voici quelques règles supplémentaires.

@menu
* Paradigme de programmation::  Comment composer vos éléments.
* Modules::                  Où stocker votre code ?
* Types de données et reconnaissance de motif::  Implémenter des
                                                    structures de données.
* Formatage du code::        Conventions d'écriture.
@end menu

@node Paradigme de programmation
@subsection Paradigme de programmation

Le code Scheme dans Guix est écrit dans un style purement fonctionnel.  Le
code qui s'occupe des entrées-sorties est une exception ainsi que les
procédures qui implémentent des concepts bas-niveau comme la procédure
@code{memoize}.

@node Modules
@subsection Modules

Les modules Guile qui sont sensés être utilisés du côté de la construction
doivent se trouver dans l'espace de nom @code{(guix build @dots{})}.  Ils ne
doivent pas se référer à d'autres modules Guix ou GNU@.  Cependant il est
correct pour un module « côté hôte » de dépendre d'un module coté
construction.

Les modules qui s'occupent du système GNU général devraient se trouver dans
l'espace de nom @code{(gnu @dots{})} plutôt que @code{(guix @dots{})}.

@node Types de données et reconnaissance de motif
@subsection Types de données et reconnaissance de motif

La tendance en Lisp classique est d'utiliser des listes pour tout
représenter et de naviguer dedans « à la main ( avec @code{car}, @code{cdr},
@code{cadr} et compagnie.  Il y a plusieurs problèmes avec ce style,
notamment le fait qu'il soit dur à lire, source d'erreur et un obstacle aux
rapports d'erreur bien typés.

Le code de Guix devrait définir des types de données appropriées (par
exemple, avec @code{define-record-type*}) plutôt que d'abuser des listes.
En plus, il devrait utiliser la recherche de motifs, via le module Guile
@code{(ice-9 match)}, surtout pour rechercher dans des listes.

@node Formatage du code
@subsection Formatage du code

@cindex formater le code
@cindex style de code
Lorsque nous écrivons du code Scheme, nous suivons la sagesse commune aux
programmeurs Scheme.  En général, nous suivons les
@url{http://mumble.net/~campbell/scheme/style.txt, règles de style de
Riastradh}.  Ce document décrit aussi les conventions utilisées dans le code
de Guile.  Il est bien pensé et bien écrit, alors n'hésitez pas à le lire.

Certaines formes spéciales introduites dans Guix comme la macro
@code{substitute*} ont des règles d'indentation spécifiques.  Elles sont
définies dans le fichier @file{.dir-locals.el} qu'Emacs utilise
automatiquement.  Remarquez aussi qu'Emacs-Guix fournit le mode
@code{guix-devel-mode} qui indente et colore le code Guix correctement
(@pxref{Development,,, emacs-guix, The Emacs-Guix Reference Manual}).

@cindex indentation, du code
@cindex formatage, du code
Si vous n'utilisez pas Emacs, assurez-vous que votre éditeur connaisse ces
règles.  Pour indenter automatiquement une définition de paquet, vous pouvez
aussi lancer :

@example
./etc/indent-code.el gnu/packages/@var{file}.scm @var{package}
@end example

@noindent
Cela indente automatiquement la définition de @var{package} dans
@file{gnu/packages/@var{file}.scm} en lançant Emacs en mode commande.  Pour
indenter un fichier complet, n'indiquez pas de second argument :

@example
./etc/indent-code.el gnu/services/@var{file}.scm
@end example

@cindex Vim, édition de code Scheme
Si vous éditez du code avec Vim, nous recommandons de lancer @code{:set
autoindent} pour que votre code soit automatiquement indenté au moment où
vous l'entrez.  En plus,
@uref{https://www.vim.org/scripts/script.php?script_id=3998,
@code{paredit.vim}} peut vous aider à gérer toutes ces parenthèses.

Nous demandons que toutes les procédure de premier niveau contiennent une
chaîne de documentation.  Ce pré-requis peut être relâché pour les
procédures privées simples dans l'espace de nom @code{(guix build @dots{})}
cependant.

Les procédures ne devraient pas avoir plus de quatre paramètres
positionnés. Utilisez des paramètres par mot-clefs pour les procédures qui
prennent plus de quatre paramètres.

@node Envoyer des correctifs
@section Envoyer des correctifs

Le développement se fait avec le système de contrôle de version Git.  Ainsi,
l'accès au dépôt n'est pas strictement nécessaire.  Nous accueillons les
contributions sous forme de correctifs produits par @code{git format-patch}
envoyés sur la liste de diffusion @email{guix-patches@@gnu.org}.

Cette liste de diffusion est gérée par une instance Debbugs accessible à
l'adresse @uref{https://bugs.gnu.org/guix-patches}, qui nous permet de
suivre les soumissions.  Chaque message envoyé à cette liste se voit
attribuer un numéro de suivi ; les gens peuvent ensuite répondre à cette
soumission en envoyant un courriel à @code{@var{NNN}@@debbugs.gnu.org}, où
@var{NNN} est le numéro de suivi (@pxref{Envoyer une série de correctifs}).

Veuillez écrire les messages de commit dans le format ChangeLog
(@pxref{Change Logs,,, standards, GNU Coding Standards}) ; vous pouvez
regarder l'historique des commits pour trouver des exemples.

Avant de soumettre un correctif qui ajoute ou modifie la définition d'un
paquet, veuillez vérifier cette check-list :

@enumerate
@item
Si les auteurs du paquet logiciel fournissent une signature cryptographique
pour l'archive, faîtes un effort pour vérifier l'authenticité de l'archive.
Pour un fichier de signature GPG détaché, cela se fait avec la commande
@code{gpg --verify}.

@item
Prenez un peu de temps pour fournir un synopsis et une description adéquats
pour le paquet.  Voir @xref{Synopsis et descriptions} pour quelques lignes
directrices.

@item
Lancez @code{guix lint @var{paquet}}, où @var{paquet} est le nom du nouveau
paquet ou du paquet modifié, et corrigez les erreurs qu'il rapporte
(@pxref{Invoquer guix lint}).

@item
Assurez-vous que le paquet se construise sur votre plate-forme avec
@code{guix build @var{paquet}}.

@item
@cindex construction groupée
Assurez-vous que le paquet n'utilise pas de copie groupée d'un logiciel déjà
disponible dans un paquet séparé.

Parfois, les paquets incluent des copie du code source de leurs dépendances
pour le confort de leurs utilisateurs.  Cependant, en tant que distribution,
nous voulons nous assurer que ces paquets utilisent bien les copient que
nous avons déjà dans la distribution si elles existent.  Cela améliore
l'utilisation des ressources (la dépendance n'est construite et stockée
qu'une seule fois) et permet à la distribution de faire des changements
transversaux comme appliquer des correctifs de sécurité pour un paquet donné
depuis un unique emplacement et qu'ils affectent tout le système, ce
qu'empêchent les copies groupées.

@item
Regardez le profile rapporté par @command{guix size} (@pxref{Invoquer guix size}).  Cela vous permettra de remarquer des références à d'autres paquets
qui ont été retenus.  Il peut aussi aider à déterminer s'il faut découper le
paquet (@pxref{Des paquets avec plusieurs résultats}) et quelle dépendance
facultative utiliser.

@item
Pour les changements important, vérifiez que les paquets qui en dépendent
(s'ils existent) ne sont pas affectés par le changement ; @code{guix refresh
--list-dependant @var{paquet}} vous aidera (@pxref{Invoquer guix refresh}).

@c ===========================================================================
@c
@c This file was generated with po4a. Translate the source file.
@c
@c ===========================================================================
@c See <https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00933.html>.
@cindex stratégie de branche
@cindex stratégie de planification des reconstructions
Suivant le nombre de paquets dépendants et donc le nombre de reconstruction
induites, les commits vont vers des branches différentes, suivant ces
principes :

@table @asis
@item 300 paquets dépendants ou moins
branche @code{master} (changements non-disruptifs).

@item entre 300 et 1 200 paquets dépendants
branche @code{staging} (changemets non-disruptifs).  Cette branche devrait
être fusionnées dans @code{master} tous les 3 semaines.  Les changements par
thèmes (par exemple une mise à jour de la pile GNOME) peuvent aller dans une
branche spécifique (disons, @code{gnome-updates}).

@item plus de 1 200 paquets dépendants
branche @code{core-updates} (peut inclure des changements majeurs et
potentiellement disruptifs).  Cette branche devrait être fusionnée dans
@code{master} tous les 2,5 mois environ.
@end table

Toutes ces branches sont @uref{https://hydra.gnu.org/project/gnu, gérées par
notre ferme de construction} et fusionnées dans @code{master} une fois que
tout a été construit correctement.  Cela nous permet de corriger des
problèmes avant qu'ils n'atteignent les utilisateurs et réduit la fenêtre
pendant laquelle les binaires pré-construits ne sont pas disponibles.

@c TODO: It would be good with badges on the website that tracks these
@c branches.  Or maybe even a status page.
Généralement les autres branches que @code{master} sont considérées comme
@emph{gelées} s'il y a eu une évaluation récente ou qu'il y a une branche
@code{-next} correspondante.  Demandez sur la liste de diffusion ou sur IRC
si vous n'êtes pas sûr de savoir où pousser votre correctif.

@item
@cindex déterminisme, du processus de construction
@cindex construction reproductibles, vérification
Vérifiez si le processus de construction du paquet est déterministe.  Cela
signifie typiquement vérifier qu'une construction indépendante du paquet
renvoie exactement le même résultat que vous avez obtenu, bit à bit.

Une manière simple de le faire est de reconstruire le paquet plusieurs fois
à la suite sur votre machine (@pxref{Invoquer guix build}) :

@example
guix build --rounds=2 mon-paquet
@end example

Cela est suffisant pour trouver une classe de non-déterminisme commune,
comme l'horodatage ou des sorties générées aléatoirement dans le résultat de
la construction.

Une autre option consiste à utiliser @command{guix challenge}
(@pxref{Invoquer guix challenge}).  Vous pouvez lancer la commande une fois
que les paquets ont été commités et construits par @code{hydra.gnu.org} pour
vérifier s'il obtient le même résultat que vous.  Mieux encore : trouvez une
autre machine qui peut le construire et lancez @command{guix publish}.  Puis
la machine distante est sûrement différente de la vôtre, cela peut trouver
des problèmes de non-déterminisme liés au matériel — par exemple utiliser
une extension du jeu d'instruction — ou du noyau du système d'exploitation —
par exemple se reposer sur @code{uname} ou les fichiers de @file{/proc}.

@item
Lorsque vous écrivez de la documentation, utilisez une formulation au genre
neutre lorsque vous vous référez à des personnes, comme le
@uref{https://fr.wikipedia.org/wiki/They_singulier, ``they''@comma{}
``their''@comma{} ``them'' singulier} (en anglais).

@item
Vérifiez que votre correctif contienne seulement un ensemble de changements
liés.  Grouper des changements non liés ensemble rend la revue plus
difficile et plus lente.

Ajouter plusieurs paquet ou une mise à jour d'un paquet avec des corrections
dans ce paquet sont des exemples de changements sans rapport.

@item
Suivez nos règles de formatage de code, éventuellement en lançant le script
@command{et/indent-code.el} pour le faire automatiquement (@pxref{Formatage
du code}).

@end enumerate

Lorsque vous envoyez un correctif à la liste de diffusion, utilisez
@samp{[PATCH] @dots{}} comme sujet.  Vous pouvez utiliser votre client de
courriel ou la commande @command{git send-email} (@pxref{Envoyer une série
de correctifs}).  Nous préférons recevoir des correctifs en texte brut, soit
en ligne, soit en pièce-jointe MIME@.   Nous vous conseillons de faire
attention si votre client de courriel change par exemple les retours à la
ligne ou l'indentation, ce qui peut casser les correctifs.

Lorsqu'un bogue est résolu, veuillez fermer le fil en envoyant un courriel à
@email{@var{NNN}-done@@debbugs.gnu.org}.

@unnumberedsubsec Envoyer une série de correctifs
@anchor{Envoyer une série de correctifs}
@cindex série de correctifs
@cindex @code{git send-email}
@cindex @code{git-send-email}

@c Debbugs bug: https://debbugs.gnu.org/db/15/15361.html
Lorsque vous envoyez une série de correctifs (p.@@:: ex.@: avec @code{git
send-email}), envoyez d'abord une premier message à
@email{guix-patches@@gnu.org} puis envoyez le reste des correctifs à
@email{@var{NNN}@@debbugs.gnu.org} pour vous assurer qu'ils seront groupés
ensemble.  Voyez @uref{https://debbugs.gnu.org/Advanced.html, la
documentation de Debbugs} pour plus d'informations.

license: mit


code:
@node Contributing
@chapter Contributing

This project is a cooperative effort, and we need your help to make it
grow!  Please get in touch with us on @email{guix-devel@@gnu.org} and
@code{#guix} on the Freenode IRC network.  We welcome ideas, bug
reports, patches, and anything that may be helpful to the project.  We
particularly welcome help on packaging (@pxref{Packaging Guidelines}).

@cindex code of conduct, of contributors
@cindex contributor covenant
We want to provide a warm, friendly, and harassment-free environment, so
that anyone can contribute to the best of their abilities.  To this end
our project uses a ``Contributor Covenant'', which was adapted from
@url{http://contributor-covenant.org/}.  You can find a local version in
the @file{CODE-OF-CONDUCT} file in the source tree.

Contributors are not required to use their legal name in patches and
on-line communication; they can use any name or pseudonym of their
choice.

@menu
* Building from Git::           The latest and greatest.
* Running Guix Before It Is Installed::  Hacker tricks.
* The Perfect Setup::           The right tools.
* Coding Style::                Hygiene of the contributor.
* Submitting Patches::          Share your work.
@end menu

@node Building from Git
@section Building from Git

If you want to hack Guix itself, it is recommended to use the latest
version from the Git repository:

@example
git clone https://git.savannah.gnu.org/git/guix.git
@end example

When building Guix from a checkout,
the following packages are required in addition to those mentioned in
the installation instructions (@pxref{Requirements}).

@itemize
@item @url{http://gnu.org/software/autoconf/, GNU Autoconf};
@item @url{http://gnu.org/software/automake/, GNU Automake};
@item @url{http://gnu.org/software/gettext/, GNU Gettext};
@item @url{http://gnu.org/software/texinfo/, GNU Texinfo};
@item @url{http://www.graphviz.org/, Graphviz};
@item @url{http://www.gnu.org/software/help2man/, GNU Help2man (optional)}.
@end itemize

The easiest way to set up a development environment for Guix is, of
course, by using Guix!  The following command starts a new shell where
all the dependencies and appropriate environment variables are set up to
hack on Guix:

@example
guix environment guix
@end example

@xref{Invoking guix environment}, for more information on that command.
Extra dependencies can be added with @option{--ad-hoc}:

@example
guix environment guix --ad-hoc help2man git strace
@end example

Run @command{./bootstrap} to generate the build system infrastructure
using Autoconf and Automake.  If you get an error like this one:

@example
configure.ac:46: error: possibly undefined macro: PKG_CHECK_MODULES
@end example

@noindent
it probably means that Autoconf couldn’t find @file{pkg.m4}, which is
provided by pkg-config.  Make sure that @file{pkg.m4} is available.  The
same holds for the @file{guile.m4} set of macros provided by Guile.  For
instance, if you installed Automake in @file{/usr/local}, it wouldn’t
look for @file{.m4} files in @file{/usr/share}.  In that case, you have
to invoke the following command:

@example
export ACLOCAL_PATH=/usr/share/aclocal
@end example

@xref{Macro Search Path,,, automake, The GNU Automake Manual}, for
more information.

Then, run @command{./configure} as usual.  Make sure to pass
@code{--localstatedir=@var{directory}} where @var{directory} is the
@code{localstatedir} value used by your current installation (@pxref{The
Store}, for information about this).

Finally, you have to invoke @code{make check} to run tests
(@pxref{Running the Test Suite}).  If anything
fails, take a look at installation instructions (@pxref{Installation})
or send a message to the @email{guix-devel@@gnu.org, mailing list}.

@node Running Guix Before It Is Installed
@section Running Guix Before It Is Installed

In order to keep a sane working environment, you will find it useful to
test the changes made in your local source tree checkout without
actually installing them.  So that you can distinguish between your
``end-user'' hat and your ``motley'' costume.

To that end, all the command-line tools can be used even if you have not
run @code{make install}.  To do that, you first need to have an environment
with all the dependencies available (@pxref{Building from Git}), and then
simply prefix each command with
@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the
top build tree of Guix), as in@footnote{The @option{-E} flag to
@command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set
such that @command{guix-daemon} and the tools it uses can find the Guile
modules they need.}:

@example
$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
$ ./pre-inst-env guix build hello
@end example

@noindent
Similarly, for a Guile session using the Guix modules:

@example
$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'

;;; ("x86_64-linux")
@end example

@noindent
@cindex REPL
@cindex read-eval-print loop
@dots{} and for a REPL (@pxref{Using Guile Interactively,,, guile, Guile
Reference Manual}):

@example
$ ./pre-inst-env guile
scheme@@(guile-user)> ,use(guix)
scheme@@(guile-user)> ,use(gnu)
scheme@@(guile-user)> (define snakes
                       (fold-packages
                         (lambda (package lst)
                           (if (string-prefix? "python"
                                               (package-name package))
                               (cons package lst)
                               lst))
                         '()))
scheme@@(guile-user)> (length snakes)
$1 = 361
@end example

The @command{pre-inst-env} script sets up all the environment variables
necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}.

Note that @command{./pre-inst-env guix pull} does @emph{not} upgrade the
local source tree; it simply updates the @file{~/.config/guix/current}
symlink (@pxref{Invoking guix pull}).  Run @command{git pull} instead if
you want to upgrade your local source tree.

@node The Perfect Setup
@section The Perfect Setup

The Perfect Setup to hack on Guix is basically the perfect setup used
for Guile hacking (@pxref{Using Guile in Emacs,,, guile, Guile Reference
Manual}).  First, you need more than an editor, you need
@url{http://www.gnu.org/software/emacs, Emacs}, empowered by the
wonderful @url{http://nongnu.org/geiser/, Geiser}.

Geiser allows for interactive and incremental development from within
Emacs: code compilation and evaluation from within buffers, access to
on-line documentation (docstrings), context-sensitive completion,
@kbd{M-.} to jump to an object definition, a REPL to try out your code,
and more (@pxref{Introduction,,, geiser, Geiser User Manual}).  For
convenient Guix development, make sure to augment Guile’s load path so
that it finds source files from your checkout:

@lisp
;; @r{Assuming the Guix checkout is in ~/src/guix.}
(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/src/guix"))
@end lisp

To actually edit the code, Emacs already has a neat Scheme mode.  But in
addition to that, you must not miss
@url{http://www.emacswiki.org/emacs/ParEdit, Paredit}.  It provides
facilities to directly operate on the syntax tree, such as raising an
s-expression or wrapping it, swallowing or rejecting the following
s-expression, etc.

@cindex code snippets
@cindex templates
@cindex reducing boilerplate
We also provide templates for common git commit messages and package
definitions in the @file{etc/snippets} directory.  These templates can
be used with @url{http://joaotavora.github.io/yasnippet/, YASnippet} to
expand short trigger strings to interactive text snippets.  You may want
to add the snippets directory to the @var{yas-snippet-dirs} variable in
Emacs.

@lisp
;; @r{Assuming the Guix checkout is in ~/src/guix.}
(with-eval-after-load 'yasnippet
  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
@end lisp

The commit message snippets depend on @url{https://magit.vc/, Magit} to
display staged files.  When editing a commit message type @code{add}
followed by @kbd{TAB} to insert a commit message template for adding a
package; type @code{update} followed by @kbd{TAB} to insert a template
for updating a package; type @code{https} followed by @kbd{TAB} to
insert a template for changing the home page URI of a package to HTTPS.

The main snippet for @code{scheme-mode} is triggered by typing
@code{package...} followed by @kbd{TAB}.  This snippet also inserts the
trigger string @code{origin...}, which can be expanded further.  The
@code{origin} snippet in turn may insert other trigger strings ending on
@code{...}, which also can be expanded further.

@node Coding Style
@section Coding Style

In general our code follows the GNU Coding Standards (@pxref{Top,,,
standards, GNU Coding Standards}).  However, they do not say much about
Scheme, so here are some additional rules.

@menu
* Programming Paradigm::        How to compose your elements.
* Modules::                     Where to store your code?
* Data Types and Pattern Matching::  Implementing data structures.
* Formatting Code::             Writing conventions.
@end menu

@node Programming Paradigm
@subsection Programming Paradigm

Scheme code in Guix is written in a purely functional style.  One
exception is code that involves input/output, and procedures that
implement low-level concepts, such as the @code{memoize} procedure.

@node Modules
@subsection Modules

Guile modules that are meant to be used on the builder side must live in
the @code{(guix build @dots{})} name space.  They must not refer to
other Guix or GNU modules.  However, it is OK for a ``host-side'' module
to use a build-side module.

Modules that deal with the broader GNU system should be in the
@code{(gnu @dots{})} name space rather than @code{(guix @dots{})}.

@node Data Types and Pattern Matching
@subsection Data Types and Pattern Matching

The tendency in classical Lisp is to use lists to represent everything,
and then to browse them ``by hand'' using @code{car}, @code{cdr},
@code{cadr}, and co.  There are several problems with that style,
notably the fact that it is hard to read, error-prone, and a hindrance
to proper type error reports.

Guix code should define appropriate data types (for instance, using
@code{define-record-type*}) rather than abuse lists.  In addition, it
should use pattern matching, via Guile’s @code{(ice-9 match)} module,
especially when matching lists.

@node Formatting Code
@subsection Formatting Code

@cindex formatting code
@cindex coding style
When writing Scheme code, we follow common wisdom among Scheme
programmers.  In general, we follow the
@url{http://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp
Style Rules}.  This document happens to describe the conventions mostly
used in Guile’s code too.  It is very thoughtful and well written, so
please do read it.

Some special forms introduced in Guix, such as the @code{substitute*}
macro, have special indentation rules.  These are defined in the
@file{.dir-locals.el} file, which Emacs automatically uses.  Also note
that Emacs-Guix provides @code{guix-devel-mode} mode that indents and
highlights Guix code properly (@pxref{Development,,, emacs-guix, The
Emacs-Guix Reference Manual}).

@cindex indentation, of code
@cindex formatting, of code
If you do not use Emacs, please make sure to let your editor knows these
rules.  To automatically indent a package definition, you can also run:

@example
./etc/indent-code.el gnu/packages/@var{file}.scm @var{package}
@end example

@noindent
This automatically indents the definition of @var{package} in
@file{gnu/packages/@var{file}.scm} by running Emacs in batch mode.  To
indent a whole file, omit the second argument:

@example
./etc/indent-code.el gnu/services/@var{file}.scm
@end example

@cindex Vim, Scheme code editing
If you are editing code with Vim, we recommend that you run @code{:set
autoindent} so that your code is automatically indented as you type.
Additionally,
@uref{https://www.vim.org/scripts/script.php?script_id=3998,
@code{paredit.vim}} may help you deal with all these parentheses.

We require all top-level procedures to carry a docstring.  This
requirement can be relaxed for simple private procedures in the
@code{(guix build @dots{})} name space, though.

Procedures should not have more than four positional parameters.  Use
keyword parameters for procedures that take more than four parameters.

@node Submitting Patches
@section Submitting Patches

Development is done using the Git distributed version control system.
Thus, access to the repository is not strictly necessary.  We welcome
contributions in the form of patches as produced by @code{git
format-patch} sent to the @email{guix-patches@@gnu.org} mailing list.

This mailing list is backed by a Debbugs instance accessible at
@uref{https://bugs.gnu.org/guix-patches}, which allows us to keep track
of submissions.  Each message sent to that mailing list gets a new
tracking number assigned; people can then follow up on the submission by
sending email to @code{@var{NNN}@@debbugs.gnu.org}, where @var{NNN} is
the tracking number (@pxref{Sending a Patch Series}).

Please write commit logs in the ChangeLog format (@pxref{Change Logs,,,
standards, GNU Coding Standards}); you can check the commit history for
examples.

Before submitting a patch that adds or modifies a package definition,
please run through this check list:

@enumerate
@item
If the authors of the packaged software provide a cryptographic
signature for the release tarball, make an effort to verify the
authenticity of the archive.  For a detached GPG signature file this
would be done with the @code{gpg --verify} command.

@item
Take some time to provide an adequate synopsis and description for the
package.  @xref{Synopses and Descriptions}, for some guidelines.

@item
Run @code{guix lint @var{package}}, where @var{package} is the
name of the new or modified package, and fix any errors it reports
(@pxref{Invoking guix lint}).

@item
Make sure the package builds on your platform, using @code{guix build
@var{package}}.

@item
@cindex bundling
Make sure the package does not use bundled copies of software already
available as separate packages.

Sometimes, packages include copies of the source code of their
dependencies as a convenience for users.  However, as a distribution, we
want to make sure that such packages end up using the copy we already
have in the distribution, if there is one.  This improves resource usage
(the dependency is built and stored only once), and allows the
distribution to make transverse changes such as applying security
updates for a given software package in a single place and have them
affect the whole system---something that bundled copies prevent.

@item
Take a look at the profile reported by @command{guix size}
(@pxref{Invoking guix size}).  This will allow you to notice references
to other packages unwillingly retained.  It may also help determine
whether to split the package (@pxref{Packages with Multiple Outputs}),
and which optional dependencies should be used.

@item
For important changes, check that dependent package (if applicable) are
not affected by the change; @code{guix refresh --list-dependent
@var{package}} will help you do that (@pxref{Invoking guix refresh}).

@c See <https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00933.html>.
@cindex branching strategy
@cindex rebuild scheduling strategy
Depending on the number of dependent packages and thus the amount of
rebuilding induced, commits go to different branches, along these lines:

@table @asis
@item 300 dependent packages or less
@code{master} branch (non-disruptive changes).

@item between 300 and 1,200 dependent packages
@code{staging} branch (non-disruptive changes).  This branch is intended
to be merged in @code{master} every 3 weeks or so.  Topical changes
(e.g., an update of the GNOME stack) can instead go to a specific branch
(say, @code{gnome-updates}).

@item more than 1,200 dependent packages
@code{core-updates} branch (may include major and potentially disruptive
changes).  This branch is intended to be merged in @code{master} every
2.5 months or so.
@end table

All these branches are @uref{https://hydra.gnu.org/project/gnu,
tracked by our build farm} and merged into @code{master} once
everything has been successfully built.  This allows us to fix issues
before they hit users, and to reduce the window during which pre-built
binaries are not available.

Generally, branches other than @code{master} are considered
@emph{frozen} if there has been a recent evaluation, or there is a
corresponding @code{-next} branch.  Please ask on the mailing list or
IRC if unsure where to place a patch.
@c TODO: It would be good with badges on the website that tracks these
@c branches.  Or maybe even a status page.

@item
@cindex determinism, of build processes
@cindex reproducible builds, checking
Check whether the package's build process is deterministic.  This
typically means checking whether an independent build of the package
yields the exact same result that you obtained, bit for bit.

A simple way to do that is by building the same package several times in
a row on your machine (@pxref{Invoking guix build}):

@example
guix build --rounds=2 my-package
@end example

This is enough to catch a class of common non-determinism issues, such
as timestamps or randomly-generated output in the build result.

Another option is to use @command{guix challenge} (@pxref{Invoking guix
challenge}).  You may run it once the package has been committed and
built by @code{hydra.gnu.org} to check whether it obtains the same
result as you did.  Better yet: Find another machine that can build it
and run @command{guix publish}.  Since the remote build machine is
likely different from yours, this can catch non-determinism issues
related to the hardware---e.g., use of different instruction set
extensions---or to the operating system kernel---e.g., reliance on
@code{uname} or @file{/proc} files.

@item
When writing documentation, please use gender-neutral wording when
referring to people, such as
@uref{https://en.wikipedia.org/wiki/Singular_they, singular
``they''@comma{} ``their''@comma{} ``them''}, and so forth.

@item
Verify that your patch contains only one set of related changes.
Bundling unrelated changes together makes reviewing harder and slower.

Examples of unrelated changes include the addition of several packages,
or a package update along with fixes to that package.

@item
Please follow our code formatting rules, possibly running the
@command{etc/indent-code.el} script to do that automatically for you
(@pxref{Formatting Code}).

@item
When possible, use mirrors in the source URL (@pxref{Invoking guix download}).
Use reliable URLs, not generated ones.  For instance, GitHub archives are not
necessarily identical from one generation to the next, so in this case it's
often better to clone the repository.  Don't use the @command{name} field in
the URL: it is not very useful and if the name changes, the URL will probably
be wrong.

@end enumerate

When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as
a subject.  You may use your email client or the @command{git
send-email} command (@pxref{Sending a Patch Series}).  We prefer to get
patches in plain text messages, either inline or as MIME attachments.
You are advised to pay attention if your email client changes anything
like line breaks or indentation which could potentially break the
patches.

When a bug is resolved, please close the thread by sending an email to
@email{@var{NNN}-done@@debbugs.gnu.org}.

@unnumberedsubsec Sending a Patch Series
@anchor{Sending a Patch Series}
@cindex patch series
@cindex @code{git send-email}
@cindex @code{git-send-email}

When sending a patch series (e.g., using @code{git send-email}), please
first send one message to @email{guix-patches@@gnu.org}, and then send
subsequent patches to @email{@var{NNN}@@debbugs.gnu.org} to make sure
they are kept together.  See
@uref{https://debbugs.gnu.org/Advanced.html, the Debbugs documentation}
for more information.
@c Debbugs bug: https://debbugs.gnu.org/db/15/15361.html


code:
(use-modules (guix)
             (gnu packages gdb)
             (gnu packages autotools)
             (gnu packages texinfo))

;; Augment the package definition of GDB with the build tools
;; needed when developing GDB (and which are not needed when
;; simply installing it.)
(package (inherit gdb)
  (native-inputs `(("autoconf" ,autoconf-2.64)
                   ("automake" ,automake)
                   ("texinfo" ,texinfo)
                   ,@(package-native-inputs gdb))))


code:
@c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008

@c This file is intended to be included within another document,
@c hence no sectioning command or @node.

@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display

@enumerate 0
@item
PREAMBLE

The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.

This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.

@item
APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The ``Document'', below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as ``you''.  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.

A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject.  (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.

The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.

A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not ``Transparent'' is called ``Opaque''.

Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, La@TeX{} input
format, SGML or XML using a publicly available
DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification.  Examples
of transparent image formats include PNG, XCF and
JPG.  Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, SGML or
XML for which the DTD and/or processing tools are
not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for
output purposes only.

The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.

The ``publisher'' means any person or entity that distributes copies
of the Document to the public.

A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.

The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.

@item
VERBATIM COPYING

You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and
you may publicly display copies.

@item
COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.

It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.

@item
MODIFICATIONS

You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:

@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document).  You may use the same title as a previous version
if the original publisher of that version gives permission.

@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.

@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.

@item
Preserve all the copyright notices of the Document.

@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.

@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.

@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.

@item
Include an unaltered copy of this License.

@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page.  If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.

@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on.  These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.

@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.

@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles.  Section numbers
or the equivalent are not considered part of the section titles.

@item
Delete any section Entitled ``Endorsements''.  Such a section
may not be included in the Modified Version.

@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.

@item
Preserve any Warranty Disclaimers.
@end enumerate

If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.

You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.

@item
COMBINING DOCUMENTS

You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''.  You must delete all
sections Entitled ``Endorsements.''

@item
COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.

@item
AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.

@item
TRANSLATION

Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.

If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.

@item
TERMINATION

You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.

However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.

Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.

@item
FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
@uref{http://www.gnu.org/copyleft/}.

Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.  If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.

@item
RELICENSING

``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works.  A
public wiki that anybody can edit is an example of such a server.  A
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
site means any set of copyrightable works thus published on the MMC
site.

``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.

``Incorporate'' means to publish or republish a Document, in whole or
in part, as part of another Document.

An MMC is ``eligible for relicensing'' if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.

The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.

@end enumerate

@page
@heading ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:

@smallexample
@group
  Copyright (C)  @var{year}  @var{your name}.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.3
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the section entitled ``GNU
  Free Documentation License''.
@end group
@end smallexample

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with@dots{}Texts.''@: line with this:

@smallexample
@group
    with the Invariant Sections being @var{list their titles}, with
    the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
    being @var{list}.
@end group
@end smallexample

If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End: