Difference between revisions of "Gramps for Windows with MSYS2"

From Gramps
Jump to: navigation, search
(Building and updating MSYS2/MinGW packages)
Line 130: Line 130:
 
mkdir ~/build
 
mkdir ~/build
 
</pre>
 
</pre>
===OsmGpsMap===
+
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>Start ''msys2 shell'' and type:
 +
<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>
 +
===bsddb3===
 +
As db version is changed then we have to rebuild Python bindings for Oracle Berkeley DB
 +
<br>From ''msys2 shell'':
 +
<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===
 +
* TODO
 +
===graphviz===
 +
* TODO
 +
===osmgpsmap===
 
As of 2017.03.21 package mingw-w64-osmgpsmap-git (r443.c24d08d-1) is outdated due to changes in MINGW-packages repository so Gramps GeoView will fail to work.
 
As of 2017.03.21 package mingw-w64-osmgpsmap-git (r443.c24d08d-1) is outdated due to changes in MINGW-packages repository so Gramps GeoView will fail to work.
 
<br>We will rebuild him!
 
<br>We will rebuild him!

Revision as of 13:31, 25 March 2017

Gnome-important.png
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 52. 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

Install MSYS2

Gramps-notes.png
Installation restrictions

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

From the MSYS2 home page http://www.msys2.org download MSYS2 64bit installer 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 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

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
Gnome-important.png
osmgpsmap not working

When fixed you will be able to install osmgpsmap for the Geography Views with the following command:
pacman -S mingw-w64-x86_64-osmgpsmap-git

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.
Start msys2 shell and type:

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

bsddb3

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

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

  • TODO

graphviz

  • TODO

osmgpsmap

As of 2017.03.21 package mingw-w64-osmgpsmap-git (r443.c24d08d-1) is outdated due to changes in MINGW-packages repository so Gramps GeoView will fail to work.
We will rebuild him!
Start msys2 shell (always build package recipes from msys2 shell)

cd ~/build
svn checkout https://github.com/Alexpux/MINGW-packages/trunk/mingw-w64-osmgpsmap-git
cd mingw-w64-osmgpsmap-git
sed -i 's/patch -p1 -i/#patch -p1 -i/' PKGBUILD
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf

When (If) package is successfully built install it with

pacman -U mingw-w64-x86_64-osmgpsmap-git-r483.d275a5d-1-any.pkg.tar.xz

Issue

Graphviz

Alternate method using Windows version of Graphviz

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

Gnome-important.png
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 http://www.graphviz.org/Download_windows.php 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

osmgpsmap

The MSYS2 version of osmgpsmap has issues eg:

  (python3.exe:348): WARNING **: Failed to load shared library 'libosmgpsmap-1.0-0.dll' referenced by the typelib: 'libosmgpsmap-1.0-0.dll': The specified procedure could not be found.

You can uninstall osmgpsmap package with:

 pacman -R mingw-w64-x86_64-osmgpsmap-git

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