Building Hamster Applet 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.
pete\'s email address

Required tools to build hamster applet:
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 if you have success with this process and especially if you have improvements of your own to add to it!
pete\'s email address

4 thoughts on “Building Hamster Applet on Windows

  1. Pingback: Project Hamster for Windows | GeekPete

  2. 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???

    Reply
    1. Arthur

      Hi Ryoko,

      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!

      Reply
  3. Jamar Shybut

    The first thing you need to do before anything else is to get yourself a domain name. A domain name is the name you want to give to your website. For example, the domain name of the website you’re reading is “thesitewizard.com”. To get a domain name, you have to pay an annual fee to a registrar for the right to use that name. Getting a name does not get you a website or anything like that. It’s just a name. It’s sort of like registering a business name in the brick-and-mortar world; having that business name does not mean that you also have the shop premises to go with the name.;

    My own webpage
    <"'http://www.caramoan.co/caramoan-tour/

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>