Debian ships gnulib in /usr/bin and /usr/share/gnulib/. The version is
too old to supply some of the macros pspp uses, but just pulling the
git repository (as suggested by the build docs) works just fine.

I spent a few hours playing with PSPP trying to get it to compile on
debian/etch. My basic constraint is that while I would like to
contribute, I simply can't risk the stability of my machine at this
point, so it has to stay within the confines of debian stable.

The following are the problems I had.

(1) gettext-0.17
- seems to be required so that AM_XGETTEXT_OPTIONS is available (to avoid gnulib
  warnings), however the output clearly shows the alternative to requiring a
  whole version bump of gettext is to edit po/Makevars. Essentially, some gnulib
  modules have requirements for po/Makevars that they can append automatically
  if AM_XGETTEXT_OPTIONS is available, otherwise this edit is required.

(2) gperf
- despite the immense configure process, gperf isn't tested for (you get to make
  and it dies)

Can easily fix with (in configure.ac):
  AC_CHECK_PROG([have_gperf], [gperf], [yes], [no])
  AS_IF([test x$have_gperf = xno], [AC_MSG_ERROR([gperf is required!])])

  but this then requires the user running a configure script to have the tool.
  The force of my magic is insufficient for this task.

(3) gtk+-2.12
  There are only two places where post 2.8 APIs are used:
  ( i) the data import wizard
       Files affected:
         data-editor.c
         text-data-import-dialog.c
         text-data-import-dialog.h

       Uses a GtkAssistant (new in 2.10). Fix is to make compiling
       text-data-import-dialog conditional on gtk-2.10 (automake.mk) and the
       single call out from data editor condiitonally compiled.

  (ii) tooltips in the treeview
        Files affected:
         dict-display.c

       Uses GtkTooltip rather than the old GtkTooltips (new in 2.12). Fix is
       to make the affected method and its caller conditionally compiled.

The following is a patch against current cvs that allows pspp to build
with gettext-0.16.1 and gtk-2.8.20, which are the most recent versions
available in debian stable. The functionality is 99% percent present
(could be more, but why work too hard when all you have to do is wait
for the fix to present itself - this is enough that I could work on
pspp now...) All that is missing is tooltips in the tree view and the
import text data wizard.

I hope this is reasonable... (nb I've tried to be very careful, but
since I can't install these libraries, I can't test my patch works on
2.12+ - if I could I wouldn't need the patch).

Ed
Index: configure.ac
===================================================================
RCS file: /sources/pspp/pspp/configure.ac,v
retrieving revision 1.85
diff -u -r1.85 configure.ac
--- configure.ac	20 May 2008 14:01:09 -0000	1.85
+++ configure.ac	25 May 2008 23:02:44 -0000
@@ -25,7 +25,7 @@
 
 dnl Internationalization macros.
 AM_GNU_GETTEXT([external], [need-ngettext])
-AM_GNU_GETTEXT_VERSION([0.17])
+AM_GNU_GETTEXT_VERSION([0.16.1])
 
 dnl Checks for libraries.
 AC_SYS_LARGEFILE
@@ -40,13 +40,24 @@
   [AS_HELP_STRING([--without-gui], [don't build the PSPPIRE gui])])
 
 if test x"$with_gui" != x"no" ; then 
-  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.12.0,,
-    [PSPP_REQUIRED_PREREQ([gtk+ 2.0 v2.12.0 or later (or use --without-gui)])])
+  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.12.0, [have_gtk_2_12_0=yes],
+    [PSPP_OPTIONAL_PREREQ([gtk+ 2.0 v2.12.0 or later (some features disabled)])])
+  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10.0,  [have_gtk_2_10_0=yes],
+    [PSPP_OPTIONAL_PREREQ([gtk+ 2.0 v2.10.0 or later (some features disabled)])])
+  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0,,
+    [PSPP_REQUIRED_PREREQ([gtk+ 2.0 v2.8.0 or later (or use --without-gui)])])
   PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.6.0,,
     [PSPP_REQUIRED_PREREQ([libglade 2.0 v2.6.0 or later (or use --without-gui)])])
 fi
 AM_CONDITIONAL(WITHGUI, test x"$with_gui" != x"no")
-
+AS_IF([test x"$have_gtk_2_10_0" = x"yes"], 
+      [AC_DEFINE(PSPP_WITH_GTK_2_10_0, 1, 
+                 [Define to 1 if GTK+-2.0 2.10.0+ is available.])])
+AM_CONDITIONAL(PSPP_WITH_GTK_2_10_0, test x"$have_gtk_2_10_0" = x"yes")
+AS_IF([test x"$have_gtk_2_12_0" = x"yes"], 
+      [AC_DEFINE(PSPP_WITH_GTK_2_12_0, 1,
+                 [Define to 1 if GTK+-2.0 2.12.0+ is available.])])
+AM_CONDITIONAL(PSPP_WITH_GTK_2_12_0, test x"$have_gtk_2_12_0" = x"yes")
 
 dnl Checks needed for psql reader
 
