Bug#713358: qgis: FTBFS: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. PYTHON_LIBRARY

2013-09-19 Thread Stefano Rivera
Control: tags -1 + patch

Here's what I did to get qgis to build in Ubuntu.

Apparently there's a new upstream release of qgis coming soon (that I
got one of the patches from).

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  H: +27 21 465 6908 C: +27 72 419 8559  UCT: x3127
Description: Update FindPythonLibrary to the version in kde4libs 4:4.10.5-1
 Fixes FTBFS with multi-arched Python
Author: Stefano Rivera stefa...@ubuntu.com
Bug-Debian: http://bugs.debian.org/713358
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1010508
Forwarded: no

--- a/cmake/FindPythonLibrary.cmake
+++ b/cmake/FindPythonLibrary.cmake
@@ -12,6 +12,11 @@
 # PYTHON_LONG_VERSION - The version of the Python interpreter found as a human
 # readable string.
 #
+# PYTHON_SITE_PACKAGES_INSTALL_DIR - this cache variable can be used for installing
+#  own python modules. You may want to adjust this to be the
+#  same as ${PYTHON_SITE_PACKAGES_DIR}, but then admin
+#  privileges may be required for installation.
+#
 # PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory.
 #
 # PYTHON_INCLUDE_PATH - Directory holding the python.h include file.
@@ -19,76 +24,50 @@
 # PYTHON_LIBRARY, PYTHON_LIBRARIES- Location of the Python library.
 
 # Copyright (c) 2007, Simon Edwards si...@simonzone.com
+# Copyright (c) 2012, Luca Beltrame lbeltr...@kde.org
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
+include(FindPackageHandleStandardArgs)
+
+find_package(PythonInterp)
+
+if (PYTHONINTERP_FOUND)
+
+option(INSTALL_PYTHON_FILES_IN_PYTHON_PREFIX Install the Python files in the Python packages dir FALSE)
+
+# Set the Python libraries to what we actually found for interpreters
+set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
+# These are kept for compatibility
+set(PYTHON_SHORT_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
+set(PYTHON_LONG_VERSION ${PYTHON_VERSION_STRING})
+
+find_package(PythonLibs QUIET)
+
+if(PYTHONLIBS_FOUND)
+set(PYTHON_LIBRARY ${PYTHON_LIBRARIES})
+endif(PYTHONLIBS_FOUND)
+
+# Auto detect Python site-packages directory
+execute_process(COMMAND ${PYTHON_EXECUTABLE} -c from distutils.sysconfig import get_python_lib; print(get_python_lib(True))
+OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_DIR
+OUTPUT_STRIP_TRAILING_WHITESPACE
+   )
 
+message(STATUS Python system site-packages directory: ${PYTHON_SITE_PACKAGES_DIR})
+if(INSTALL_PYTHON_FILES_IN_PYTHON_PREFIX)
+set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR})
+else()
+execute_process(COMMAND ${PYTHON_EXECUTABLE} -c from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))
+OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_INSTALL_DIR
+OUTPUT_STRIP_TRAILING_WHITESPACE
+   )
+endif()
 
-INCLUDE(CMakeFindFrameworks)
+if(NOT PYTHON_SITE_PACKAGES_INSTALL_DIR STREQUAL PYTHON_SITE_PACKAGES_DIR)
+message(STATUS The Python files will be installed to ${PYTHON_SITE_PACKAGES_INSTALL_DIR}. Make sure to add them to the Python search path (e.g. by setting PYTHONPATH))
+endif()
 
