Changes

Jump to: navigation, search

Linux:Build from source

2,536 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 clone the source from Git. Please, now is the time to read the [{{Code Base}}INSTALL INSTALL] and [{{Code Base}}README 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 the source from Git === * 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 - especially 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. Please use with extreme caution - and only ever on a copy of your data! You can get the Gramps repository through Git. First, you need Git installed, eg on Debian based linux: sudo apt-get install git
ThenShould you just want to do a straightforward replacement instead, clone make sure that you remove the repository: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.
git clone https://githubIf you installed from source, the best way of removing the old Gramps 3.comx or earlier version is to run <code>make uninstall</gramps-project/grampscode> as root '''from where you installed the old version'''.git Gramps
A branch called Or use your distribution''master'' containing the latest development code will be created for yous package manager to uninstall if your old Gramps version was installed as a package.
To checkout a maintenance branch use:= Gramps 4.2 and up=
git checkout -b gramps{{last_branch}} origin/maintenance/gramps{{last_branchman 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.
== Install dependencies If installing using a tar or git source, you need to replace 'python' with 'python3' for Gramps 3the various setup and run commands below.4.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). eg, via hunspell. Included in the python-gnome2-extras package in older Debian distributions.
|-
| pythonpython3-webkitgi-cairo| 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 can install all of = Gramps 4.0 to 4.1 = == Obtain the above withsource ==There are two ways to get the source code:download a released version source, or clone the source from Git.
<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>{{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.}}
Under Debian/Ubuntu you can install all of the above withDetails on each download method:
<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>=== Download a release ===
== Build, Install and Run * The latest stable version of Gramps 3can be downloaded from the [https://github.4com/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.x ==gz
Gramps provides a script that can be used to prepare the </code for building. This script automatically calls the standard configure script> and then go into this directory:
<code>
./autogen.shcd gramps-zzz</code>  === Download the source from Git === * 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 regular userthey have not been extensively tested - especially 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. Please use with extreme caution - and only ever on a copy of your data!
This script will report any missing dependenciesYou can get the Gramps repository through Git. Install these (see also INSTALL file). Building from source code typically requires that the development versions of the required libraries be First, you need Git installed. You might consider setting a prefix path with autogen.sh, see the INSTALL file for instructions. Standard eg on Debian based linux: sudo apt-get install is in /usr/local.git
Once a successful run of autogen.sh has been completedThen, you can run clone the typical make procedure.repository:
<code>make< git clone https:/code> # as regular user/github.com/gramps-project/gramps.git Gramps
then A branch called ''master'' containing the latest development code will be created for you.
<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 [https://github.com/gramps-project/gramps/blob/master/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
| 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]]
<pre>
sudo apt-get install python python-gobject python-gi python-cairo python-gi-cairo \
gir1.2-pango gir1.2-gtk xdg-utils libgtkspelllibgtkspell3-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-treefont 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 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:
==== Running from 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 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 git
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. Once a successful run of autogen.sh has been completed, you can run the typical make procedure. <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>.
The native windows support for Starting 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]]- ??
== See also ==* [[Gramps_4.1_Wiki_Manual_Gramps_{{Version manual}}_Wiki_Manual_-_Command_Line#GRAMPSHOME |$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_language|Howto:Change the language of reports - Run Gramps in a different language]]
* [[Fedora rpmRPM]]
[[Category:Documentation]]
[[Category:Developers/Installation]]
[[Category:Developers/Packaging]]
1,971
edits

Navigation menu