projecthamster

Building Project Hamster on Windows

This is a windows build guide for the Project Hamster time tracking tool. I hope it’s helpful to people out there who want to build this app on windows. Many thanks to Martins Polakovs who shared his hard work on these build steps with me. If you have any tweaks or improvements on this guide, drop me an email and I’ll roll your improvements into this guide.

NOTE: I’ve re-posted this HOWTO guide but it’s fairly old and I’m not entirely sure it all still works as described. Hopefully a native windows port of Project Hamster is developed soon, see this github ticket.

Required tools to build Project Hamster

Git client:
http://code.google.com/p/msysgit/downloads/list?q=label:Featured
(I used Full installer for official Git for Windows)

Python:
http://python.org/ftp/python/2.7.2/python-2.7.2.msi

PyGTK for windows:
http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-all-in-one-2.24.2.win32-py2.7.msi

Inno Setup:
http://www.jrsoftware.org/download.php/is-unicode.exe

Py2exe:
http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download

To run hamster applet, gtk runtime is required.
GTK for Windows:
http://sourceforge.net/projects/gtk-win/files/latest/download

Steps To build

Create a directory c:\hamster-src
From ‘Git Bash’ (Start / Git Bash) run the following commands…

Check out hamster source code:

 $ cd c:\hamster-src
 $ git clone git://git.gnome.org/hamster-applet
 $ cd hamster-applet
 Create branch ‘win-port’ with specified revision 44218bac2a976057ccf0cb1d490ad408cc8e4b1c
 $ git checkout -b win-port
 44218bac2a976057ccf0cb1d490ad408cc8e4b1c

Save patch from http://bugzilla-attachments.gnome.org/attachment.cgi?id=145966 to c:\hamster-src\patch-1.patch

Apply patch to the code:

$ git apply ../patch-1.patch

Create file c:\hamster-src\hamster-applet\defs.py with following content:

DATA_DIR = "C:\\hamster-src\\hamster-applet\\data"
 LIB_DIR = "@LIBDIR@"
 VERSION = "@VERSION@"
 PACKAGE = "@PACKAGE@"
 PYTHONDIR = "C:\\Python27"
 IS_WINDOWS = True

To run hamster from source, do:

 $ cd c:\hamster-src\hamster-applet\win
 $ c:\python27\python.exe hamster-win.py

Go to win directory

 $ cd c:\hamster-src\hamster-applet\win

Edit build.bat change line:

 PATH=%PATH%;c:\gtk+\bin

to line:

PATH=%PATH%;C:\Python27\Lib\site-packages\gtk-2.0\runtime\bin

Adjust python for your version. For python 2.7 change line:

c:\python25\python.exe setup_win32.py py2exe

to line:

c:\python27\python.exe setup_win32.py py2exe

If you are on a 64bit windows, change line:

"c:\Program Files\Inno Setup 5\iscc" /F"hamster-setup" hamster.iss

to line:

"C:\Program Files (x86)\Inno Setup 5\iscc" /F"hamster-setup" hamster.iss

Edit setup_win32.py and add gio to the “includes:” line…

 opts = {
 'py2exe': {
 'packages': ['hamster'],
 'includes': 'pango,atk,gobject,cairo,pangocairo,gio',
 'dll_excludes': [
 'iconv.dll','intl.dll','libatk-1.0-0.dll',
 'libgdk_pixbuf-2.0-0.dll','libgdk-win32-2.0-0.dll',
 'libglib-2.0-0.dll','libgmodule-2.0-0.dll',
 'libgobject-2.0-0.dll','libgthread-2.0-0.dll',
 'libgtk-win32-2.0-0.dll','libpango-1.0-0.dll',
 'libpangowin32-1.0-0.dll','libcairo-2.dll',
 'libpangocairo-1.0-0.dll','libpangoft2-1.0-0.dll',
 ]

From windows cmd prompt (Start / cmd.exe) run the following command to build hamster package:

 $ build.bat

Done!

hamster-setup.exe should be in the c:\hamster-src\hamster-applet\win\Output directory
Fling me an email or a comment if you have success with this process and especially if you have improvements of your own to add to it!

Previous comments:

December 6, 2012 at 2:29 am
Ryoko
Hi everybody,
running the scripts to build from source I was stuck while applying the patch
The error is
fatal: git apply: bad git-diff – expected /dev/null on line 191
Any idea???

December 27, 2012 at 6:06 am
Hi Ryoko,
Arthur
After creating the patch file run dos2unix on it to change all the CR LF signs in it to
LF. I had your exact error and it solved it.
Good luck!

Write a Comment

Comment

  1. Hi Guys !

    I have this error

    C:\hamster-src\hamster-applet> cd c:\hamster-src\hamster-applet\win
    The system cannot find the path specified.

    thanks for your time !

    • Hi Stefan,

      According to the repo owner, my instructions will only work with gtk2 which is currently unmaintained. gtk3 will definitely break with my instructions.

      I’d love to get these instructions updated sometime to work against the current master branch and hopefully with some automatic build system that just produces the binary and posts it somewhere at the end of the process.

      See:
      https://github.com/projecthamster/hamster/issues/89

        • Hi Stefan,

          It’s been years since I tried to compile this on windows.

          Not sure what the state of it is currently.

          Have you tried to get it working again recently?

  2. Hi Pete,
    I’m currently trying to produce a working version on Windows.
    To make it working I’ve made some code changes of course, many things are different between Linux and Windows.
    Latest version runs but it’s not yet super stable.
    Still interested in this topic?

    • Hi Neobepmat,

      Thanks for your hard work on this.
      I don’t have all that much time to spend on Project Hamster these days but I see many people still like it.

      I’d love to see any working instructions you have for it on Windows with recent versions. If you want you can post them as a comment or email them to me and I’ll edit this page with an update.

      Thanks!

      -Pete

Webmentions

  • Tools for those working in TI | Rafael's Blog June 29, 2016

    […] To manage Tasks http://projecthamster.wordpress.com/building-and-running/ (to install on Windows https://geekpete.com/blog/building-project-hamster-on-windows/) […]