[Xfce4-commits] <thunarx-python:master> There is currently no reason why thunarx-python won't work with thunarx-1. Find out whether the user has thunarx-1 or thunarx-2 installed and prefer 2.

Adam Plumb noreply at xfce.org
Thu May 27 18:10:59 CEST 2010


Updating branch refs/heads/master
         to 680a68b2321dcd9ff79b5723cc5e97a9e718e177 (commit)
       from 8ba2991f2c218629c951fecf7729801688759b73 (commit)

commit 680a68b2321dcd9ff79b5723cc5e97a9e718e177
Author: Adam Plumb <adamplumb at gmail.com>
Date:   Mon Jan 11 13:28:02 2010 -0500

    There is currently no reason why thunarx-python won't work with thunarx-1.  Find out whether the user has thunarx-1 or thunarx-2 installed and prefer 2.

 configure.ac.in |   22 +++++++++++++++++-----
 src/Makefile.am |    2 +-
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 6028f90..d19e673 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -17,13 +17,11 @@ m4_define([txp_version_micro], [1])
 m4_define([txp_version_build], [@REVISION@])
 m4_define([txp_version], [txp_version_major().txp_version_minor().txp_version_micro()ifelse(txp_version_tag(), [], [], [txp_version_tag()-txp_version_build()])])
 
-
 dnl ***************************
 dnl *** Initialize autoconf ***
 dnl ***************************
 AC_COPYRIGHT([Copyright (c) 2009 Adam Plumb <adamplumb at gmail.com>.])
 AC_INIT([thunarx-python], [txp_version], [thunar-dev at xfce.org])
-AC_PREFIX_DEFAULT([$(pkg-config --variable prefix thunarx-2 || echo /usr/local)])
 AC_PREREQ([2.50])
 AC_CANONICAL_TARGET()
 
@@ -71,7 +69,21 @@ AM_CHECK_PYTHON_LIBS(,[AC_MSG_ERROR(could not find Python lib)])
 dnl ***********************************
 dnl *** Check for required packages ***
 dnl ***********************************
-XDT_CHECK_PACKAGE([THUNARX], [thunarx-2], [1.0.1])
+
+dnl ***************************
+dnl *** Determine the installed thunarx version ***
+dnl ***************************
+if test "`pkg-config --variable prefix thunarx-2`" != ""; then
+    THUNARX_API_VERSION=2
+    AC_PREFIX_DEFAULT([$(pkg-config --variable prefix thunarx-2 || echo /usr)])
+    XDT_CHECK_PACKAGE([THUNARX], [thunarx-2], [1.0.1])
+else
+    THUNARX_API_VERSION=1
+    AC_PREFIX_DEFAULT([$(pkg-config --variable prefix thunarx-1 || echo /usr)])
+    XDT_CHECK_PACKAGE([THUNARX], [thunarx-1], [0.4.0])
+fi
+AC_SUBST(THUNARX_API_VERSION)
+
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
 XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.6.0])
 XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [2.6.0])
@@ -86,7 +98,7 @@ AC_SUBST(PYTHON_CFLAGS)
 AC_SUBST(PYTHON_LIBS)
 AC_SUBST(PYTHON_LDFLAGS)
 
-THUNARX_LIBDIR=`pkg-config --variable=libdir thunarx-2`
+THUNARX_LIBDIR=`pkg-config --variable=libdir thunarx-${THUNARX_API_VERSION}`
 AC_SUBST(THUNARX_LIBDIR)
 AC_DEFINE_UNQUOTED(THUNARX_LIBDIR, "$THUNARX_LIBDIR", [Thunarx libdir])
 
@@ -103,7 +115,7 @@ AC_MSG_RESULT($PYGTK_CODEGEN)
 dnl ---------------------------------
 dnl Get thunar extensions directory
 dnl ---------------------------------
-THUNARX_EXTENSION_DIR=`$PKG_CONFIG --variable=extensionsdir thunarx-2`
+THUNARX_EXTENSION_DIR=`$PKG_CONFIG --variable=extensionsdir thunarx-${THUNARX_API_VERSION}`
 AC_SUBST(THUNARX_EXTENSION_DIR)
 AC_DEFINE_UNQUOTED(THUNARX_EXTENSION_DIR, "$THUNARX_EXTENSION_DIR", [Thunar's extensions directory])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 42091b7..5254ee6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS =								\
 	-DPY_LIB_LOC=\"$(PYTHON_LIB_LOC)\"				\
 	-DPYTHON_VERSION=\"$(PYTHON_VERSION)\"
 
-extensionsdir = $(libdir)/thunarx-2
+extensionsdir = $(THUNARX_LIBDIR)/thunarx- at THUNARX_API_VERSION@
 extensions_LTLIBRARIES =						\
 	thunarx-python.la
 



More information about the Xfce4-commits mailing list