Changes

Jump to: navigation, search

Linux:Build from source

2,911 bytes added, 03:03, 17 January 2022
no edit summary
{{languages|Linux:Build from source}}{{stub}}How to build Gramps from source on Linux.
This page describes how to build Gramps from source on Linux. Building from source is appropriate for:
* 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.
# Build and install Gramps.
Installing dependencies and building Gramps are considered separately for [[Linux:Build_from_source#Install_dependencies_for_Gramps_3.4.x|Gramps 3.x ]] and Gramps 4.x0 - 4.1 and Gramps 4.2+
== Decide where to install ==
 
{{man warn|Note Backup your old Family Trees before removing the old version of Gramps|You should use your old Gramps version to export backup copies to GRAMPS XML before removing the old Gramps version.}}
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_alternativesInstallation 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<code> make uninstall</code> 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.''' == Obtain the source == There are two ways to get the source code: download a released version source, or checkout the source from svn. Please, now is the time to read the [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/INSTALL?view=markup INSTALL] and [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/README?view=markup README] files accompanying the code. They come with the most recent information. Details on each download method: === Download a release === * The latest stable version of Gramps can be downloaded from the [http://sourceforge.net/projects/gramps/files/ Gramps SourceForge file area]. Eg: gramps-{{version}}.tar.gz. Extract this file into a directory:<code> tar xzvf gramps-zzz.tar.gz</code> and then go into this directory:<code> cd gramps-zzz</code>
=== Download Should you just want to do a straightforward replacement instead, make sure that you remove the source 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 svn ===the old version may be used instead of the new, sometimes with unintended consequences.
* If you are interested in testing out installed from source, the very latest development versions best way of removing the old Gramps, they can be obtained from SVN, see [[Brief introduction to SVN#Unstable_development:_3.22trunk.22|Brief introduction x or earlier version is to SVN]]. The SVN versions of Gramps are potentially very dangerous run <code>make uninstall</code> as they have not been extensively tested - especially root '''from where you installed the "trunk" old version which contains features that may still be partly implemented. Be aware that they may be prone to crashing and cause extensive data loss'''. Please use with extreme caution - and only ever on a copy of your data!
You can get a branch Or use your distribution's package manager to uninstall if your old Gramps version (similar was installed as above) or the latest bleeding-edge version through SVN, You can download a specific release via a tag, or you can download the latest developmentpackage.
First, you need subversion installed, eg on Debian based linux: sudo apt-get install subversion= Gramps 4.2 and up=
Then, download a tagged version:{{man menu|Gramps 4.2 and beyond only work with Python 3.2 or greater.}} This should be handled automatically if Gramps is installed from your distro's repository.
svn co <nowiki>https://svn.code.sf.net/p/gramps/code/tags/gramps-4.0.0/ gramps</nowiki> If installing using a tar or latest development:  svn co <nowiki>https://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps40 gramps40</nowiki> for the most recent development versiongit source, see [[Getting started you need to replace 'python' with Gramps Trunk]]. == Install dependencies 'python3' for Gramps 3.4the various setup and run commands below.x ==
==== General requirements ====The following packages are required, and should be installed automatically as dependencies with the Gramps package. (This list is for Gramps 4.2.0 on Kubuntu 15.10.)
Gramps 3{{man note|For v5.x requires python 20 add sqlite3.6 or greater, pygtk 2.16 or greater and librsvg2}}
==== Linux package requirements ====
{|{{Prettytable}}
|-
!Comment
|-
|pythongir1.2-atk-1.0| | |-| gir1.2-freedesktop| | |-| gir1.2-gdkpixbuf-2.0| | |-| gir1.2-gexiv2-0.10| | |-| gir1.2-gtk-3.0| | |python -|Required (needs version gir1.2-osmgpsmap-1.6 or later)0| |
|-
|pythongir1.2-pango-gtk21.0|pygtk2|Required (needs 2.16 or greater)
|-
|[http://docs.python.org/library/bsddb.html BSDDB]graphviz|[http://docs.python.org/library/bsddb.html BSDDB]|Current backend
|-
|librsvg2-commonlibcdt5|librsvg2|Required for building
|-
|libglib2.0-devlibcgraph6|glib2-devel|Required for building
|-
| libgexiv2-2
|
|
|librsvg2-devel
|Required for building
|-
|intltoollibgvc6|intltool|Required for building
|-
| libgvpr2
|
|
|gcc make gettext
|Required for building
|-
| libosmgpsmap-1.0
|
|
|-
|xdg-utilslibpathplan4|xdg-utils|Required for Gramps-3.1.x or later
|-
|rcspython3-bsddb3|rcs|Suggested for running
|-
|pythonpython3-gtkspellcairo|gnome-python2-gtkspell|Suggested for running (spell check). Included in the python-gnome2-extras package in older Debian distributions.
|-
| pythonpython3-webkit pythongi-gtkmozembedcairo| WebKitgtk pywebkitgtk| Required for the HTML view
|-
| pythonpython3-pygoocanvasicu| goocanvas pygoocanvas| Required for [[Graph View]]
|-
| graphvizpython3.5| graphviz graphviz-python| Required for some reports and views
|-
| python3.5-minimal
|
| Django| Required for http://gramps-connect} With the standard dependencies, Gramps still gives some warnings about missing packages. The following packages address these warnings.org [[Gramps-Connect: Introduction {|{{Prettytable}}|Gramps-Connect]]!Debian /Ubuntu !Fedora /Redhat!Comment
|-
| pythonlanguage-pyexiv2pack-gnome-en| pyexiv2| Required or the equivalent for the Metadata Viewer your language and Edit Exif Metadata grampletslocale
|-
| libosmgpsmapgir1.2-dev pythongoocanvas-osmgpsmap2.0| osm-gps-map| Required for the Geography views
|-
| gtk2python3-engines-pixbufdjango|
|
| Solves issue with 'Unable to locate theme engine in module_path: "pixmap"'
|}
Under Redhat/Fedora you = Gramps 4.0 to 4.1 = == Obtain the source ==There are two ways to get the source code: download a released version source, or clone the source from Git.  {{man tip|Now is the time to read the [{{Code Base}}INSTALL INSTALL] and [{{Code Base}}README.md README] files accompanying the code.| They come with the most recent information.}} Details on each download method: === Download a release === * The latest stable version of Gramps can install all of be downloaded from the above with[https://github.com/gramps-project/gramps/releases Gramps Github file Releases area]. Eg: gramps-{{version}}.tar.gz. Extract this file into a directory:<code>tar xzvf gramps-zzz.tar.gz </code> and then go into this directory:
<precode>sudo yum install python pygtk2 xdgcd gramps-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 ImageMagickzzz</precode>
Under Debian/Ubuntu you can install all of === Download the above with:source from Git ===
<pre>sudo apt* If you are interested in testing out the very latest development versions of Gramps, they can be obtained from Git, see [[Brief introduction to Git#Unstable_development|Brief introduction to Git]]. The Git versions of Gramps are potentially very dangerous as they have not been extensively tested -get install python python-gtk2 librsvg2-common libglib2especially the master branch which contains features that may still be partly implemented. Be aware that they may be prone to crashing and cause extensive data loss.0-dev \ intltool xdg-utils rcs python-gtkspell \ python-webkit python-gtkmozembed python-pygoocanvas graphviz python-pyexiv2 \ libosmgpsmap-dev python-osmgpsmap gtk2-enginesPlease use with extreme caution -pixbuf</pre>and only ever on a copy of your data!
== Build, Install and Run You can get the Gramps 3repository through Git.4.x ==First, you need Git installed, eg on Debian based linux: sudo apt-get install git
Gramps provides a script that can be used to prepare Then, clone the code for building. This script automatically calls the standard configure scriptrepository:<code> ./autogen.sh </code> # as regular user
This script will report any missing dependencies. Install these (see also INSTALL file). Building from source code typically requires that the development versions of the required libraries be installed. You might consider setting a prefix path with autogen.sh, see the INSTALL file for instructions git clone https://github. Standard install is in com/usrgramps-project/localgramps.git Gramps
Once a successful run of autogen.sh has been completed, A branch called ''master'' containing the latest development code will be created for you can run the typical make procedure. <code> make </code> # as regular user
then <code> make install </code> # as rootTo checkout a maintenance branch use:
Local installation without root privileges is possible, instructions are available on the INSTALL file, most importantly one needs to supply a <code> git checkout --prefix=</code> and a <code>--with-mime-dir=<b gramps42 origin/code> argument to <code>autogen.sh<maintenance/code>.gramps42
Starting Gramps - TBD{{man note|Note|replace 42 with the latest branch {{last_branch}} if required.}}
== Install dependencies for Gramps 4.x ==
==== General requirements ====
Gramps 4.0 to Gramp 4.1 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).
==== Linux package requirements ====
The full list of requirements is given in the [httphttps://sourceforgegithub.netcom/pgramps-project/gramps/code/HEAD/treeblob/trunkmaster/README .md README] file.
Required
| [http://docs.python.org/library/bsddb.html BSDDB]
| [http://docs.python.org/library/bsddb.html BSDDB]
| Current backend, <code>python3-bsddb3 </code> for python 3!
|-
| xdg-utils
| libgtkspell-3-0 python-gtkspell
| ?
| Required spell checking(eg, with hunspell)
|}
| Required for building
|-
| [https://launchpad.net/intltool intltool]
| intltool
| intltool| Required for building( Internationalization Tool Collection - Utility scripts for internationalizing XML.)
|-
|
| 'Not available'
| 'Not available'
| osmgpsmap. Required for the Geography views. Needs patches that are not available in the official version. Needs to be built from source. See [http://www.gramps-project.org/wiki/index.php?title=[GEPS_029:_GTK3-GObject_introspection_Conversion#OsmGpsMap_for_Geography | compile and install OsmGpsMap]]
|-
| graphviz
| 'Not available'
| 'Not available'
| gtkspell. Suggested for running (spell check). Needs to be build from source. See [http://www.gramps-project.org/wiki/index.php?title=[GEPS_029:_GTK3-GObject_introspection_Conversion#Spell_Check_Install |install spell check]]
|-
| rcs
| ?
|-
| gir1.2-gexiv2-0.4
| 'Not available'
| 'Not available'| gexiv2 Required for the Metadata Viewer and Edit Exif Metadata gramplets. Minimally version 0.5 is needed, but only 0.4 is available in Ubuntu 13.04. Needs to be build from source.gramplet
|-
| ttf-treefont
| python-pygoocanvas gir1.2-goocanvas-2.0-9
| goocanvas pygoocanvas
| Required for [[Addon:Graph View]]
|-
|python3-django
| Django
| Required for http://gramps-connect.org [[Gramps-Connect: Introduction|Gramps-Connect]]
gettext WebKitgtk pywebkitgtk goocanvas pygoocanvas graphviz graphviz-python \
Django pyexiv2 inkscape ImageMagick
</pre>
 
Under Debian/Ubuntu you can install all of the above with:
 
<pre>
sudo apt-get install python python-gobject python-gi python-cairo python-gi-cairo \
gir1.2-pango gir1.2-gtk xdg-utils libgtkspell3-3-0 python-gtkspell \
librsvg2-common python-dev libglib2.0-dev python-gobject-dev libgirepository1.0-dev \
libcairo2-dev python-cairo-dev intltool graphviz python-pyicu \
rcs ttf-freefont python-webkit python-pygoocanvas gir1.2-goocanvas-2.0-9 \
gtk2-engines-pixbuf
</pre>
Local installation without root privileges is possible, instructions are available on the INSTALL file.
== Build, Install and Run Gramps 4.0 to Gramps 5.x ==Note that the 'python' commands below need to be 'python3' for Gramps 4.2 and later.
python setup.py build
The way you run Gramps depends on whether you downloaded a release or downloaded from the SVN Git repository.
==== Running from a tarball release ====
See [[http://gramps.1791082.n4.nabble.com/No-joy-building-Gramps-4-0-1-from-source-tp4661381p4661443.html]]
With a tarbaltarball, gramps should be run from the build directory, or from installed version (which can be installed locally).
python setup.py build
go to where the scripts are installed:
* For python 2 look in: <code>cd build/scripts-2.7</code> * For python 3 look in: <code>cd build/scripts-3.4</code> ({{man menu|Note the number 3.4 depends on your version of python and in most cases where you see the number 2.7replace it with your version number in the example commands below}})
in build GRAMPS_RESOURCES must also be set to actually run it:
GRAMPS_RESOURCES=/home/benny/gramps/branches/maintenance/gramps40gramps{{last_branch}}/build/lib.linux-x86_64-2.7/
PYTHONPATH=$GRAMPS_RESOURCES:$PYTHONPATH ./gramps
PYTHONPATH=~/gramps/test/usr/local/lib/python2.7/dist-packages/:$PYTHONPATH ./gramps
==== Running from an SVN a Git repository ====
Gramps.py is only for those that check out the code repository. Gramps.py is a fake file to allow developers to run code from the source dir, not what the user should be doingusing.
If you now run
* <code>python Gramps.py -v</code>you should see or* <code>python3 Gramps.py -v</code> Gramps will show the version information summary and if all required packages are found, if not install the missing requirements. You can now start Gramps locally with the command
Then you can start Gramps locally with the command* <code>python Gramps.py</code>or* <code>python3 Gramps.py</code>
== Full install walkthrough Gramps 4.0 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 Equivalent steps should be done on other platforms.
sudo apt-get install subversiongit svn co <nowiki>httpsgit clone http://svngit.code.sf.net/p/gramps/code/branchessource Gramps cd Gramps git checkout -b gramps{{last_branch}} origin/maintenance/gramps40</nowiki> gramps40 cd gramps40gramps{{last_branch}}
sudo apt-get install intltool
python setup.py build
sudo apt-get install gir1.2-freedesktop gir1.2-pango
sudo apt-get install gir1.2-gtk
sudo apt-get install gir1.2-gexiv2-0.4 
If you now run
python Gramps.py -v
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
'''gexiv2'''
Minimally version 0.5 is needed, but only . Ubuntu 13.10 contains version 0.4 is available 6.1 in 13.04the gir1. So remove 2-gexiv2-0.4 if presentpackage. If you have an older version, remove it and we add 0.5 or later ourselves. install from source using the following instructions: Obtain it from [http://www.yorba.org/download/gexiv2/], I downloaded 0.6.1, and extracted it in directory ''libgexiv2-0.6.1''. To install this
cd libgexiv2-0.6.1
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 walk-through Windows ====On The native windowssupport for Gramps 4.x takes a bit more effort. You can follow the walk-through for* [[Run Gramps40 for Windows from source using Python 2.7.3]]* Run Gramps40 for Windows from source using Python 3.4 ('''Not available, but you can should be able to follow the instructions for the Python 2.7.3 version and modify accordingly''')  An alternative on windows is to install [https://www.virtualbox.org/ virtualbox] and then install K/X/Ubuntu as indicated above, which will give you linux Linux in windows. = Gramps 3.4.x === Install dependencies for Gramps 3.4.x == ==== General requirements ==== Gramps 3.x requires python 2.6 or greater, pygtk 2.16 or greater and librsvg2 ==== Linux package requirements ===={|{{Prettytable}}|-!Debian /Ubuntu !Fedora /Redhat!Comment|-|python|python |Required (needs version 2.6 or later)|-|python-gtk2|pygtk2|Required (needs 2.16 or greater)|-|[http://docs.python.org/library/bsddb.html BSDDB]|[http://docs.python.org/library/bsddb.html BSDDB]|Current backend|-|librsvg2-common|librsvg2|Required for building|-|libglib2.0-dev|glib2-devel|Required for building|-||librsvg2-devel|Required for building|-|intltool|intltool|Required for building|-||gcc make gettext|Required for building|-||-|xdg-utils|xdg-utils|Required for Gramps-3.1.x or later|-|rcs|rcs|Suggested for running|-|python-gtkspell|gnome-python2-gtkspell|Suggested for running (spell check). eg, via hunspell. Included in the python-gnome2-extras package in older Debian distributions.|-| python-webkit| WebKitgtk pywebkitgtk| Required for the HTML view|-| python-pygoocanvas| goocanvas pygoocanvas| Required for [[Addon:Graph View]]|-| graphviz| graphviz graphviz-python| Required for some reports and views|-|| Django| Required for http://gramps-connect.org [[Gramps-Connect: Introduction|Gramps-Connect]]|-| python-pyexiv2| pyexiv2| Required for the Metadata Viewer and Edit Exif Metadata gramplets|-| libosmgpsmap-dev python-osmgpsmap| osm-gps-map| Required for the Geography views|-| 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: <pre>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 ImageMagick</pre> Under Debian/Ubuntu you can install all of the above with: <pre>sudo apt-get install python python-gtk2 librsvg2-common libglib2.0-dev \ intltool xdg-utils rcs python-gtkspell \ python-webkit python-pygoocanvas graphviz python-pyexiv2 \ libosmgpsmap-dev python-osmgpsmap gtk2-engines-pixbuf</pre> == Build, Install and Run Gramps 3.4.x == Gramps provides a script that can be used to prepare the code for building. This script automatically calls the standard configure script: <code>./autogen.sh</code> # as regular user This script will report any missing dependencies. Install these (see also INSTALL file). Building from source code typically requires that the development versions of the required libraries be installed. You might consider setting a prefix path with autogen.sh, see the INSTALL file for instructions. Standard install is in /usr/local.
The native windows support for Gramps 4Once a successful run of autogen.0 is being worked on. You find sh has been completed, you can run the current walkthrough [[Run_Gramps40_for_Windows_from_source_using_Python_2typical make procedure.7.3|on the dedicated page]]
<code>
make</code> # as regular user
then  <code>make install</code> # as root Local installation without root privileges is possible, instructions are available on the INSTALL file, most importantly one needs to supply a <code>--prefix=</code> and a <code>--with-mime-dir=</code> argument to <code>autogen.sh</code>. Starting Gramps - ?? = See also ==* $GRAMPSHOME on [[Gramps 3.4 Wiki Manual Gramps_{{Version manual}}_Wiki_Manual_- Command Line_Command_Line#Environment variablesGRAMPSHOME |$GRAMPSHOME]]
* [[Translating_Gramps#.24GRAMPSI18N_.28for_your_locale.29| $GRAMPSI18N (for your locale) ]]
* [[Installation_alternatives]]
* [[Translating_Gramps#Installing_your_translation|Installing your translation (Gramps 3.x and earlier)]] or [[Translation_environment4|Gramps 4.x and later]]* [[Howto:Change_the_language_of_reports#Run_GRAMPS_in_a_different_languageRun_Gramps_in_a_different_language|Howto:Change the language of reports - Run Gramps in a different language]]* [[Fedora RPM]]
[[Category:Documentation]]
[[Category:Developers/Installation]]
[[Category:Developers/Packaging]]
1,971
edits

Navigation menu