-if(EXISTS PYTHON_LIBRARY)
-  # Already in cache, be silent
-  set(PYTHONLIBRARY_FOUND TRUE)
-else(EXISTS PYTHON_LIBRARY)
-
-  FIND_PACKAGE(PythonInterp)
-
-  if(PYTHONINTERP_FOUND)
-
-FIND_FILE(_find_lib_python_py FindLibPython.py PATHS ${CMAKE_MODULE_PATH})
-
-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE}  ${_find_lib_python_py} OUTPUT_VARIABLE python_config)
-if(python_config)
-  STRING(REGEX REPLACE .*exec_prefix:([^\n]+).*$ \\1 PYTHON_PREFIX ${python_config})
-  STRING(REGEX REPLACE .*\nshort_version:([^\n]+).*$ \\1 PYTHON_SHORT_VERSION ${python_config})
-  STRING(REGEX REPLACE .*\nlong_version:([^\n]+).*$ \\1 PYTHON_LONG_VERSION ${python_config})
-  STRING(REGEX REPLACE .*\npy_inc_dir:([^\n]+).*$ \\1 PYTHON_INCLUDE_PATH ${python_config})
-  if(NOT PYTHON_SITE_PACKAGES_DIR)
-if(NOT PYTHON_LIBS_WITH_KDE_LIBS)
-  STRING(REGEX REPLACE .*\nsite_packages_dir:([^\n]+).*$ \\1 PYTHON_SITE_PACKAGES_DIR ${python_config})
-else(NOT PYTHON_LIBS_WITH_KDE_LIBS)
-  set(PYTHON_SITE_PACKAGES_DIR ${KDE4_LIB_INSTALL_DIR}/python${PYTHON_SHORT_VERSION}/site-packages)
-endif(NOT PYTHON_LIBS_WITH_KDE_LIBS)
-  endif(NOT PYTHON_SITE_PACKAGES_DIR)
-  STRING(REGEX REPLACE ([0-9]+).([0-9]+) \\1\\2 PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION})
-  set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT})
-  if(WIN32)
-  STRING(REPLACE \\ / PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR})
-  

Processed: Re: Bug#713358: qgis: FTBFS: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. PYTHON_LIBRARY

2013-09-19 Thread Debian Bug Tracking System
Processing control commands:

 tags -1 + patch
Bug #713358 [src:qgis] qgis: FTBFS: CMake Error: The following variables are 
used in this project, but they are set to NOTFOUND. PYTHON_LIBRARY
Added tag(s) patch.

-- 
713358: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713358
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel


Bug#713358: qgis: FTBFS: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. PYTHON_LIBRARY

2013-06-22 Thread Lucas Nussbaum
Source: qgis
Version: 1.7.4+1.7.5~20120320-1.1
Severity: serious
Tags: jessie sid
User: debian...@lists.debian.org
Usertags: qa-ftbfs-20130620 qa-ftbfs
Justification: FTBFS on amd64

Hi,

During a rebuild of all packages in sid, your package failed to build on
amd64.

