Jose's Blog

04.01.2021

xournal for win32

Filed under: Uncategorized — admin @ 09:38

Since the COVID pandemic I started to get more interested in Xournal. In fact, I was already interested in these kind of softwares but never really had the time to take them seriously. Now I actually need it for work. Most of my work are done via Zoom calls and Xournal doodles via screen sharing. There are many things to be wished in the xournal software and this is delivered in the all new Xournal++ software (for instance LaTeX annotation, drawing circles , splines and arrows turned out to be extremely useful esp. when annotating pdf of students). I looked a bit at the code of Xournal++ and I felt it would be a huge task if I want to try to understand it. It felt also more unstable than the original xournal (which is written in C rather than C++). So I thought I looked at the xournal code and just add the little things I am interested inĀ  and maybe fix some bugs (I still use xournalpp for many things!). It will also help me improve my ability to port some originally developed Linux software into Windows.

My experience lies mostly in win32 development and so it was natural for me to look at xournal from this angle. xournal depends on libpoppler and libpoppler-glib. Both are notorious to be difficult to compile in windows. There is this MSys2 distribution that provided precompiled versions of libpoppler and libpoppler-glib, but I soon found out that the dependencies were quite heavy and I didn’t really needed the very latest version of libpoppler. I could have gotten away by finding another source of precompiled libpoppler library for windows (sourceforge has several of these) but all of them do not have libpoppler with glib wrapper and so I finally decided to do the dirty work myself and compile them myself. This is one of the hardest thing for me to compile that was originally developed in linux (I would put libflint as the hardest one!). libpoppler comes with cmake scripts, but they were so difficult to understand and the resulting makefile were also difficult to read. I also really wanted to compile this library in the most optimized way in windows (i.e. tweak the makefiles when possible). So I ended up doing the following:

  • Install GTK bundle for win32 (I got gtk+2.24.10)
  • Download libpoppler source (for me version 0.12.4 worked)
  • Write my own makefile for libpoppler-glib (I would not need libpoppler.dll in the end)
  • Download the dependencies: libgnomecanvas (I got the dev and bin for version 2.13), libart
  • Download precompiled libcairo for win32 (I go the src and bin of version 1.17.2)
  • Write my own makefile for xournal and finally built the whole thing with gcc and codeblocks.

You may need to edit directories in the makefiles and the package-config .pc files. My makefiles are usually located in a cbp directory created in the root directory of the source. My experience tells me: building a gtk project in windows is a nightmare if it is your first time (esp. if it is libpoppler-glib dependent).

Here is the xournal binary that I built that should be a little faster than the original distribution and has a little less dependencies.

I also make available libpoppler-glib (built together with libpoppler) precompiled win32 build.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress