Subject: pkg/24288: misc/koffice won't compile with python23-pth on a system, which has python23 installed
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <dotz@irc.pl>
List: netbsd-bugs
Date: 02/01/2004 13:42:01
>Number:         24288
>Category:       pkg
>Synopsis:       misc/koffice won't compile with python23-pth on a system, which has python23 installed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 01 13:43:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michal Pasternak
>Release:        N/A
>Organization:
>Environment:
N/A
>Description:
If you build misc/koffice on a system, which has both python23 and 
python23-pth, but you declared python23-pth as the preferred version in 
/etc/mk.conf, the build will fail.

Problem:
========

Even if I want to use python23-pth, configure script of koffice is 
incompatible. 

"23pth" version gets buildlinked, okay. But then, config.log has entries 
like:

    configure:32278: checking for Python2.3                                         
    configure: 32288: /usr/pkg/include/Python.h                                     
    configure: 32288: /usr/include/Python.h                                         
    configure: 32288: /usr/local/include//Python.h                                  
    configure: 32288: /usr/pkg/include/Python.h                                     
    configure: 32288: /usr/X11R6/include/Python.h                                   
    configure: 32304: /usr/pkg/include/python2.3/Python.h                           
    taking that   

It will take "python2.3" directory, just because it exists.

Then, the build will fail at:

Making all in kiviosdk
gmake[4]: Entering directory `/usr/build/builds/misc/koffice/work.mainframe/koffice-1.3/kivio/kiviopart/kiviosdk'
source='kivio_wrap.cpp' object='kivio_wrap.lo' libtool=yes \
depfile='.deps/kivio_wrap.Plo' tmpdepfile='.deps/kivio_wrap.TPlo' \
depmode=gcc /bin/sh ../../../admin/depcomp \
/bin/sh ../../../libtool --silent --mode=compile --tag=CXX c++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../kivio/kiviopart -I../../../lib/kofficeui -I../../../lib/kofficeui -I../../../lib/kofficecore -I../../../lib/kofficecore -I../../../lib/store -I../../../lib/store -I../../../lib/kwmf -I../../../lib/kwmf -I../../../lib/kopainter -I../../../lib/kopainter -I../../../lib/kotext -I../../../lib/kotext -I/usr/pkg/include -I/usr/pkg/qt3/include -I/usr/X11R6/include  -I/usr/pkg/include -I/usr/X11R6/include -I/usr/pkg/include/python2.3  -D_THREAD_SAFE -pthread -DQT_THREAD_SUPPORT  -I/usr/pkg/include/freetype2  -I/usr/pkg/include -I/usr/X11R6/include -D_THREAD_SAFE   -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -O2 -I/usr/pkg/include -I/usr/X11R6/include -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -c -o kivio_wrap.lo `test -f 'kivio_w
 rap.cpp' || echo './'`kivio_wrap.cpp
In file included from /usr/include/string.h:50,
                 from kivio_wrap.cpp:37:
/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
kivio_wrap.cpp:43: Python.h: No such file or directory
gmake[4]: *** [kivio_wrap.lo] Błąd 1
>How-To-Repeat:
1) Install python23 and python23-pth on your system.

2) Set python23-pth as default in /etc/mk.conf:

    PYTHON_VERSION_DEFAULT=23pth

3) Try to compile misc/koffice. It will fail.
>Fix:
There are a few ways we can fix it.

I thought about:

  patching configure script so it will take 2 extra arguments (or 2 
  extra env variables) with the exact location of Python include and lib
  directory (together with shared library name)

  pkgsrc Makefile would pass such information to it.

But, that would take me some time, and I'd like to see koffice right 
now. So, the 2nd method is:
   
  disable 23pth unconditionally in Makefile.

Which, well, also worked for me :)
>Release-Note:
>Audit-Trail:
>Unformatted: