pan-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-devel] Re: Building PAN on Windows - Success


From: DPA
Subject: Re: [Pan-devel] Re: Building PAN on Windows - Success
Date: Tue, 28 Feb 2006 10:34:42 -0500
User-agent: Thunderbird 1.5 (Windows/20051201)

I sent this on Monday but it did not seem to show up on the list so here we go again:

Sorry for the long delay in doing this, I went back and downloaded a fresh copy from CVS and applied all the patches I had. After eliminating all the misc changes I made (It had gotten pretty dirty!) it seems that the only patches required were the ones that K.Haley posted. So outside of some tweaks to mingw all the credit for this should go to him!

I created an Installer package for the Win32 version and sent the link to Charles, earlier he offered to host it so if it passes his quality standards it hopefully will be available.
Any comments and suggestions for these instructions are encouraged!

My next project is to get Pan to build and run with a newer version of the GTK Runtime Enviroment.

Below is the Readme.mingw that Charles wrote. My additions and notes are added inline with: ****************************************

1: MINGW
===========
****************************************
If you download MinGW 5.0.0 it asks you which version you would like to install; previous, current, or proposed. Select previous.
****************************************
* MinGW (www.mingw.org) is the Minimalist GNU for Windows.
 Unlike cygwin, apps built with MinGW don't require any middleware
 libraries to run.  That's why I chose it over cygwin for Pan.
* Download the "MinGW" installer exe and install into c:\mingw\ .
* Download the "MSYS" and "MSYS Developer Toolkit" installer exes
 and install into c:\msys\ .
****************************************
Modify the file C:\MinGW\Include\Unistd.h to comment out lines 23 through 27. It should look similar to this:
/*int ftruncate(int, off_t);
__CRT_INLINE int ftruncate(int __fd, off_t __length)
{
return _chsize (__fd, __length);
*/}
This change was necessary to resolve this error when compiling Pan (Anyone know a cleaner solution?): c:/mingw/include/unistd.h:23: error: conflicting types for 'g_win32_ftruncate' C:/msys/1.0/opt/gtk/include/glib-2.0/glib/gwin32.h:72: error: previous declaration of 'g_win32_ftruncate' was here c:/mingw/include/unistd.h:23: error: conflicting types for 'g_win32_ftruncate' C:/msys/1.0/opt/gtk/include/glib-2.0/glib/gwin32.h:72: error: previous declaration of 'g_win32_ftruncate' was here
****************************************
* Copy the .profile file from the bottom of this document into
 c:\msys\1.0\home\yourname\.profile .




2: LIBRARY PREREQUISITES
========================
I installed each of the prerequisites in its own directory underneath
c:\msys\1.0\opt\, so that (1) they're easy to blow away piece-by-piece
to upgrade to newer versions, and (2) they show up as /opt/gtk, /opt/libxml,
and so on from msys, which is reasonably clear.  If you choose a different
hierarchy make sure to tweak your .profile.

2.1 GTK
=======
+ pan needs gtk to run.
* Install the latest "GTK Runtime Environment"
and "GTK Development Environment" -- *IN THAT ORDER* --
from http://sourceforge.net/projects/gtk-win/
into c:\msys\1.0\opt\gtk
I used version 2.2.4-3 for both.
* edit /opt/gtk/bin/glib-gettextize, replace "/target" with "/opt/gtk"
* sanity check: you should now be able to run gtk-demo.exe from msys.
* sanity check: the pixbuf demo inside of gtk-demo.exe should work without an error dialog.


2.2 LIBXML2
===========

+ Pan needs libxml2 to run.
* Snag a tarball from ftp://xmlsoft.org/ and untar it in your msys home directory. [Use libxml2-2.6.2, because 2.6.3 and higher break with "_impl__xmlFree undefined"] [Update: as of 2.6.16, _impl__xmlFree still persists, so stick with 2.6.2.]
* ./configure --prefix=/opt/libxml2; make; make install
* edit /opt/libxml2/lib/pkgconfig/libxml-2.0.pc:
Add " -lws2_32 " to the end of the "Libs:" line.
* Sanity check: "$ pkg-config --cflags libxml-2.0" should give meaningful output now. * Sanity check: "$ pkg-config --libs libxml-2.0" should also work, and include -lws2_32

2.3 PCRE
========
* Like XNews and slrn, Pan uses the perl-compatable regex library.
* Download and unzip pre-built pcre "Binaries" and "Developers files"
from http://gnuwin32.sourceforge.net/packages/pcre.htm
to c:\msys\1.0\opt\pcre\
* Edit /opt/pcre/bin/pcre-config:
+ set 'prefix' to /cygdrive/c/devel/pcre
+ set 'exec_prefix_set' to yes
* Update your .bash_profile. Make sure this version of pcre-config is ahead of the cygwin one in your path.
* Sanity check: "$ pcre-config --libs" should give meaningful output now.

