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

Re: Qtiplot, python support and bug #560852



* Guðjón Guðjónsson <gudjon.i.gudjonsson@gmail.com>, 2010-12-04, 13:44:
   Here is a question that I should know (and I think I know) the answer to
but I want to be sure :)
I am working on a new version of qtiplot and currently I hardcode python
version 2.6 for the python support.
$ ldd /usr/bin/qtiplot
...
       libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0xb725d000)
...

I would very much like not to hardcode the python version but I think the
python scripting part of the program needs to be rewritten as a shared
library in order to allow for many python versions. Is that correct?

I don't think there is any reasonable way to achieve what you wanted.

However, what you could (and should) do is to stop harcoding Python version in the source package, and always link qtiplot with the default-at-build-time version of Python. That will save you (and people who look after transitions[0]) busy work by the next Python transition.

The attached patch appears to do the trick.


[0] In fact, I did notice that qtiplot was linked to wrong version of Python shortly after python2.6 became the default version, but I somehow failed to file a bug report. Sorry about that.

--
Jakub Wilk
diff -Nru qtiplot-0.9.8.2/debian/patches/01_build_system.diff qtiplot-0.9.8.2/debian/patches/01_build_system.diff
--- qtiplot-0.9.8.2/debian/patches/01_build_system.diff	2010-12-04 13:15:19.000000000 +0100
+++ qtiplot-0.9.8.2/debian/patches/01_build_system.diff	2010-12-09 20:00:44.000000000 +0100
@@ -52,7 +52,7 @@
  
  ###############################################################
  ################# Default Modules #############################
-@@ -159,18 +160,18 @@
+@@ -159,7 +160,7 @@
    				    qtiUtil.py \
    				    qti_wordlist.txt \
  
@@ -61,20 +61,6 @@
    	win32: pythonconfig.path = $$INSTALLBASE
    	DEFINES += PYTHON_CONFIG_PATH="\\\"$$replace(pythonconfig.path," ","\ ")\\\"
    }
- 
-   unix {
-     isEmpty(PYTHON): PYTHON = python
--    INCLUDEPATH += $$system($$PYTHON python-includepath.py)
--    LIBS        += $$system($$PYTHON -c "\"from distutils import sysconfig; print '-lpython'+sysconfig.get_config_var('VERSION')\"")
-+    INCLUDEPATH += /usr/include/python2.6
-+    LIBS        += -lpython2.6
-     LIBS        += -lm
-     system(mkdir -p $${SIP_DIR})
--    system($$system($$PYTHON python-sipcmd.py) -c $${SIP_DIR} src/scripting/qti.sip)
-+    system($$system(python2.6 python-sipcmd.py) -c $${SIP_DIR} src/scripting/qti.sip)
-   }
- 
-   win32 {
 @@ -220,7 +221,7 @@
  !isEmpty(BOOST_LIBS) {
  	DEFINES += OPJ_IMPORT

Reply to: