summaryrefslogtreecommitdiff
path: root/libappindicator-sharp/conditional-py-bindings.patch
blob: c916d9ba2cf6c3c6c31961e4fdefea101465e411 (plain)
    1 --- a/bindings/Makefile.am	2015-07-10 10:04:18.091199191 +0200
    2 +++ b/bindings/Makefile.am	2015-07-10 10:19:47.047974439 +0200
    3 @@ -3,8 +3,10 @@
    4  	vala
    5  else
    6  SUBDIRS =		\
    7 -	python		\
    8  	vala
    9 +if HAS_PYTHON
   10 +SUBDIRS += python
   11 +endif
   12  endif
   13  
   14  if HAS_MONO
   15 --- a/configure.ac	2015-07-16 13:28:41.007502838 +0200
   16 +++ b/configure.ac_new	2015-07-16 13:53:18.118602877 +0200
   17 @@ -188,25 +188,37 @@
   18  PYGTK_REQUIRED=2.14.0
   19  PYGOBJECT_REQUIRED=0.22
   20  
   21 -AM_PATH_PYTHON(2.3.5)
   22 -AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
   23 +AC_ARG_ENABLE([python],
   24 +	AC_HELP_STRING([--enable-python], [Enable python for GTK2 build]),,
   25 +	[enable_python=yes])
   26  
   27 -PKG_CHECK_MODULES(APPINDICATOR_PYTHON,
   28 +if test x"$with_gtk" = x"3" ; then
   29 +	enable_python=no
   30 +fi
   31 +
   32 +AM_CONDITIONAL(HAS_PYTHON, test x"${enable_python}" != x"no")
   33 +
   34 +if test x"$enable_python" != x"no" ; then
   35 +	AM_PATH_PYTHON(2.3.5)
   36 +	AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
   37 +
   38 +	PKG_CHECK_MODULES(APPINDICATOR_PYTHON,
   39                    [
   40  					pygtk-2.0 >= $PYGTK_REQUIRED
   41  					gtk+-2.0 >= $GTK_REQUIRED_VERSION
   42  					pygobject-2.0 >= $PYGOBJECT_REQUIRED
   43                    ])
   44  
   45 -AC_MSG_CHECKING(for pygtk defs)
   46 -PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
   47 -AC_SUBST(PYGTK_DEFSDIR)
   48 -AC_MSG_RESULT($PYGTK_DEFSDIR)
   49 -
   50 -AC_MSG_CHECKING(for pygtk codegen)
   51 -PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
   52 -AC_SUBST(PYGTK_CODEGEN)
   53 -AC_MSG_RESULT($PYGTK_CODEGEN)
   54 +	AC_MSG_CHECKING(for pygtk defs)
   55 +	PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
   56 +	AC_SUBST(PYGTK_DEFSDIR)
   57 +	AC_MSG_RESULT($PYGTK_DEFSDIR)
   58 +
   59 +	AC_MSG_CHECKING(for pygtk codegen)
   60 +	PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
   61 +	AC_SUBST(PYGTK_CODEGEN)
   62 +	AC_MSG_RESULT($PYGTK_CODEGEN)
   63 +fi
   64  
   65  #########################
   66  # Check if build tests
   67 @@ -278,4 +290,5 @@
   68  	Tests:         $enable_tests
   69  	Mono tests:    $have_nunit
   70  	gcov:	       $use_gcov
   71 +	Python:        $enable_python
   72  ])

Generated by cgit