2.4 GNOME-COMMON (only needed when building Pan from CVS)
=========================================================
+ Pan's autogen.sh needs gnome-common
* Unroll a tarball from ftp.gnome.org/pub/gnome/sources/gnome-common to your msys home directory.
* ./configure --prefix=/opt/gnome-common; make; make install
* vi /opt/gnome-common/share/aclocal/gnome2-macros/autogen.sh --
change the default values for autoconf, libtool, and automake to sync with the versions in msys.

2.5 PREREQUISITE SUMMARY
========================
* At this point, you must have the following subdirectories:
+ /opt/gtk
+ /opt/libxml2
+ /opt/pcre
* And, if you plan on building from CVS, you'll also need:
+ /opt/gnome-common

3: BUILDING PAN.EXE
===================
* Get a tarball or CVS snapshot of Pan.
****************************************
Checkout the latest snapshot from CVS with:
export CVSROOT=":pserver:address@hidden:/cvs/gnome"
cvs -z3 checkout pan
****************************************
* If building from CVS, make these changes:
1. Remove the lines "AC_PROG_INTLTOOL" and "AM_ICONV()" from configure.in.
2. Remove the INTLTOOL, DESKTOP, and PRODUCTIVITY lines from the top-level Makefile.am
(I'd welcome help from savvy hackers about how to avoid these removals.)
****************************************
Update the pan.iss.in to install pcreposix.dll and libxml2.dll with the setup package:
--- pan.iss.in        Wed Dec 10 23:13:50 2003
+++ pan.iss.in   Sun Feb 26 23:32:38 2006
@@ -60,6 +60,8 @@
Source: "c:\msys\1.0\home\shk\pan\COPYING"; DestDir: "{app}";Components: component_app; Flags: ignoreversion Source: "c:\msys\1.0\home\shk\pan\CREDITS"; DestDir: "{app}";Components: component_app; Flags: ignoreversion Source: "c:\msys\1.0\home\shk\pan\README.windows"; DestDir: "{app}";DestName: "README.txt"; Components: component_app; Flags:ignoreversion +Source: "c:\msys\1.0\opt\pcre\bin\pcreposix.dll"; DestDir: "{app}";Components: component_app; Flags: ignoreversion +Source: "c:\msys\1.0\opt\gtk\lib\libxml2.dll"; DestDir: "{app}";Components: component_app; Flags: ignoreversion Source: "c:\msys\1.0\opt\pcre\bin\pcre.dll"; DestDir: "{sys}";Components: component_app; Flags: onlyifdoesntexist Source: "c:\msys\1.0\home\shk\pan\po\ca.mo"; DestDir:"{reg:HKLM\SOFTWARE\GTK\2.0,Path|{app}}\share\locale\ca\LC_MESSAGES\";DestName: "pan.mo"; Components: component_i18n; Flags: ignoreversion Source: "c:\msys\1.0\home\shk\pan\po\cs.mo"; DestDir:"{reg:HKLM\SOFTWARE\GTK\2.0,Path|{app}}\share\locale\cs\LC_MESSAGES\";DestName: "pan.mo"; Components: component_i18n; Flags: ignoreversion

Apply the following patches provided by K. Haley (Note: the patch to configure.in did not seem to work for me, but I think that is due to the old version of libxml I was running. I removed the line AC_PROG_INTLTOOL([0.21]) as Charles walkthrough described and it built and ran fine)
Index: gmime/gmime-stream.h
===================================================================
--- gmime/gmime-stream.h    (revision 159)
+++ gmime/gmime-stream.h    (working copy)
@@ -34,7 +34,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <stdarg.h>
-
+#include <stdio.h>
#include "gmime-type-utils.h"

#define GMIME_TYPE_STREAM            (g_mime_stream_get_type ())
Index: pan/util.c
===================================================================
--- pan/util.c    (revision 258)
+++ pan/util.c    (working copy)
@@ -24,12 +24,13 @@
#include <string.h>
#include <time.h>

+#include <glib.h>
+#include <gtk/gtk.h>
+
#ifdef G_OS_WIN32
#include <windows.h> /* for ShellExecute */
#endif

-#include <glib.h>
-#include <gtk/gtk.h>

#include <pan/base/argset.h>
#include <pan/base/debug.h>
@@ -241,7 +242,7 @@
pan_url_show (const char * url)
{
#ifdef G_OS_WIN32
-    ShellExecute (NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
+    ShellExecute (NULL, "open", url, NULL, NULL, /*SW_SHOWNORMAL*/ 1);
#else
   const char * browser_string;
   const char * march;
Index: pan/prefs.c
===================================================================
--- pan/prefs.c    (revision 159)
+++ pan/prefs.c    (working copy)
@@ -107,6 +107,7 @@
#ifdef G_OS_WIN32
#define DEFAULT_EXTERNAL_EDITOR "notepad %t"
#define DEFAULT_SCORE_EDITOR_COMMAND "notepad %t"
+#define DEFAULT_WEB_BROWSER "%s"
#else
#define DEFAULT_WEB_BROWSER "mozilla %s"
#define DEFAULT_EXTERNAL_EDITOR "xterm -e vi %t"
Index: configure.in
===================================================================
--- configure.in    (revision 313)
+++ configure.in    (working copy)
@@ -9,7 +9,7 @@
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(pan/pan.c)
AC_CONFIG_AUX_DIR(.)
-AC_PROG_INTLTOOL([0.21])
+AC_PROG_INTLTOOL([0.21], [no-xml])

dnl init prerequisite versions
GLIB_REQUIRED=2.2.0
@@ -194,7 +194,7 @@
AC_CANONICAL_HOST
case $build_os in
      *cygwin|*mingw32*)
-       CFLAGS="$CFLAGS -mms-bitfields -mwin32 -mwindows"
+       LIBS="$LIBS -lshell32 -lws2_32"
      ;;
esac
****************************************
* run ./autogen.sh from pan's top-level directory. This will take a long time.
* *drum roll...* make!

4: BULDING PAN-SETUP.EXE
========================
* Make sure pan.iss and README.windows exist
* go into pan/po/ directory and make the mo files
****************************************
make mo doesn't seem to work for me so I had to do
msgfmt xx.po -o xx.mo where xx is each country code. I could have scripted this or dug into why make mo did not work but it took less than 5 minutes to do it by hand so I just did it this way
****************************************
* Install INNO Setup version 4 (or higher) from http://www.jrsoftware.org/is4.php
* Open c:\msys\1.0\home\yourname\pan\pan.iss inside the inno installer
****************************************
Edit the pan.iss file to change the paths to properly reflect your current paths so if your username is smith replace home\shk with home\smith
****************************************
* Should compile and build without a hitch, placing the setup file in c:\


APPENDIX: MY .profile
=====================

# Life with MinGW
export CFLAGS="$CFLAGS -mwindows -mno-cygwin -mms-bitfields"
export CPPFLAGS="$CPPFLAGS -I/c/mingw/include -DWINDOWS -DWIN32"
export PATH="$PATH:/c/mingw/bin"
export CVSROOT=":pserver:address@hidden:/cvs/gnome"

# GTK
export GTK_HOME="/opt/gtk"
export CPPFLAGS="$CPPFLAGS -I$GTK_HOME/include"
export PATH="$GTK_HOME/bin:$GTK_HOME/lib:$PATH"
export PKG_CONFIG_PATH="$GTK_HOME/lib/pkgconfig:$PKG_CONFIG_PATH"
export ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $GTK_HOME/share/aclocal"
export LIBICONV="$GTK_HOME/lib/iconv.dll"

# LIBXML2
export LIBXML2_HOME="/opt/libxml2"
export PKG_CONFIG_PATH="$LIBXML2_HOME/lib/pkgconfig:$PKG_CONFIG_PATH"

# PCRE
export PCRE_HOME="/opt/pcre"
export PATH="$PATH:$PCRE_HOME/bin"

# GNOME-COMMON
# this is only needed if you're building from CVS
export GNOME_COMMON_HOME="/opt/gnome-common"
export PATH="$PATH:$GNOME_COMMON_HOME/bin"
export ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $GNOME_COMMON_HOME/share/aclocal"

echo "Loaded .profile..."



DPA wrote:

Charles Kerr wrote:
>
> Which version of mingw didn't work, and which did?

mingw has three versions, candidate, current and previous. I used the previous version. I think this is version 3.2. Candidate and Current both failed.


> If an end-user were to run the GIMP Windows GTK+ installer instead
> of the one on Pan's home page, would your build work correctly?

It did not for me, I can always try building it with the newer GDK and see if it works.

>> Charles, would you like me to email you this package to examine and
>> test? Should I gzip up my build directory as well and send it to you or
>> would you prefer if I made a number of patch files?
>
> Patch files would be great.
I will put together the patch files tonight or tomorrow and I will also send you directly a link to the package for you to test shortly.

Thanks,
Darren


_______________________________________________
Pan-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/pan-devel






reply via email to

[Prev in Thread] Current Thread [Next in Thread]