2021-12-04 - Sorry the Gramps wiki is currently being upgraded to a newer software version. Please check back after the 2021-12-08. We apologize for the inconvenience.

Difference between revisions of "Gramps for Windows with MSYS2"

From Gramps
Jump to: navigation, search
(Created page with "==Install MSYS2== Download [http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20161025.exe MSYS2 64bit] installer ===Update MSYS2=== <pre> pacman -Syuu </pre> ===Install Gramp...")
 
(Keep your GRAMPSHOME separate)
 
(76 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
{{man warn|1=Warning|2=Do not open your existing databases with the master branch, it might destroy your data, and will make it impossible to use the data in the stable version {{stable_branch}}. To try it out, export your database to a gramps xml file, eg <code>test_master.gramps</code>, create a new family tree in the master branch, and import this xml file.<br>Alternatively you can [[Gramps_for_Windows_with_MSYS2#Keep_your_GRAMPSHOME_separate|Keep your GRAMPSHOME separate]]}}
 +
 +
How to use MSYS2 to run latest Gramps development version from source in 64bit Windows.
 +
 +
In similar way you can build the 32bit version ([https://www.msys2.org/news/#2020-05-17-32-bit-msys2-no-longer-actively-supported 2020-05-17 - 32-bit MSYS2 no longer actively supported])
 
==Install MSYS2==
 
==Install MSYS2==
Download [http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20161025.exe MSYS2 64bit] installer
+
 
 +
{{man note|Installation restrictions|MSYS2 can't be installed on [https://en.wikipedia.org/wiki/File_Allocation_Table FAT* formatted disk partitions].<br>Current MSYS2 can't be installed on Windows XP anymore.}}
 +
 
 +
From the MSYS2 home page https://www.msys2.org/ download the latest MSYS2 64bit installer( msys2-x86_64-YYYYMMDD.exe ) from [https://repo.msys2.org/distrib/x86_64/ https://repo.msys2.org/distrib/x86_64/] and run it.
 +
 
 +
Install it in short path like <code>C:\msys64</code>
 +
 
 +
At the end of install select to run mingw64 shell eg: use the '''MSYS2 MinGW 64-bit''' shortcut.
 +
 
 
===Update MSYS2===
 
===Update MSYS2===
 +
First keep running the following command(multiple times) until it has updated the list of packages and updated all core packages nothing else to do:
 +
 
<pre>
 
<pre>
 
pacman -Syuu
 
pacman -Syuu
 
</pre>
 
</pre>
 +
 +
If core packages are updated you must close the mingw64 shell (forcefully with close button, not just typing exit on it) and then restart the mingw64 shell from the shortcut.
 +
 
===Install Gramps dependencies===
 
===Install Gramps dependencies===
 +
Start mingw64 shell and use '''pacman''' package manager to download and install Gramps dependencies
 +
 
<pre>
 
<pre>
pacman -S mingw-w64-x86_64-python3-bsddb3 mingw-w64-x86_64-gexiv2 mingw-w64-x86_64-osmgpsmap-git mingw-w64-x86_64-ghostscript mingw-w64-x86_64-python3-cairo mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python3-icu mingw-w64-x86_64-iso-codes mingw-w64-x86_64-hunspell mingw-w64-x86_64-hunspell-en mingw-w64-x86_64-enchant
+
pacman -S mingw-w64-x86_64-python3-bsddb3 mingw-w64-x86_64-gexiv2 mingw-w64-x86_64-ghostscript mingw-w64-x86_64-python3-cairo mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python3-icu mingw-w64-x86_64-iso-codes mingw-w64-x86_64-hunspell mingw-w64-x86_64-hunspell-en mingw-w64-x86_64-enchant
 
</pre>
 
</pre>
 +
 +
To handle the following warning '''No intltool or version < 0.25.0, build_intl is aborting''' install:
 +
  pacman -S perl-XML-Parser
 +
  pacman -S intltool
 +
 +
You will also need the following to run the test:
 +
<pre>
 +
pacman -S mingw-w64-x86_64-python3-lxml
 +
pacman -S mingw-w64-x86_64-python3-jsonschema
 +
</pre>
 +
Some additional (optional) items needed for certain addons.
 +
<pre>
 +
pacman -S mingw-w64-x86_64-gtkspell3
 +
pacman -S mingw-w64-x86_64-geocode-glib
 +
pacman -S mingw-w64-x86_64-python3-pillow
 +
</pre>
 +
 +
The Genealogical Symbols preferences tab needs Python Fontconfig version 0.5 so we need to build it.
 +
From a suitble build directory (I use ~/build)
 +
<pre>
 +
git clone git://github.com/Vayn/python-fontconfig.git
 +
cd python-fontconfig/
 +
git checkout e1b1751f52167184e0c
 +
python3 setup.py install
 +
</pre>
 +
 +
To use the Graph reports follow the alternate instructions to install [[Gramps_for_Windows_with_MSYS2#Issue|Graphviz]] and to run the Graph View addon also install:
 +
<pre>
 +
pacman -S mingw-w64-x86_64-goocanvas
 +
</pre>
 +
 +
Install osmgpsmap for the Geography Views with the following command:
 +
<pre>
 +
pacman -S mingw-w64-x86_64-osm-gps-map
 +
</pre>
 +
 
===Install Git===
 
===Install Git===
 
<pre>
 
<pre>
 
pacman -S msys/git
 
pacman -S msys/git
 
</pre>
 
</pre>
 +
 
==Install Gramps==
 
==Install Gramps==
Create directory when to store Gramps source and go to it
+
===Prepare source===
 +
Create directory to store Gramps source in and go to it
 
<pre>
 
<pre>
 
mkdir ~/grampsdev
 
mkdir ~/grampsdev
 
cd ~/grampsdev
 
cd ~/grampsdev
 
</pre>
 
</pre>
 +
 +
===Download source===
 
Download Gramps master branch from source repository
 
Download Gramps master branch from source repository
 
<pre>
 
<pre>
Line 29: Line 89:
 
git describe
 
git describe
 
</pre>
 
</pre>
it should return something like: v5.0.0-alpha1-1024-g0919763f1
+
it should return something like:
 +
<blockquote>
 +
v5.0.0-alpha1-1024-g0919763f1
 +
</blockquote>
 +
===Setup source===
 +
Before using Gramps you must set-it up.
 +
<br>You just use '''setup build''' command not '''install''' one
 +
<pre>
 +
python3 setup.py build
 +
</pre>
 +
==Run Gramps==
 +
Start mingw64 shell and go to directory where Gramps source reside
 +
<pre>
 +
cd ~/grampsdev
 +
</pre>
 +
Use python3 to start Gramps
 +
<br>To check gramps version use "v" flag
 +
<pre>
 +
python3 Gramps.py -v
 +
</pre>
 +
It should return something like:
 +
<pre>
 +
Gramps Settings:
 +
----------------
 +
python    : 3.5.3
 +
gramps    : 5.0.0-alpha1-0919763f1
 +
gtk++    : 3.22.9
 +
pygobject : 3.22.0
 +
pango    : 1.40.3
 +
cairo    : 1.15.4
 +
pycairo  : 1.1.10
 +
osmgpsmap : 1.0
 +
GExiv2    : 0.10
 +
ICU      : 57.1
 +
PyICU    : 1.9.3
 +
o.s.      : win32
 +
 
 +
Non-python dependencies:
 +
------------------------
 +
Graphviz  : Graphviz not in system PATH
 +
Ghostscr. : 9.20
 +
</pre>
 +
Run Gramps
 +
<pre>
 +
python3 Gramps.py
 +
</pre>
 +
==Building and updating MSYS2/MinGW packages==
 +
===Install build tools===
 +
<pre>
 +
pacman -S --needed --noconfirm base-devel mingw-w64-x86_64-toolchain
 +
</pre>
 +
[https://github.com/Alexpux/MINGW-packages MINGW-packages recipes] are on GitHub so you can use git to clone it. If instead you want to access recipe one by one you can download it with Subversion so install it first
 +
<pre>
 +
pacman -S subversion
 +
</pre>
 +
We need a place to download and build from source code so we will create folder called "build" inside our home folder
 +
<pre>
 +
mkdir ~/build
 +
</pre>
 +
To prevent pacman to upgrade packages we rebuilt for our needs we can assign them to group '''gramps_fixed''' and add them to IgnoreGroup list.
 +
Open in text editor file ''etc/pacman.conf'' (C:\MSYS2\etc\pacman.conf) and add line ''IgnoreGroup = gramps_fixed'' to ''options'' section.
 +
<pre>
 +
[options]
 +
IgnoreGroup = gramps_fixed
 +
</pre>
 +
===db===
 +
GrampsAIO uses Oracle Berkeley DB version 6.0.30 but MSYS2 have it at version 6.0.19 and most probably never update it to a newer version.
 +
<br>Gramps will ask permission to downgrade database version at import of any family tree created with GrampsAIO bundle. To prevent that build right version of DB.
 +
<br>''Hard way'' (it can take some time to finish)
 +
<pre>
 +
cd ~/build
 +
svn checkout https://github.com/bpisoj/MINGW-packages/branches/gramps5/mingw-w64-db
 +
cd mingw-w64-db
 +
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
 +
pacman -U mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
 +
</pre>
 +
'''The easy way doesn't work anymore!  This is because the recent versions of Python have changed and we have to rebuild.'''
 +
<br>Start ''msys2 shell'' and type (easy way):
 +
<pre>
 +
cd ~/build
 +
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
 +
pacman -U mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
 +
</pre>
 +
 
 +
===bsddb3===
 +
As db version is changed then we have to rebuild Python bindings for Oracle Berkeley DB
 +
<br>From ''msys2 shell'' (easy way):
 +
<pre>
 +
cd ~/build
 +
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-python3-bsddb3-6.1.0-3.1-any.pkg.tar.xz
 +
pacman -U mingw-w64-x86_64-python3-bsddb3-6.1.0-3.1-any.pkg.tar.xz
 +
</pre>
 +
Or hard way:
 +
<pre>
 +
cd ~/build
 +
svn checkout https://github.com/bpisoj/MINGW-packages/branches/gramps5/mingw-w64-python-bsddb3
 +
cd mingw-w64-python-bsddb3
 +
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
 +
pacman -U mingw-w64-x86_64-python3-bsddb3-6.1.0-3.1-any.pkg.tar.xz
 +
</pre>
 +
 
 +
===gtk3===
 +
[https://www.gtk.org/ GTK+] since version 3.20 drag-and-drop code has been rearchitected to move the drag cancel animation and most input handling into GDK, thereby dropping most of the platform-dependent code out of GTK (MSYS2 version of GTK is currently 3.22.10). This change is not yet present in Windows port of code so we have to use older GTK version 3.18 where it still works.
 +
<br>Latest in gtk-3.18 branch is gtk-3.18.9 (previous versions of this branch have working dnd but have other bugs) so we build that.
 +
* Easy way:
 +
<pre>
 +
cd ~/build
 +
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-gtk3-3.18.9-1-any.pkg.tar.xz
 +
pacman -U mingw-w64-x86_64-gtk3-3.18.9-1-any.pkg.tar.xz
 +
</pre>
 +
* Hard Way:
 +
<pre>
 +
cd ~/build
 +
svn checkout https://github.com/bpisoj/MINGW-packages/branches/gramps5/mingw-w64-gtk3
 +
cd mingw-w64-gtk3
 +
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
 +
pacman -U mingw-w64-x86_64-gtk3-3.18.9-1-any.pkg.tar.xz
 +
</pre>
 +
 
 +
===graphviz===
 +
 
 +
As of 2019.09.17 package mingw-w64-osm-gps-map is available so all you have to do is:
 +
 
 +
<pre>
 +
pacman -S mingw-w64-x86_64-graphviz
 +
</pre>
 +
 
 +
Previously Graphviz was in MSYS2 MINGW-packages git repository but was not build-able at that time (2017-03-26) so it is not available via pacman.
 +
We build latest version from Graphviz git repository by manually patching code in process so we can't yet provide PKGBUILD
 +
* Easy way
 +
As we use simple archive not real packages we need to make care that dependencies are satisfied
 +
<pre>
 +
pacman -S --needed mingw-w64-x86_64-cairo mingw-w64-x86_64-devil mingw-w64-x86_64-expat mingw-w64-x86_64-freetype mingw-w64-x86_64-glib2 mingw-w64-x86_64-gtk2 mingw-w64-x86_64-gtkglext mingw-w64-x86_64-fontconfig mingw-w64-x86_64-freeglut mingw-w64-x86_64-libglade mingw-w64-x86_64-libgd mingw-w64-x86_64-libpng mingw-w64-x86_64-libsystre mingw-w64-x86_64-pango mingw-w64-x86_64-poppler mingw-w64-x86_64-zlib mingw-w64-x86_64-libtool
 +
</pre>
 +
Next we download prebuilt archive and extract it
 +
<pre>
 +
cd ~/build
 +
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/win64_graphviz_20170323.1842.tar.xz
 +
tar xfv win64_graphviz_20170323.1842.tar.xz -C /
 +
</pre>
 +
After successful install we first need to configure it (from mingw64 shell)
 +
<pre>
 +
dot -c
 +
</pre>
 +
If no error is displayed everything is working fine and Graphviz registered their plugins.
 +
We can check version with
 +
<pre>
 +
dot -V
 +
 
 +
dot - graphviz version 2.41.20170323.1842 (20170323.1842)
 +
</pre>
 +
<pre>
 +
winpty dot -v
 +
 
 +
dot - graphviz version 2.41.20170323.1842 (20170323.1842)
 +
libdir = "C:\MSYS2\mingw64\bin"
 +
Activated plugin library: libgvplugin_dot_layout-6.dll
 +
Using layout: dot:dot_layout
 +
Activated plugin library: libgvplugin_core-6.dll
 +
Using render: dot:core
 +
Using device: dot:dot:core
 +
The plugin configuration file: C:\MSYS2\mingw64\bin\config6
 +
was successfully loaded.
 +
    render      :  cairo dot fig gd map pic pov ps svg tk vml vrml xdot
 +
    layout      :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
 +
    textlayout  :  textlayout
 +
    device      :  bmp canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv ico imap
 +
                  imap_np ismap jpe jpeg jpg pdf pic plain plain-ext png pov ps ps2
 +
                  svg svgz tga tif tiff tk vml vmlz vrml wbmp xdot xdot1.2 xdot1.4
 +
    loadimage  :  (lib) bmp eps gd gd2 gif ico jpe jpeg jpg pdf png ps svg xbm
 +
</pre>
 +
* Hard way (TODO)
 +
====pygraphviz====
 +
Needed for NetworkChart report (3rd party plugin)
 +
* Easy way:
 +
<pre>
 +
cd ~/build
 +
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-python3-pygraphviz-1.4rc1-1-any.pkg.tar.xz
 +
pacman -U mingw-w64-x86_64-python3-pygraphviz-1.4rc1-1-any.pkg.tar.xz
 +
</pre>
 +
* Hard way
 +
download https://gramps-project.org/wiki/images/2/2b/Pygraphviz-1.4rc1.zip  [[:File:Pygraphviz-1.4rc1.zip|(source here)]]
 +
 
 +
Unzip it into <code>~/build/pygraphviz-1.4rc1/</code>
 +
<pre>
 +
cd ~/build/pygraphviz-1.4rc1
 +
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
 +
pacman -U mingw-w64-x86_64-python3-pygraphviz-1.4rc1-0.0-any.pkg.tar.xz
 +
</pre>
 +
For NetworkChart report to work install also networkx package
 +
<pre>
 +
pacman -S mingw-w64-x86_64-python3-networkx
 +
</pre>
 +
For NetworkChart report to work install also pydotplus
 +
<pre>
 +
pip3 install pydotplus
 +
</pre>
 +
 
 +
===osmgpsmap===
 +
As of 2019.02.08 package mingw-w64-osm-gps-map is available so all you have to do is
 +
<pre>
 +
pacman -S mingw-w64-x86_64-osm-gps-map
 +
</pre>
 +
<br>Start '''msys2 shell''' (always build package recipes from msys2 shell)
 +
Hard way:
 +
<pre>
 +
cd ~/build
 +
svn checkout https://github.com/Alexpux/MINGW-packages/trunk/mingw-w64-osm-gps-map
 +
cd mingw-w64-osm-gps-map
 +
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
 +
pacman -U mingw-w64-x86_64-osm-gps-map-1.1.0-2-any.pkg.tar.xz
 +
</pre>
 +
 
 +
==Issue==
 +
===Graphviz===
 +
* No Graphviz see: [https://github.com/Alexpux/MINGW-packages/issues/737 MSYS2:Package request: graphviz]
 +
** Marked as WIP see: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-graphviz
 +
 
 +
====Alternate method using Windows version of Graphviz====
 +
Tested alternate method to use Windows version of Graphviz[http://felsin9.de/nnis/ghc-vis/installing-windows/]
 +
{{man warn|Warning it is not advised for users to mix various libraries like the following it is a direct way to dll hell.|This way Gramps will use graphviz libs instead of MSYS2 ones and they are older and in much way incompatible with rest of Gramps dependencies.<br> until Graphviz becomes available from MSYS2 directly this is an alternate method.}}
 +
 
 +
<i>Download the current GraphViz ZIP archive from https://www.graphviz.org/download/ and extract it to C:\graphviz, so that it directly contains the directories bin, lib, share and so on.</i>
 +
 
 +
From the msys2 prompt type:
 +
<pre>
 +
echo 'export PATH=/c/graphviz/bin:$PATH' >> ~/.bashrc
 +
source ~/.bashrc
 +
</pre>
 +
Then type:
 +
 
 +
python3 Gramps.py -v
 +
 
 +
and Graphviz will be listed.
 +
 
 +
<pre>Non-python dependencies:
 +
------------------------
 +
Graphviz  : 2.38
 +
</pre>
 +
 
 +
==Install Python pip==
 +
To install a working version of pip use the following steps:
 +
 
 +
<pre>
 +
mkdir ~/scripts
 +
cd ~/scripts
 +
curl -O 'https://bootstrap.pypa.io/get-pip.py'
 +
./get-pip.py
 +
</pre>
 +
 
 +
Test that it works:
 +
 
 +
  pip3 --version
 +
 
 +
If that succeeds you can now remove the installation script if wanted:
 +
 +
  rm get-pip.py
 +
 
 +
==Keep your [[Gramps_{{man version}}_Wiki_Manual_-_Command_Line#GRAMPSHOME|GRAMPSHOME]] separate==
 +
To keep your test family trees separate from your personal family trees you may want to use your MSYS2 home directory which you can set from mingw64 shell either:
 +
 
 +
On each run like:
 +
 
 +
  GRAMPSHOME=~ python3 Gramps.py
 +
 
 +
If you want it persistent:
 +
 
 +
  echo 'export GRAMPSHOME=~' >> ~/.profile
 +
  source ~/.profile
 +
 
 +
==See also==
 +
* [[Running a development version of Gramps]]
 +
* [https://sourceforge.net/p/gramps/mailman/message/35346200/ Gramps on WSL (Win10/Ubuntu 14.04/VcXsvr)]
 +
 
 +
[[Category:GEPS|M]]
 +
[[Category:Developers/General]]

Latest revision as of 02:01, 3 November 2020

Error creating thumbnail: Unable to save thumbnail to destination
Warning

Do not open your existing databases with the master branch, it might destroy your data, and will make it impossible to use the data in the stable version 51. To try it out, export your database to a gramps xml file, eg test_master.gramps, create a new family tree in the master branch, and import this xml file.
Alternatively you can Keep your GRAMPSHOME separate

How to use MSYS2 to run latest Gramps development version from source in 64bit Windows.

In similar way you can build the 32bit version (2020-05-17 - 32-bit MSYS2 no longer actively supported)

Install MSYS2

Error creating thumbnail: Unable to save thumbnail to destination
Installation restrictions

MSYS2 can't be installed on FAT* formatted disk partitions.
Current MSYS2 can't be installed on Windows XP anymore.

From the MSYS2 home page https://www.msys2.org/ download the latest MSYS2 64bit installer( msys2-x86_64-YYYYMMDD.exe ) from https://repo.msys2.org/distrib/x86_64/ and run it.

Install it in short path like C:\msys64

At the end of install select to run mingw64 shell eg: use the MSYS2 MinGW 64-bit shortcut.

Update MSYS2

First keep running the following command(multiple times) until it has updated the list of packages and updated all core packages nothing else to do:

pacman -Syuu

If core packages are updated you must close the mingw64 shell (forcefully with close button, not just typing exit on it) and then restart the mingw64 shell from the shortcut.

Install Gramps dependencies

Start mingw64 shell and use pacman package manager to download and install Gramps dependencies

pacman -S mingw-w64-x86_64-python3-bsddb3 mingw-w64-x86_64-gexiv2 mingw-w64-x86_64-ghostscript mingw-w64-x86_64-python3-cairo mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python3-icu mingw-w64-x86_64-iso-codes mingw-w64-x86_64-hunspell mingw-w64-x86_64-hunspell-en mingw-w64-x86_64-enchant

To handle the following warning No intltool or version < 0.25.0, build_intl is aborting install:

 pacman -S perl-XML-Parser
 pacman -S intltool

You will also need the following to run the test:

pacman -S mingw-w64-x86_64-python3-lxml
pacman -S mingw-w64-x86_64-python3-jsonschema

Some additional (optional) items needed for certain addons.

pacman -S mingw-w64-x86_64-gtkspell3
pacman -S mingw-w64-x86_64-geocode-glib
pacman -S mingw-w64-x86_64-python3-pillow

The Genealogical Symbols preferences tab needs Python Fontconfig version 0.5 so we need to build it. From a suitble build directory (I use ~/build)

git clone git://github.com/Vayn/python-fontconfig.git
cd python-fontconfig/
git checkout e1b1751f52167184e0c
python3 setup.py install

To use the Graph reports follow the alternate instructions to install Graphviz and to run the Graph View addon also install:

pacman -S mingw-w64-x86_64-goocanvas

Install osmgpsmap for the Geography Views with the following command:

pacman -S mingw-w64-x86_64-osm-gps-map

Install Git

pacman -S msys/git

Install Gramps

Prepare source

Create directory to store Gramps source in and go to it

mkdir ~/grampsdev
cd ~/grampsdev

Download source

Download Gramps master branch from source repository

git init
git remote add -t master -f origin https://github.com/gramps-project/gramps.git
git checkout master

Check which Gramps version is used

git describe

it should return something like:

v5.0.0-alpha1-1024-g0919763f1

Setup source

Before using Gramps you must set-it up.
You just use setup build command not install one

python3 setup.py build

Run Gramps

Start mingw64 shell and go to directory where Gramps source reside

cd ~/grampsdev

Use python3 to start Gramps
To check gramps version use "v" flag

python3 Gramps.py -v

It should return something like:

Gramps Settings:
----------------
 python    : 3.5.3
 gramps    : 5.0.0-alpha1-0919763f1
 gtk++     : 3.22.9
 pygobject : 3.22.0
 pango     : 1.40.3
 cairo     : 1.15.4
 pycairo   : 1.1.10
 osmgpsmap : 1.0
 GExiv2    : 0.10
 ICU       : 57.1
 PyICU     : 1.9.3
 o.s.      : win32

Non-python dependencies:
------------------------
 Graphviz  : Graphviz not in system PATH
 Ghostscr. : 9.20

Run Gramps

python3 Gramps.py

Building and updating MSYS2/MinGW packages

Install build tools

pacman -S --needed --noconfirm base-devel mingw-w64-x86_64-toolchain

MINGW-packages recipes are on GitHub so you can use git to clone it. If instead you want to access recipe one by one you can download it with Subversion so install it first

pacman -S subversion

We need a place to download and build from source code so we will create folder called "build" inside our home folder

mkdir ~/build

To prevent pacman to upgrade packages we rebuilt for our needs we can assign them to group gramps_fixed and add them to IgnoreGroup list. Open in text editor file etc/pacman.conf (C:\MSYS2\etc\pacman.conf) and add line IgnoreGroup = gramps_fixed to options section.

[options]
IgnoreGroup = gramps_fixed

db

GrampsAIO uses Oracle Berkeley DB version 6.0.30 but MSYS2 have it at version 6.0.19 and most probably never update it to a newer version.
Gramps will ask permission to downgrade database version at import of any family tree created with GrampsAIO bundle. To prevent that build right version of DB.
Hard way (it can take some time to finish)

cd ~/build
svn checkout https://github.com/bpisoj/MINGW-packages/branches/gramps5/mingw-w64-db
cd mingw-w64-db
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
pacman -U mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz

The easy way doesn't work anymore! This is because the recent versions of Python have changed and we have to rebuild.
Start msys2 shell and type (easy way):

cd ~/build
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
pacman -U mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz

bsddb3

As db version is changed then we have to rebuild Python bindings for Oracle Berkeley DB
From msys2 shell (easy way):

cd ~/build
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-python3-bsddb3-6.1.0-3.1-any.pkg.tar.xz
pacman -U mingw-w64-x86_64-python3-bsddb3-6.1.0-3.1-any.pkg.tar.xz

Or hard way:

cd ~/build
svn checkout https://github.com/bpisoj/MINGW-packages/branches/gramps5/mingw-w64-python-bsddb3
cd mingw-w64-python-bsddb3
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
pacman -U mingw-w64-x86_64-python3-bsddb3-6.1.0-3.1-any.pkg.tar.xz

gtk3

GTK+ since version 3.20 drag-and-drop code has been rearchitected to move the drag cancel animation and most input handling into GDK, thereby dropping most of the platform-dependent code out of GTK (MSYS2 version of GTK is currently 3.22.10). This change is not yet present in Windows port of code so we have to use older GTK version 3.18 where it still works.
Latest in gtk-3.18 branch is gtk-3.18.9 (previous versions of this branch have working dnd but have other bugs) so we build that.

  • Easy way:
cd ~/build
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-gtk3-3.18.9-1-any.pkg.tar.xz
pacman -U mingw-w64-x86_64-gtk3-3.18.9-1-any.pkg.tar.xz
  • Hard Way:
cd ~/build
svn checkout https://github.com/bpisoj/MINGW-packages/branches/gramps5/mingw-w64-gtk3
cd mingw-w64-gtk3
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
pacman -U mingw-w64-x86_64-gtk3-3.18.9-1-any.pkg.tar.xz

graphviz

As of 2019.09.17 package mingw-w64-osm-gps-map is available so all you have to do is:

pacman -S mingw-w64-x86_64-graphviz

Previously Graphviz was in MSYS2 MINGW-packages git repository but was not build-able at that time (2017-03-26) so it is not available via pacman. We build latest version from Graphviz git repository by manually patching code in process so we can't yet provide PKGBUILD

  • Easy way

As we use simple archive not real packages we need to make care that dependencies are satisfied

pacman -S --needed mingw-w64-x86_64-cairo mingw-w64-x86_64-devil mingw-w64-x86_64-expat mingw-w64-x86_64-freetype mingw-w64-x86_64-glib2 mingw-w64-x86_64-gtk2 mingw-w64-x86_64-gtkglext mingw-w64-x86_64-fontconfig mingw-w64-x86_64-freeglut mingw-w64-x86_64-libglade mingw-w64-x86_64-libgd mingw-w64-x86_64-libpng mingw-w64-x86_64-libsystre mingw-w64-x86_64-pango mingw-w64-x86_64-poppler mingw-w64-x86_64-zlib mingw-w64-x86_64-libtool

Next we download prebuilt archive and extract it

cd ~/build
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/win64_graphviz_20170323.1842.tar.xz
tar xfv win64_graphviz_20170323.1842.tar.xz -C /

After successful install we first need to configure it (from mingw64 shell)

dot -c

If no error is displayed everything is working fine and Graphviz registered their plugins. We can check version with

dot -V

dot - graphviz version 2.41.20170323.1842 (20170323.1842)
winpty dot -v

dot - graphviz version 2.41.20170323.1842 (20170323.1842)
libdir = "C:\MSYS2\mingw64\bin"
Activated plugin library: libgvplugin_dot_layout-6.dll
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core-6.dll
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file: C:\MSYS2\mingw64\bin\config6
was successfully loaded.
    render      :  cairo dot fig gd map pic pov ps svg tk vml vrml xdot
    layout      :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device      :  bmp canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv ico imap 
                   imap_np ismap jpe jpeg jpg pdf pic plain plain-ext png pov ps ps2
                   svg svgz tga tif tiff tk vml vmlz vrml wbmp xdot xdot1.2 xdot1.4
    loadimage   :  (lib) bmp eps gd gd2 gif ico jpe jpeg jpg pdf png ps svg xbm
  • Hard way (TODO)

pygraphviz

Needed for NetworkChart report (3rd party plugin)

  • Easy way:
cd ~/build
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-python3-pygraphviz-1.4rc1-1-any.pkg.tar.xz
pacman -U mingw-w64-x86_64-python3-pygraphviz-1.4rc1-1-any.pkg.tar.xz
  • Hard way

download https://gramps-project.org/wiki/images/2/2b/Pygraphviz-1.4rc1.zip (source here)

Unzip it into ~/build/pygraphviz-1.4rc1/

cd ~/build/pygraphviz-1.4rc1
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
pacman -U mingw-w64-x86_64-python3-pygraphviz-1.4rc1-0.0-any.pkg.tar.xz

For NetworkChart report to work install also networkx package

pacman -S mingw-w64-x86_64-python3-networkx

For NetworkChart report to work install also pydotplus

pip3 install pydotplus

osmgpsmap

As of 2019.02.08 package mingw-w64-osm-gps-map is available so all you have to do is

pacman -S mingw-w64-x86_64-osm-gps-map


Start msys2 shell (always build package recipes from msys2 shell) Hard way:

cd ~/build
svn checkout https://github.com/Alexpux/MINGW-packages/trunk/mingw-w64-osm-gps-map
cd mingw-w64-osm-gps-map
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
pacman -U mingw-w64-x86_64-osm-gps-map-1.1.0-2-any.pkg.tar.xz

Issue

Graphviz

Alternate method using Windows version of Graphviz

Tested alternate method to use Windows version of Graphviz[1]

Error creating thumbnail: Unable to save thumbnail to destination
Warning it is not advised for users to mix various libraries like the following it is a direct way to dll hell.

This way Gramps will use graphviz libs instead of MSYS2 ones and they are older and in much way incompatible with rest of Gramps dependencies.
until Graphviz becomes available from MSYS2 directly this is an alternate method.

Download the current GraphViz ZIP archive from https://www.graphviz.org/download/ and extract it to C:\graphviz, so that it directly contains the directories bin, lib, share and so on.

From the msys2 prompt type:

echo 'export PATH=/c/graphviz/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Then type:

python3 Gramps.py -v

and Graphviz will be listed.

Non-python dependencies:
------------------------
 Graphviz  : 2.38

Install Python pip

To install a working version of pip use the following steps:

 
mkdir ~/scripts
cd ~/scripts
curl -O 'https://bootstrap.pypa.io/get-pip.py'
./get-pip.py

Test that it works:

 pip3 --version

If that succeeds you can now remove the installation script if wanted:

 rm get-pip.py

Keep your GRAMPSHOME separate

To keep your test family trees separate from your personal family trees you may want to use your MSYS2 home directory which you can set from mingw64 shell either:

On each run like:

  GRAMPSHOME=~ python3 Gramps.py

If you want it persistent:

  echo 'export GRAMPSHOME=~' >> ~/.profile
  source ~/.profile

See also