Relevant part:
  debian/rules build
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/python-qgis.install.in 
 debian/python-qgis.install
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/python-qgis.lintian-overrides.in 
 debian/python-qgis.lintian-overrides
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/qgis-plugin-grass.install.in 
 debian/qgis-plugin-grass.install
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/qgis.sh.in debian/qgis.sh
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/control.debiangis debian/control
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/libqgis{QGIS_ABI}-dev.install 
 debian/libqgis1.7.5-dev.install
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/libqgis{QGIS_ABI}.install 
 debian/libqgis1.7.5.install
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/libqgis{QGIS_ABI}.lintian-overrides 
 debian/libqgis1.7.5.lintian-overrides
 sed -e s/{QGIS_ABI}/1.7.5/g -e s/{GRASS}/grass64/g -e 
 s/{GRASS_ABI}/642/g debian/qgis-sqlanywhere{QGIS_ABI}.install 
 debian/qgis-sqlanywhere1.7.5.install
 dh_testdir
 # Add here commands to configure the package.
 [ -d debian/build ] || mkdir debian/build
 [ ! -e CMakeCache.txt ] || rm CMakeCache.txt
 cd debian/build; cmake -D GRASS_PREFIX=/usr/lib/grass64 -D 
 CMAKE_INSTALL_PREFIX=/usr -D CMAKE_SKIP_RPATH=TRUE -D 
 BINDINGS_GLOBAL_INSTALL=TRUE -D PEDANTIC=TRUE -D WITH_SPATIALITE=TRUE -D 
 WITH_MAPSERVER=TRUE -D QGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin -D 
 WITH_APIDOC=TRUE -D WITH_INTERNAL_SPATIALITE=TRUE ../..
 -- The C compiler identification is GNU 4.8.1
 -- The CXX compiler identification is GNU 4.8.1
 -- Check for working C compiler: /usr/bin/cc
 -- Check for working C compiler: /usr/bin/cc -- works
 -- Detecting C compiler ABI info
 -- Detecting C compiler ABI info - done
 -- Check for working CXX compiler: /usr/bin/c++
 -- Check for working CXX compiler: /usr/bin/c++ -- works
 -- Detecting CXX compiler ABI info
 -- Detecting CXX compiler ABI info - done
 -- Quantum GIS version: 1.7.5 Wroclaw (10705)
 -- Found GRASS: /usr/lib/grass64 (6.4.2)
 -- Looking for openpty
 -- Looking for openpty - not found
 -- Looking for openpty
 -- Looking for openpty - found
 -- Found Proj: /usr/lib/libproj.so
 -- Found Expat: /usr/lib/x86_64-linux-gnu/libexpat.so
 -- Found GSL: -L/usr/lib -lgsl -lgslcblas -lm
 -- Found GEOS: /usr/lib/libgeos_c.so
 -- Found GDAL: /usr/lib/libgdal.so
 -- Found Qwt: /usr/lib/libqwt-qt4.so
 -- Found PostgreSQL: /usr/lib/libpq.so
 -- Looking for Q_WS_X11
 -- Looking for Q_WS_X11 - found
 -- Looking for Q_WS_WIN
 -- Looking for Q_WS_WIN - not found
 -- Looking for Q_WS_QWS
 -- Looking for Q_WS_QWS - not found
 -- Looking for Q_WS_MAC
 -- Looking for Q_WS_MAC - not found
 -- Found Qt4: /usr/bin/qmake (found suitable version 4.8.4, minimum 
 required is 4.4.0) 
 -- Pedantic compiler settings enabled
 -- Found PythonInterp: /usr/bin/python (found version 2.7.5) 
 -- Found Python executable: /usr/bin/python
 -- Found Python version: 2.7.5+
 -- Found Python library: PYTHON_LIBRARY-NOTFOUND
 -- Found SIP version: 4.14.7
 -- Found PyQt4 version: 4.10.2
 -- Found FCGI: /usr/lib/libfcgi.so
 -- Found Doxygen: /usr/bin/doxygen (found version 1.8.1.2) 
 CMake Error: The following variables are used in this project, but they are 
 set to NOTFOUND.
 Please set them or make sure they are set and tested correctly in the CMake 
 files:
 PYTHON_LIBRARY
 linked by target python_module_qgis_analysis in directory 
 /«BUILDDIR»/qgis-1.7.4+1.7.5~20120320/python
 linked by target python_module_qgis_core in directory 
 /«BUILDDIR»/qgis-1.7.4+1.7.5~20120320/python
 linked by target python_module_qgis_gui in directory 
 /«BUILDDIR»/qgis-1.7.4+1.7.5~20120320/python
 linked by target qgispython in directory 
 /«BUILDDIR»/qgis-1.7.4+1.7.5~20120320/src/python
 linked by target pyspatialite in directory 
 /«BUILDDIR»/qgis-1.7.4+1.7.5~20120320/python/pyspatialite
 
 -- Configuring incomplete, errors occurred!
 make: *** [debian/build/CMakeCache.txt] Error 1

The full build log is available from:
   
http://aws-logs.debian.net/ftbfs-logs/2013/06/20/qgis_1.7.4+1.7.5~20120320-1.1_unstable.log

A list of current common problems and possible solutions is available at 
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

About the archive rebuild: The rebuild was done on EC2 VM instances from
Amazon Web Services, using a clean, minimal and up-to-date chroot. Every
failed build was retried once