[gtk-mac-integration] Make package work with "make dist"



commit 41d88c80d21ec1a7acbd2d209017131a0d089e94
Author: John Ralls <jralls ceridwen us>
Date:   Thu Sep 22 10:15:38 2011 -0700

    Make package work with "make dist"
    
    This took a couple of changes:
    strings/Makefile had to be redone to use automake instead of having a hand-written Makefile.in
    Provision had to be made for building all three python binding directories. For this to work, it's necessary to have both gtk+-2 and gtk+-3 installed along with pygobject-2, pygobject-3 and pygtk (and all the other pygtk dependencies), and to pass --enable-python=all to configure.

 Makefile.am                          |    3 +-
 acinclude.m4                         |   26 ++++++++++++++-------
 strings/{Makefile.in => Makefile.am} |   41 +++++++++------------------------
 3 files changed, 30 insertions(+), 40 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 42f3da0..6070167 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,4 +2,5 @@ SUBDIRS = src data bindings docs strings
 
 EXTRA_DIST = gtk-doc.make
 
-DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+AUTOMAKE_OPTIONS = dist-tarZ dist-bzip2
+DISTCHECK_CONFIGURE_FLAGS = --enable-python=all --enable-gtk-doc
diff --git a/acinclude.m4 b/acinclude.m4
index c6ef64d..8a9da55 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -46,7 +46,7 @@ AC_DEFUN([GTK_PYTHON_CHECK],
   dnl AC_SUBST([PYTHON_DIR])
 
   AC_ARG_ENABLE([python],
-    AS_HELP_STRING([--enable-python=@<:@no/yes/auto@:>@],
+    AS_HELP_STRING([--enable-python=@<:@no/yes/all/auto@:>@],
                    [build Python bindings [[default=auto]]]),,
     [enable_python=auto])
 
@@ -56,41 +56,49 @@ AC_DEFUN([GTK_PYTHON_CHECK],
     have_python=yes
 
     dnl Check for Python
+    AC_MSG_CHECKING([Python Version])
     AM_PATH_PYTHON(2.3.5,,[AC_MSG_RESULT([Python 2.3.5 or newer is required])])
+    AC_MSG_CHECKING([Python Headers])
     AM_CHECK_PYTHON_HEADERS(,[AC_MSG_RESULT([Python headers not found])])
-    AS_IF([ test x$GTK_MAJOR = "xgtk+-2.0"],
+    AC_MSG_NOTICE([Switch on Gtk+ Version])
+    AS_IF([ test x$GTK_MAJOR = "xgtk+-2.0" -o x$enable_python = "xall"], [
     dnl Check for PyGTK
-      [ PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= 2.16.0,,have_pygobject=no)
+        AC_MSG_CHECKING([PyGObject 2.16 or newer])
+        PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= 2.16.0,,have_pygobject=no)
     	if test "x$have_pygobject" = xno; then
       	   AC_MSG_RESULT([PyGObject 2.16.0 or newer])
     	fi
+	AC_MSG_CHECKING([PyGtk 2.14 or newer])
     	PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.14.0,,have_pygtk=no)
     	if test "x$have_pygtk" = xno; then
       	   AC_MSG_RESULT([PyGTK 2.14.0 or newer])
     	fi
-
-    	AC_PATH_PROG(PYGOBJECT_CODEGEN, pygobject-codegen-2.0, no)
+	AC_MSG_CHECKING([PyGObject-Codegen 2.0])
+    	AC_PATH_PROG([PYGOBJECT_CODEGEN], [pygobject-codegen-2.0], [no])
     	if test "x$PYGOBJECT_CODEGEN" = xno; then
       	   have_python=no
       	   AC_MSG_RESULT([pygobject-codegen-2.0 script not found])
     	fi
 
-    	AC_MSG_CHECKING(for pygtk defs)
+    	AC_MSG_CHECKING([PyGtk DefsDir])
     	PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
     	AC_SUBST(PYGTK_DEFSDIR)
     	AC_MSG_RESULT($PYGTK_DEFSDIR)
      ],
-     [ test x$GTK_MAJOR = "xgtk+-3.0" ],
+     [ test x$GTK_MAJOR = "xgtk+-3.0" -o x$enable_python = "xall"],
 dnl Check that pygobject and gtk-3.0.gir are present
      [ PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= 2.28.0,,have_pygobject=no)
+        AC_MSG_CHECKING([PyGObject 3.0])
     	if test "x$have_pygobject" = xno; then
-      	   AC_MSG_RESULT([PyGObject 2.28.0 or newer])
+      	   AC_MSG_RESULT([PyGObject 3.0.0 or newer])
     	fi
-    	AC_PATH_PROG(PYGOBJECT_CODEGEN, pygobject-codegen-2.0, no)
+	AC_MSG_CHECKING([PyGObject-Codegen-2.0])
+    	AC_PATH_PROG([PYGOBJECT_CODEGEN], [pygobject-codegen-2.0], [no])
     	if test "x$PYGOBJECT_CODEGEN" = xno; then
       	   have_python=no
       	   AC_MSG_RESULT([pygobject-codegen-2.0 script not found])
     	fi
+	AC_MSG_CHECKING([Gtk GIR])
 	GIR_PATH="$PREFIX/share/gir-1.0/Gtk-3.0.gir"
 	AC_CHECK_FILE($GIR_PATH,,have_python=no)
      ], have_python=no)
diff --git a/strings/Makefile.in b/strings/Makefile.am
similarity index 68%
rename from strings/Makefile.in
rename to strings/Makefile.am
index 60e92f6..dba3d29 100644
--- a/strings/Makefile.in
+++ b/strings/Makefile.am
@@ -5,27 +5,7 @@
 # Copyright 2010 John Ralls
 
 
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-SHELL = @SHELL@
- SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-subdir = strings
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datadir = @datadir@
-libdir = @libdir@
-datarootdir = @datarootdir@
-localedir = ${datadir}/strings
-install_sh = @install_sh@
-mkdir_p = $(install_sh) -d
-
-STRING_FILES =  GtkOSXApplication.strings.ca    \
+dist_string_DATA =  GtkOSXApplication.strings.ca    \
 		GtkOSXApplication.strings.cs    \
 		GtkOSXApplication.strings.da    \
 		GtkOSXApplication.strings.de    \
@@ -56,20 +36,21 @@ STRING_FILES =  GtkOSXApplication.strings.ca    \
 		GtkOSXApplication.strings.zh_CN \
 		GtkOSXApplication.strings.zh_TW
 
-all: Makefile
 
-install: ${STRING_FILES}
-	${mkdir_p} ${localedir}; \
-	for file in ${STRING_FILES}; do \
+stringdir = ${datadir}/strings
+
+install-dist_stringDATA: ${dist_string_DATA}
+	${mkdir_p} ${am_installdirs}; \
+	for file in ${dist_string_DATA}; do \
 	  dir_pref=`echo $$file | cut -f 3 -d '.' -`; \
-	  dest_dir=${localedir}/$$dir_pref.lproj; \
+	  dest_dir=${am_installdirs}/$$dir_pref.lproj; \
 	  dest_name=`echo $$file | cut -f 1 -f 2 -d '.' -`; \
 	  ${mkdir_p} $$dest_dir; \
-	  ${install_sh} $$file $$dest_dir/$$dest_name; \
+	  ${install_sh} $(srcdir)/$$file $$dest_dir/$$dest_name; \
 	done
 
-clean:
+uninstall-dist_stringDATA:
+	rm -rf ${am_installdirs}
+
 
-distclean: 
-	rm Makefile
 



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