On 2013-09-07 14:39, Marcus von Appen wrote: 

> On, Sat Sep 07, 2013, Rusty Nejdl wrote:
> 
> [...]
> 
>> [tethys]:/home/rnejdl/Downloads/apsw/apsw-3.8.0.2-r1> python setup.py build 
>> running build running build_ext SQLite: Using system sqlite 
>> include/libraries building 'apsw' extension creating build creating 
>> build/temp.freebsd-9.2-PRERELEASE-amd64-2.7 creating 
>> build/temp.freebsd-9.2-PRERELEASE-amd64-2.7/src cc -fno-strict-aliasing -O2 
>> -pipe -fno-strict-aliasing -march=nocona -DNDEBUG -O2 -pipe 
>> -fno-strict-aliasing -march=nocona -fPIC -DEXPERIMENTAL=1 -DNDEBUG=1 
>> -DAPSW_FORK_CHECKER=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -Isrc 
>> -I/usr/local/include/python2.7 -c src/apsw.c -o 
>> build/temp.freebsd-9.2-PRERELEASE-amd64-2.7/src/apsw.o src/apsw.c:58:21: 
>> error: sqlite3.h: No such file or directory src/apsw.c:62:2: error: #error 
>> Your SQLite version is too old. It must be at least 3.8.0 In file included 
>> from src/apsw.c:128: src/exceptions.c:24: error: expected declaration 
>> specifiers or '...' before 'sqlite3' How do I get setup.py to find sqlite3.h 
>> at /usr/local/include/sqlite3.h ?
> 
> By passing in the correct CFLAGS. By default C extensions to Python just
> include the relevant Python CFLAGS. Since you need the sqlite headers,
> which are located in /usr/local/include, execute the following (bourne
> shell):
> 
> # CFLAGS=-I/usr/local/include python setup.py build
> 
> And since I guess that apsw links to libsqlite3, also pass the
> LDFLAGS=-L/usr/local/lib:
> 
> # CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib python setup.py build
> 
> For your port Makefile that'd mean that you should set
> 
> CFLAGS+= -I${LOCALBASE}/include
> LDFLAGS+= -L${LOCALBASE}/lib
> 
> Cheers
> Marcus

Marcus, 

Nicely done and that fixed it so it compiles now. Now, the last part I
am stuck on is that the package has an underscore in it: 

Writing
/usr/local/lib/python2.7/site-packages/apsw-3.8.0.2_r1-py2.7.egg-info

which kills me on deinstall: 

On 2013-09-07 14:39, Marcus von Appen wrote: 

> On, Sat Sep 07, 2013, Rusty Nejdl wrote:
> 
> [...]
> 
>> [tethys]:/home/rnejdl/Downloads/apsw/apsw-3.8.0.2-r1> python setup.py build 
>> running build running build_ext SQLite: Using system sqlite 
>> include/libraries building 'apsw' extension creating build creating 
>> build/temp.freebsd-9.2-PRERELEASE-amd64-2.7 creating 
>> build/temp.freebsd-9.2-PRERELEASE-amd64-2.7/src cc -fno-strict-aliasing -O2 
>> -pipe -fno-strict-aliasing -march=nocona -DNDEBUG -O2 -pipe 
>> -fno-strict-aliasing -march=nocona -fPIC -DEXPERIMENTAL=1 -DNDEBUG=1 
>> -DAPSW_FORK_CHECKER=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -Isrc 
>> -I/usr/local/include/python2.7 -c src/apsw.c -o 
>> build/temp.freebsd-9.2-PRERELEASE-amd64-2.7/src/apsw.o src/apsw.c:58:21: 
>> error: sqlite3.h: No such file or directory src/apsw.c:62:2: error: #error 
>> Your SQLite version is too old. It must be at least 3.8.0 In file included 
>> from src/apsw.c:128: src/exceptions.c:24: error: expected declaration 
>> specifiers or '...' before 'sqlite3' How do I get setup.py to find sqlite3.h 
>> at /usr/local/include/sqlite3.h ?
> 
> By passing in the correct CFLAGS. By default C extensions to Python just
> include the relevant Python CFLAGS. Since you need the sqlite headers,
> which are located in /usr/local/include, execute the following (bourne
> shell):
> 
> # CFLAGS=-I/usr/local/include python setup.py build
> 
> And since I guess that apsw links to libsqlite3, also pass the
> LDFLAGS=-L/usr/local/lib:
> 
> # CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib python setup.py build
> 
> For your port Makefile that'd mean that you should set
> 
> CFLAGS+= -I${LOCALBASE}/include
> LDFLAGS+= -L${LOCALBASE}/lib
> 
> Cheers
> Marcus

Marcus, 

Nicely done and that fixed it so it compiles now. Now, the last part I
am stuck on is that the package has an underscore in it: 

Writing
/usr/local/lib/python2.7/site-packages/apsw-3.8.0.2_r1-py2.7.egg-info

which kills me on deinstall:

pkg_delete: file
'/usr/local/lib/python2.7/site-packages/apsw-3.8.0.2-py2.7.egg-info'
doesn't exist

On other ports I've always had to create a pkg-plist but the python
infrastructure seems to handle all of that automatically. I've looked
around and can't find how to work around this. 

Thanks in advance yet again!
Rusty Nejdl 
 
_______________________________________________
freebsd-python@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"

Reply via email to