Difference between revisions of "Linux:Construire depuis la source"

From Gramps
Jump to: navigation, search
m (Build Gramps 4.x)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{languages|Linux:Build from source}}
 
{{languages|Linux:Build from source}}
  
This page describes how to build Gramps from source on Linux. Building from source is appropriate for:
+
{{stub|fr}}
 +
 
 +
Cette page décrit comment construire Gramps sous Linux à partir du code source. Construire depuis la source est utile pour :
 +
 
 
* Developers who need to be able to modify the source and have those modifications take effect.
 
* Developers who need to be able to modify the source and have those modifications take effect.
 
* Packagers who need to be able to construct a package for installation by user.
 
* Packagers who need to be able to construct a package for installation by user.
Line 27: Line 30:
 
'''Note that you should use your old Gramps version to export backup copies to GRAMPS XML before removing the old version.'''
 
'''Note that you should use your old Gramps version to export backup copies to GRAMPS XML before removing the old version.'''
  
=Installation depuis les sources=
+
=Obtenir le code source=
 +
 
 +
Il y a deux méthodes pour obtenir le code source : télécharger le code de la version stable, ou depuis SVN. Prenez le temps de lire les fichiers [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/INSTALL?view=markup INSTALL] et [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/README?view=markup README] qui accompagnent le code. Ils contiennent les dernières informations. Voici en détails les différentes méthodes :
 +
 
 +
'''1. Télécharger la version stable'''
 +
 
 +