Index: po/Makevars
===================================================================
RCS file: /sources/pspp/pspp/po/Makevars,v
retrieving revision 1.4
diff -u -r1.4 Makevars
--- po/Makevars	27 May 2006 08:36:09 -0000	1.4
+++ po/Makevars	25 May 2008 23:02:45 -0000
@@ -8,7 +8,12 @@
 top_builddir = ..
 
 # These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \
+    --flag=error:3:c-format \
+    --flag=error_at_line:5:c-format \
+    --flag=asprintf:2:c-format \
+    --flag=vasprintf:2:c-format \
+    --flag=xasprintf:1:c-format
 
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
Index: src/ui/gui/automake.mk
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/automake.mk,v
retrieving revision 1.56
diff -u -r1.56 automake.mk
--- src/ui/gui/automake.mk	20 May 2008 14:01:10 -0000	1.56
+++ src/ui/gui/automake.mk	25 May 2008 23:02:45 -0000
@@ -184,8 +184,6 @@
 	src/ui/gui/syntax-editor.h \
 	src/ui/gui/syntax-editor-source.c \
 	src/ui/gui/syntax-editor-source.h \
-	src/ui/gui/text-data-import-dialog.c \
-	src/ui/gui/text-data-import-dialog.h \
 	src/ui/gui/transpose-dialog.c \
 	src/ui/gui/transpose-dialog.h \
 	src/ui/gui/t-test-independent-samples-dialog.c \
@@ -211,6 +209,12 @@
 	src/ui/gui/window-manager.c \
 	src/ui/gui/window-manager.h
 
+if	PSPP_WITH_GTK_2_10_0 
+  EXTRA_src_ui_gui_psppire_SOURCES = \
+	src/ui/gui/text-data-import-dialog.c \
+	src/ui/gui/text-data-import-dialog.h
+endif
+
 yelp-check:
 	@if ! yelp --version > /dev/null 2>&1 ; then \
 		echo    ; \
Index: src/ui/gui/data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.73
diff -u -r1.73 data-editor.c
--- src/ui/gui/data-editor.c	8 May 2008 00:37:12 -0000	1.73
+++ src/ui/gui/data-editor.c	25 May 2008 23:02:46 -0000
@@ -707,6 +707,9 @@
 			    "activate",
 			    G_CALLBACK (gtk_action_activate),
 			    de->invoke_text_import_assistant);
+#ifndef PSPP_WITH_GTK_2_10_0
+  gtk_widget_set_sensitive(get_widget_assert(de->xml, "file_import-text"), FALSE);
+#endif
 
   g_signal_connect_swapped (get_widget_assert (de->xml,"file_save"),
 			    "activate",
@@ -1235,9 +1238,13 @@
 		    _("_Import Text Data"),
 		    _("Import text data file"),
 		    "");
-
+#ifdef PSPP_WITH_GTK_2_10_0
   g_signal_connect (de->invoke_text_import_assistant, "activate",
 		    G_CALLBACK (text_data_import_assistant), de);
+#else
+  gtk_action_set_sensitive(de->invoke_text_import_assistant, FALSE);
+#endif
+ 
 }
 
 /* Returns true if NAME has a suffix which might denote a PSPP file */
Index: src/ui/gui/dict-display.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/dict-display.c,v
retrieving revision 1.7
diff -u -r1.7 dict-display.c
--- src/ui/gui/dict-display.c	14 Mar 2008 10:42:55 -0000	1.7
+++ src/ui/gui/dict-display.c	25 May 2008 23:02:46 -0000
@@ -154,6 +154,7 @@
 }
 
 
+#ifdef PSPP_WITH_GTK_2_12_0
 /* Sets the tooltip to be the name of the variable under the cursor */
 static gboolean
 set_tooltip_for_variable (GtkTreeView  *treeview,
@@ -199,6 +200,7 @@
 
   return TRUE;
 }
+#endif
 
    /* Sets up TREEVIEW to display the variables of DICT.
    MODE is the selection mode for TREEVIEW.
@@ -267,9 +269,11 @@
 
   gtk_tree_selection_set_mode (selection, mode);
 
+#ifdef PSPP_WITH_GTK_2_12_0
   g_object_set (treeview, "has-tooltip", TRUE, NULL);
 
   g_signal_connect (treeview, "query-tooltip", G_CALLBACK (set_tooltip_for_variable), NULL);
+#endif
 }
 
 
_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to