I am trying to tweak the python package to get support for xml - it requires
expat. I thought I had a clever (for my first openpkg patch) solution to
pick up libraries from the openpkg installation but I think I am now butting
my head against the static library policy - how do you get binary extensions
to scripting languages without shared libraries? Any thoughts? This may be a
show stopper for me. Here are the errors that occur while building python on
solaris (7 and 9):

building 'pyexpat' extension
/.d1/openpkg/RPM/TMP/Python-2.2.2/Modules/pyexpat.c: In function
`get_version_string':
/.d1/openpkg/RPM/TMP/Python-2.2.2/Modules/pyexpat.c:1556: warning: subscript
has type `char'
/opt/openpkg/bin/cc -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fPIC
-DHAVE_EXPAT_H=1 -I. -I/.d1/openpkg/RPM/TMP/Python-2.2.2/./Include
-I/opt/openpkg/include -I/.d1/openpkg/RPM/TMP/Python-2.2.2/Include
-I/.d1/openpkg/RPM/TMP/Python-2.2.2 -c
/.d1/openpkg/RPM/TMP/Python-2.2.2/Modules/pyexpat.c -o
build/temp.solaris-2.9-sun4u-2.2/pyexpat.o
/opt/openpkg/bin/cc -shared build/temp.solaris-2.9-sun4u-2.2/pyexpat.o
-L/opt/openpkg/lib -lexpat -o build/lib.solaris-2.9-sun4u-2.2/pyexpat.so
WARNING: removing "pyexpat" since importing it failed

Or without binutils:

building 'pyexpat' extension
/opt/openpkg/RPM/TMP/Python-2.2.2/Modules/pyexpat.c: In function
`get_version_string':
/opt/openpkg/RPM/TMP/Python-2.2.2/Modules/pyexpat.c:1556: warning: subscript
has type `char'
Text relocation remains                         referenced
    against symbol                  offset      in file
<unknown>                           0x1f14
/opt/openpkg/lib/libexpat.a(xmlparse.o)
<unknown>                           0x1f18
/opt/openpkg/lib/libexpat.a(xmlparse.o)
<unknown>                           0x1f1c
/opt/openpkg/lib/libexpat.a(xmlparse.o)
<unknown>                           0x1f20
/opt/openpkg/lib/libexpat.a(xmlparse.o)
...
<unknown>                           0x1928
/opt/openpkg/lib/libexpat.a(xmlrole.o)
<unknown>                           0x1934
/opt/openpkg/lib/libexpat.a(xmlrole.o)
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
/opt/openpkg/bin/cc -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fPIC
-DHAVE_EXPAT_H=1 -I. -I/opt/openpkg/RPM/TMP/Python-2.2.2/./Include
-I/opt/openpkg/include -I/opt/openpkg/RPM/TMP/Python-2.2.2/Include
-I/opt/openpkg/RPM/TMP/Python-2.2.2 -c
/opt/openpkg/RPM/TMP/Python-2.2.2/Modules/pyexpat.c -o
build/temp.solaris-2.7-sun4u-2.2/pyexpat.o
/opt/openpkg/bin/cc -shared build/temp.solaris-2.7-sun4u-2.2/pyexpat.o
-L/opt/openpkg/lib -lexpat -o build/lib.solaris-2.7-sun4u-2.2/pyexpat.so
WARNING: building of extension "pyexpat" failed: command
'/opt/openpkg/bin/cc' failed with exit status 1

Oh yes - here is my patch for python 2.2.2:

python$ diff -u python.spec*
--- python.spec Fri Feb  7 16:01:46 2003
+++ python.spec~        Fri Feb  7 09:25:09 2003
@@ -33,10 +33,7 @@
 Group:        Language
 License:      GPL
 Version:      2.2.2
-Release:      lion.1
-
-#   package options
-%option       with_expat  yes
+Release:      1.2.0

 #   list of sources
 Source0:
ftp://ftp.python.org/pub/python/%{version}/Python-%{version}.tgz
@@ -45,9 +42,6 @@
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 1.2.0, gcc
-%if "%{with_expat}" == "yes"
-BuildPreReq:  expat
-%endif
 PreReq:       OpenPKG, openpkg >= 1.2.0
 AutoReq:      no
 AutoReqProv:  no
@@ -65,7 +59,6 @@
 %prep
     %setup -q -n Python-%{version}
     %{l_shtool} subst -e 's;-O3;-O2;g' configure
-    %{l_shtool} subst -e "s;/usr/local;%{l_prefix};g" setup.py

 %build
     CC="%{l_cc}" \


Martin

----
Martin Andrews
[EMAIL PROTECTED] 
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
User Communication List                      [EMAIL PROTECTED]

Reply via email to