La dernière version stable de GRAMPS peut être téléchargée depuis la [http://sourceforge.net/projects/gramps page SourceForge de GRAMPS]. Actuellement, c'est gramps-{{version}}.tar.gz. Extraire les données dans le répertoire : <code>
 +
  tar xzvf gramps-zzz.tar.gz
 +
</code> puis allez dans le répertoire :<code>
 +
  cd gramps-zzz
 +
</code>
 +
* Si vous êtes intéressé(e) pour tester la dernière version en développement de GRAMPS, vous pouvez l'obtenir depuis le SVN, voir [[Brief introduction to SVN|Brève introduction à SVN]]. La version SVN de GRAMPS est potentiellement très dangereuse car elle n'est pas complètement testée. Elle peut planter et causer des pertes de données. SVP utilisez là avec attention.
 +
 
 +
'''2. Télécharger depuis SVN'''
 +
 
 +
Vous pouvez obtenir la version SVN, avec la commande:
 +
 
 +
pour télécharger une version :
 +
 
 +
svn co https://svn.code.sf.net/p/gramps/code/tags/gramps-4.0.0/ gramps
 +
 
 +
ou la dernière version en dévelopement:
 +
 
 +
svn co https://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps{{stable_branch}} gramps{{stable_branch}}
 +
 
 +
=Compiler Gramps 3.4.x=
  
 
==Conditions nécessaires==
 
==Conditions nécessaires==
  
GRAMPS {{version}} a besoin des paquets python 2.x, pygtk2 (python-gtk pour SUSE).  
+
GRAMPS 3.x a besoin des paquets python 2.x, pygtk2 (python-gtk pour SUSE).  
 
Le paquet pygtk devrait être la version 2.16 ou supérieur.
 
Le paquet pygtk devrait être la version 2.16 ou supérieur.
  
 
Le paquet librsvg2-common est nécessaire. C'est une erreur courante, sans cette bibliothèque, les icônes ne s'affichent pas.
 
Le paquet librsvg2-common est nécessaire. C'est une erreur courante, sans cette bibliothèque, les icônes ne s'affichent pas.
  
=== Paquets nécessaires selon les distributions ===
+
== Paquets nécessaires selon les distributions ==
  
 
  Paquets                Commentaire
 
  Paquets                Commentaire
Line 60: Line 88:
 
  WebKit-gtk            Requis pour la vue HTML
 
  WebKit-gtk            Requis pour la vue HTML
 
  pywebkitgtk            Requis pour la vue HTML
 
  pywebkitgtk            Requis pour la vue HTML
  goocanvas              Requis pour [[Graph View]]
+
  goocanvas              Requis pour [[Addon:Graph View]]
  pygoocanvas            Requis pour [[Graph View]]
+
  pygoocanvas            Requis pour [[Addon:Graph View]]
 
  Django                Requis pour http://gramps-connect.org
 
  Django                Requis pour http://gramps-connect.org
 
  pyexiv2                Requis pour les gramplets visualiseur et éditeur de métadonnées
 
  pyexiv2                Requis pour les gramplets visualiseur et éditeur de métadonnées
 
==Obtenir les sources==
 
 
Il y a deux méthodes pour obtenir le code source : télécharger les sources de la version stable, ou les sources depuis SVN. Prenez le temps de lire les fichiers [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/INSTALL?view=markup INSTALL] et [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/README?view=markup README] qui accompagnent le code. Ils contiennent les dernières informations. Voici en détails les différentes méthodes :
 
 
'''1. Télécharger la version stable'''
 
 
La dernière version stable de GRAMPS peut être téléchargée depuis la [http://sourceforge.net/projects/gramps page SourceForge de GRAMPS]. Actuellement, c'est gramps-{{version}}.tar.gz. Extraire les données dans le répertoire : <code>
 
  tar xzvf gramps-zzz.tar.gz
 
</code> puis allez dans le répertoire :<code>
 
  cd gramps-zzz
 
</code>
 
* Si vous êtes intéressé pour tester la dernière version en développement de GRAMPS, vous pouvez l'obtenir depuis le SVN, voir [[Brief introduction to SVN|Brève introduction à SVN]]. La version SVN de GRAMPS est potentiellement très dangereuse car elle n'est pas complètement testée. Elle peut planter et causer des pertes de données. SVP utilisez là avec attention.
 
 
'''2. Télécharger depuis SVN'''
 
 
Vous pouvez obtenir la version SVN, avec la commande:
 
 
pour télécharger une version :
 
 
svn co <nowiki>https://svn.code.sf.net/p/gramps/code/tags/gramps-4.0.0/ gramps</nowiki>
 
 
ou la dernière version en dévelopement:
 
 
svn co <nowiki>https://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps40 gramps40</nowiki>
 
  
 
==Installer Gramps 3.4 depuis le code source sous Linux==
 
==Installer Gramps 3.4 depuis le code source sous Linux==
Line 103: Line 106:
 
   make install</code>
 
   make install</code>
  
== Installer les dépendances pour Gramps 4.x ==
+
=Compiler Gramps 4.x =
  
==== Conditions nécessaires ====
+
{{stub|fr}}
 +
 
 +
=== Conditions nécessaires ===
  
 
Gramps 4.0 requires python 2.7 or python 3.2 or greater. At the moment, python 2.7 is still the most stable way to use Gramps!
 
Gramps 4.0 requires python 2.7 or python 3.2 or greater. At the moment, python 2.7 is still the most stable way to use Gramps!
 
Also needed are GTK 3.0 or greater, pygobject 3.3.2 or greater, cairo, pango, pangocairo with introspection bindings (the gi packages), librsvg2 (svg icon view), xdg-utils. Furthermore, bsddb3 is required for Python 3.2 (not python 2.7).
 
Also needed are GTK 3.0 or greater, pygobject 3.3.2 or greater, cairo, pango, pangocairo with introspection bindings (the gi packages), librsvg2 (svg icon view), xdg-utils. Furthermore, bsddb3 is required for Python 3.2 (not python 2.7).
  
==== Paquets nécessaires ====
+
=== Paquets nécessaires ===
 
The full list of requirements is given in the [http://sourceforge.net/p/gramps/code/HEAD/tree/trunk/README README] file.
 
The full list of requirements is given in the [http://sourceforge.net/p/gramps/code/HEAD/tree/trunk/README README] file.
  
Line 246: Line 251:
 
| python-pygoocanvas gir1.2-goocanvas-2.0-9
 
| python-pygoocanvas gir1.2-goocanvas-2.0-9
 
| goocanvas pygoocanvas
 
| goocanvas pygoocanvas
| Required for [[Graph View]]
+
| Required for [[Addon:Graph View]]
 
|-
 
|-
 
|
 
|
Line 278: Line 283:
 
  python Gramps.py
 
  python Gramps.py
  
== Full install walkthrough Gramps 4.0 Ubuntu derivatives ==
+
= Full install walkthrough Gramps 4 Ubuntu derivatives =
  
 
Following walkthrough was done on a clean install of Kubuntu 13.04 which did have the GTK applications firefox, inkscape and gimp installed. Equal steps should be done on other platforms.
 
Following walkthrough was done on a clean install of Kubuntu 13.04 which did have the GTK applications firefox, inkscape and gimp installed. Equal steps should be done on other platforms.
  
 
  sudo apt-get install subversion
 
  sudo apt-get install subversion
  svn co <nowiki>https://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps40</nowiki> gramps40
+
  svn co <nowiki>https://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps</nowiki>{{last_branch}}  gramps{{last_branch}}
  cd gramps40
+
  cd gramps{{last_branch}}
 
  sudo apt-get install intltool
 
  sudo apt-get install intltool
 
  python setup.py build
 
  python setup.py build
Line 354: Line 359:
 
then use the gnome-tweak-tool to switch to that. For KDE you need to go also to Settings->Appearance->GTK and set the GTK 3 theme there to the one you installed.
 
then use the gnome-tweak-tool to switch to that. For KDE you need to go also to Settings->Appearance->GTK and set the GTK 3 theme there to the one you installed.
  
==== Full install walkthrough Windows ====
+
=== Full install walkthrough Windows ===
 
On windows, you can install [https://www.virtualbox.org/ virtualbox] and then install K/X/Ubuntu as indicated above, which will give you linux in windows.  
 
On windows, you can install [https://www.virtualbox.org/ virtualbox] and then install K/X/Ubuntu as indicated above, which will give you linux in windows.  
  
 
The native windows support for Gramps 4.0 is being worked on. You find the current walkthrough [[Run_Gramps40_for_Windows_from_source_using_Python_2.7.3|on the dedicated page]]
 
The native windows support for Gramps 4.0 is being worked on. You find the current walkthrough [[Run_Gramps40_for_Windows_from_source_using_Python_2.7.3|on the dedicated page]]
  
 +
=Voir également =
  
== Voir également ==
+
* $GRAMPSHOME sur [[Gramps_4.1_Wiki Manual - Command Line/fr#Variables d'environnement]]
 
 
* $GRAMPSHOME sur [[Gramps 4.0 Wiki Manual - Command Line/fr#Variables d'environnement]]
 
 
* [[Translating_Gramps#.24GRAMPSI18N_.28for_your_locale.29| $GRAMPSI18N (pour votre localisation) ]]
 
* [[Translating_Gramps#.24GRAMPSI18N_.28for_your_locale.29| $GRAMPSI18N (pour votre localisation) ]]
 
* [[Installation_alternatives|Installations alternatives]]
 
* [[Installation_alternatives|Installations alternatives]]

Latest revision as of 03:03, 17 January 2022

Gramps-notes.png

Ébauche

À compléter !

Si vous pouvez aider à la traduction ou l'adapter à la culture francophone.

N'hésitez pas à améliorer cette page.


Cette page décrit comment construire Gramps sous Linux à partir du code source. Construire depuis la source est utile pour :

  • Developers who need to be able to modify the source and have those modifications take effect.
  • Packagers who need to be able to construct a package for installation by user.
  • Advanced or experienced users who might want to install a version of Gramps that differs from the version that comes with their distribution.

To Build Gramps, the following considerations are important (though they do not necessarily need to be done in this sequence). They are covered below:

  1. Decide where to build/install Gramps. If you already have a version of Gramps you need to decide whether you will install in the same place, overwriting the existing version, or install elsewhere.
  2. Obtain the source. This might be a released source, or a development version. The released version may be a normal release, or an unstable alpha or beta release. The development version may be subject to continual change.
  3. Install all dependencies.
  4. Build and install Gramps.

Installing dependencies and building Gramps are considered separately for Gramps 3.x and Gramps 4.x.

Decide where to install

If you have an older version of the Gramps source code installed you need to make a decision what you want to do with it before installing a later version. If you wish to keep the old version, make sure that you read the instructions in the INSTALL file regarding the use of the --prefix option to specify where the new version gets installed.

See Installation_alternatives.

Should you just want to do a straightforward replacement instead, make sure that you remove the older version before you install the new version. Do not install over the top of the old version. As new versions of Gramps are developed, some functionality is occasionally rewritten in different ways. If you install over the top of an existing installation you run the risk that the old code left behind from the old version may be used instead of the new, sometimes with unintended consequences. If you installed from source, the best way of removing the old version is to run

 make uninstall

as root from where you installed the old version. Use your distribution's package manager to uninstall if your old version was installed as a package.

Note that you should use your old Gramps version to export backup copies to GRAMPS XML before removing the old version.

Obtenir le code source

Il y a deux méthodes pour obtenir le code source : télécharger le code de la version stable, ou depuis SVN. Prenez le temps de lire les fichiers INSTALL et README qui accompagnent le code. Ils contiennent les dernières informations. Voici en détails les différentes méthodes :

1. Télécharger la version stable

La dernière version stable de GRAMPS peut être téléchargée depuis la page SourceForge de GRAMPS. Actuellement, c'est gramps-5.2.1.tar.gz. Extraire les données dans le répertoire :

  tar xzvf gramps-zzz.tar.gz

puis allez dans le répertoire :

  cd gramps-zzz

  • Si vous êtes intéressé(e) pour tester la dernière version en développement de GRAMPS, vous pouvez l'obtenir depuis le SVN, voir Brève introduction à SVN. La version SVN de GRAMPS est potentiellement très dangereuse car elle n'est pas complètement testée. Elle peut planter et causer des pertes de données. SVP utilisez là avec attention.

2. Télécharger depuis SVN

Vous pouvez obtenir la version SVN, avec la commande:

pour télécharger une version :

svn co https://svn.code.sf.net/p/gramps/code/tags/gramps-4.0.0/ gramps

ou la dernière version en dévelopement:

svn co https://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps52 gramps52

Compiler Gramps 3.4.x

Conditions nécessaires

GRAMPS 3.x a besoin des paquets python 2.x, pygtk2 (python-gtk pour SUSE). Le paquet pygtk devrait être la version 2.16 ou supérieur.

Le paquet librsvg2-common est nécessaire. C'est une erreur courante, sans cette bibliothèque, les icônes ne s'affichent pas.

Paquets nécessaires selon les distributions

Paquets                Commentaire
---------------------  --------------------------------
python                 Nécessaire (besoin de la version 2.6 ou supérieure) 
pygtk2                 Nécessaire (besoin de la version 2.16 ou supérieure)
librsvg2               Nécessaire pour les icônes (également appelé librsvg2-common)
xdg-utils              Nécessaire (Gramps-3.1.x et +)
BSDDB                  La base de données
librsvg2-devel         Nécessaire pour la compilation
intltool >=0.25        Nécessaire pour la compilation
glib-gettext >=2.2.0   Nécessaire pour la compilation (présent dans le paquet libglib2.0-dev)
gcc make gettext       Nécessaire pour la compilation
Paquets                Commentaire
---------------------  --------------------------------
rcs                    Suggéré
graphviz               Optionnel mais nécessaire pour exporter des arbres complexes
gnome-python2-gtkspell Optionnel mais nécessaire pour le vérificateur orthographique
libosmgpsmap-dev       Requis pour la vue Géographie
python-osmgpsmap       Requis pour la vue Géographie
osm-gps-map            Requis pour la vue Géographie 
WebKit-gtk             Requis pour la vue HTML
pywebkitgtk            Requis pour la vue HTML
goocanvas              Requis pour Addon:Graph View
pygoocanvas            Requis pour Addon:Graph View
Django                 Requis pour http://gramps-connect.org
pyexiv2                Requis pour les gramplets visualiseur et éditeur de métadonnées

Installer Gramps 3.4 depuis le code source sous Linux

GRAMPS fournit un script qui peut être utilisé pour préparer le code à la construction. Ce script appel automatiquement le script standard configure :

  ./autogen.sh

Ce script rapportera toutes les dépendances manquantes. Installez les (voir également le fichier INSTALL). Construire depuis le code source est typiquement exigé pour les versions de développement. Vous devrez considérer le réglage d'un chemin de préfixe via autogen.sh ou configure, voir le fichier INSTALL pour les instructions. L'installation standard est sous /usr/local. Si la traduction n'est pas active, essayez :

 ./configure --prefix=/usr

Une fois que vous avez réussi sans erreur, vous pouvez lancer la procédure make typique.

  make
  make install

Compiler Gramps 4.x

Gramps-notes.png

Ébauche

À compléter !

Si vous pouvez aider à la traduction ou l'adapter à la culture francophone.

N'hésitez pas à améliorer cette page.


Conditions nécessaires

Gramps 4.0 requires python 2.7 or python 3.2 or greater. At the moment, python 2.7 is still the most stable way to use Gramps! Also needed are GTK 3.0 or greater, pygobject 3.3.2 or greater, cairo, pango, pangocairo with introspection bindings (the gi packages), librsvg2 (svg icon view), xdg-utils. Furthermore, bsddb3 is required for Python 3.2 (not python 2.7).

Paquets nécessaires

The full list of requirements is given in the README file.

Required

Debian /Ubuntu Fedora /Redhat Comment
python python Required (needs version 2.7 or later or 3.2 or later)
python-gobject, python-gi ? Required (needs pygobject 3.3.2 or greater)
python-cairo python-gi-cairo ? Required
gir1.2-pango-1.0 ? Required
gir1.2-gtk ? Required is GTK 3.6+
BSDDB BSDDB Current backend, python3-bsddb3 for python 3!
xdg-utils xdg-utils Required for Gramps-3.1.x or later
libgtkspell-3-0 python-gtkspell ? Required spell checking

Required for building

Debian /Ubuntu Fedora /Redhat Comment
librsvg2-common librsvg2 Required for building
python-dev libglib2.0-dev glib2-devel Required for building
python-gobject-dev libgirepository1.0-dev ?
libcairo2-dev python-cairo-dev ?
librsvg2-devel Required for building
intltool intltool Required for building
gcc make gettext Required for building

Strongly recommended

Debian /Ubuntu Fedora /Redhat Comment
libosmgpsmap-dev python-osmgpsmap osm-gps-map Required for the Geography views
graphviz graphviz graphviz-python Required for some reports and views
python-pyicu ? Required for correct sorting

Optional

Debian /Ubuntu Fedora /Redhat Comment
python-gtkspell gnome-python2-gtkspell Suggested for running (spell check). Included in the python-gnome2-extras package in older Debian distributions.
rcs rcs Suggested for running
Python Image Library ? ?
python-pyexiv2 pyexiv2 Required for the Metadata Viewer and Edit Exif Metadata gramplets
ttf-treefont ? ?
python-webkit python-gtkmozembed WebKitgtk pywebkitgtk Required for the HTML view
python-pygoocanvas gir1.2-goocanvas-2.0-9 goocanvas pygoocanvas Required for Addon:Graph View
Django Required for http://gramps-connect.org Gramps-Connect
gtk2-engines-pixbuf Solves issue with 'Unable to locate theme engine in module_path: "pixmap"'

Under Redhat/Fedora you can install all of the above with:

sudo yum install python pygtk2 xdg-utils rcs gnome-python2-gtkspell librsvg2 \
  librsvg2-devel intltool gnome-doc-utils gcc automake autoconf autogen \
  gettext WebKitgtk pywebkitgtk goocanvas pygoocanvas graphviz graphviz-python \
  Django pyexiv2 inkscape ImageMagick

Local installation without root privileges is possible, instructions are available on the INSTALL file.

Construire et installer Gramps 4.x

python setup.py build

If you now run

python Gramps.py -v

you should see all required packages are found. You can now start Gramps locally with the command

python Gramps.py

Full install walkthrough Gramps 4 Ubuntu derivatives

Following walkthrough was done on a clean install of Kubuntu 13.04 which did have the GTK applications firefox, inkscape and gimp installed. Equal steps should be done on other platforms.

sudo apt-get install subversion
svn co https://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps51  gramps51
cd gramps51
sudo apt-get install intltool
python setup.py build
sudo apt-get install python-gobject python-gi python-cairo python-gi-cairo
sudo apt-get install gir1.2-freedesktop gir1.2-pango
sudo apt-get install gir1.2-gtk

If you now run

python Gramps.py -v

you should see all required packages are found. You can now start Gramps locally with the command

python Gramps.py 

To install optional components, do the following:

sudo apt-get install python-pyicu graphviz rcs gir1.2-webkit-3

This gives all the easy optional functionality in Gramps. The rest is not yet present in Ubuntu 13.04, so if you want them, you need to compile them

spell checking Remove first present version, check that this command does not remove programs you use!

  sudo apt-get remove libgtkspell-3-0 python-gtkspellcheck

Now we obtain the code to build this package

 sudo apt-get install mercurial
 hg clone http://hg.code.sf.net/p/gtkspell/code gtkspell-code
 cd gtkspell-code
 sudo apt-get install build-essential sudo apt-get install libgirepository1.0-dev
 sudo apt-get install valac libgtk-3-dev
 aclocal ; autoheader; automake ; autoconf
 ./autogen.sh
 make
 sudo make install
 sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/
 sudo cp /usr/local/lib/libgtkspell3-3.* /usr/lib/

osmgpsmap The geography view needs patches which are not included yet in the official version.

 sudo apt-get install git
 git clone git://github.com/nzjrs/osm-gps-map.git
 cd osm-gps-map
 sudo apt-get install libsoup2.4-dev gnome-common gtk-doc-tools
 ./autogen.sh --prefix /usr
 make
 sudo make install
 

gexiv2 Minimally version 0.5 is needed, but only 0.4 is available in 13.04. So remove 0.4 if present, and we add 0.5 or later ourselves. Obtain it from [1], I downloaded 0.6.1, and extracted it in directory libgexiv2-0.6.1. To install this

 cd libgexiv2-0.6.1
 sudo apt-get install exiv2 libexiv2-dev
 ./configure --enable-introspection --prefix=/usr
  make
  sudo make install

run Gramps You can now use gramps from the source directory with

 python Gramps.py

You could install Gramps, but you better wait for a packages distributed from [2] and install those via your package manager

look and feel Normally, Gramps does not look that nicely when not used on Gnome desktop. To remedy this, install a theme switcher. You can edit configuration files if you don't like to install these dependencies, see eg [3]

sudo apt-get install gnome-tweak-tool

You can search on gtk 3 themes in your package manager and install one that you like. For example, install clearlooks:

sudo apt-get install clearlooks-phenix-theme

then use the gnome-tweak-tool to switch to that. For KDE you need to go also to Settings->Appearance->GTK and set the GTK 3 theme there to the one you installed.

Full install walkthrough Windows

On windows, you can install virtualbox and then install K/X/Ubuntu as indicated above, which will give you linux in windows.

The native windows support for Gramps 4.0 is being worked on. You find the current walkthrough on the dedicated page

Voir également