|
From: Pete S. <pe...@vi...> - 2000-09-27 16:37:41
|
(note, i tried posting this last night, but no show.
here is my next attempt, sorry if this is your 2nd read)
I've got distutils working with for pysdl. I've mentioned that
i think using distutils is the way to go for pysdl. it handles
a ton tasks, yet currently is still poorly documented (2.02b
docs are barely improved, but wrong keyword arg names are fixed!)
anyways, this definitely needs to go up for testing and
discussion. i figured now with python 2.02b out people will
want to go and get their modules recompiled anyways.
ok, here's the area for controversy :]
the way this build works is to gather all the dependencies
(SDL, SDL_image, etc) into one directory. i've setup the
distutils to then compile the whole kit and kaboodle in
one shot. the result is a single shared object with all
dependent libraries built in.
the single shared object has a list of strong pros and
cons. i think it could be a good idea. with (nearly) nightly
releases of SDL coming out, pysdl can still be using the
version of pysdl it was meant to be using. of course, this
goes totally against the reason for shared libraries in the
first place. anyways. i'd like to see discussion on that. i'm
not sold either way, but this seems easiest for now, and it
might be worth sticking to?
anyways, right now it is setup to compile on win32 with MSVC.
distutils can handle a lot of compile environments. besides
mac and unix, on win32 it can use MSVC, borland's free compiler,
cygnus and mingw. it should take someone less than 5 minutes to
add linux info to my special 'config' files.
the way it works. unzip the attached archive. it will create
a directory named sdlbuild. you need to copy or extract the
source for all the pysdl dependecies (including pysdl) into
this directory. for example, my lovely win directory looks
like this...
-----------------------------------------------------------
C:\src\sdlbuild>dir
Volume in drive C is SYSTEM
Volume Serial Number is 3831-C38D
Directory of C:\src\sdlbuild
. <DIR> 09-14-00 9:04p .
.. <DIR> 09-14-00 9:04p ..
SETUP PY 1,301 09-27-00 1:32a setup.py
CONFIG PY 2,972 09-27-00 1:30a config.py
FREETYPE <DIR> 09-14-00 9:04p freetype
SDL-1 1 <DIR> 09-14-00 9:04p SDL-1.1
SDL_IM~1 10 <DIR> 09-14-00 9:04p SDL_image-1.0.10
SDL_MI~1 6 <DIR> 09-14-00 9:04p SDL_mixer-1.0.6
SDL_TT~1 2 <DIR> 09-14-00 9:04p SDL_ttf-1.2.2
SMPEG-~1 0 <DIR> 09-14-00 9:04p smpeg-0.4.0
PYSDL-~1 7 <DIR> 09-15-00 12:44a pysdl-0.0.7
CONFIG <DIR> 09-27-00 1:24a config
2 file(s) 4,273 bytes
10 dir(s) 320.33 MB free
-----------------------------------------------------------
if you've got win32&msvc you're ready to go, just issue the
standard distutils command
"python setup.py install"
this will verbosely compile all the needed source and
create a new "sdl.pyd" in your python directory.
if you're using a different setup. it is fairly straightforward
how it works. in the "config" directory is a small module for each
dependency. it contains several optional lists of compile info.
if you look at the ones in there, it is really self-explanatory.
a quick look at config/sdl.py should be all the docs you need
(hopefully??)
hopefully people can try this out and report results. if any
of you have distutil experience from the past, it could be of
great help right now.
what's nice about this setup is you can drop in a new
version of a library, and this setup will compile in the
highest versioned directory it finds for that library and
compile it in. no extra work like rearranging include paths.
on my cel-400, the compile takes about 4 minutes and creates
a 500kb sdl.pyd
if anyone wants to hear me pimp all the great features of
distutils again, i'll be glad :]
PS. and finally, it looks like python2.0b2 is binary
compatible with python2.0b1 (at least on my machine)
so you don't really have to go recompiling all your
extensions
|
|
From: Pete S. <pe...@sh...> - 2000-09-27 09:06:48
Attachments:
distutils_test.zip
|
I've got distutils working with for pysdl. I've mentioned that
i think using distutils is the way to go for pysdl. it handles
a ton tasks, yet currently is still poorly documented (2.02b
docs are barely improved, but wrong keyword arg names are fixed!)
anyways, this definitely needs to go up for testing and
discussion. i figured now with python 2.02b out people will
want to go and get their modules recompiled anyways.
ok, here's the area for controversy :]
the way this build works is to gather all the dependencies
(SDL, SDL_image, etc) into one directory. i've setup the
distutils to then compile the whole kit and kaboodle in
one shot. the result is a single shared object with all
dependent libraries built in.
the single shared object has a list of strong pros and
cons. i think it could be a good idea. with (nearly) nightly
releases of SDL coming out, pysdl can still be using the
version of pysdl it was meant to be using. of course, this
goes totally against the reason for shared libraries in the
first place. anyways. i'd like to see discussion on that. i'm
not sold either way, but this seems easiest for now, and it
might be worth sticking to?
anyways, right now it is setup to compile on win32 with MSVC.
distutils can handle a lot of compile environments. besides
mac and unix, on win32 it can use MSVC, borland's free compiler,
cygnus and mingw. it should take someone less than 5 minutes to
add linux info to my special 'config' files.
the way it works. unzip the attached archive. it will create
a directory named sdlbuild. you need to copy or extract the
source for all the pysdl dependecies (including pysdl) into
this directory. for example, my lovely win directory looks
like this...
-----------------------------------------------------------
C:\src\sdlbuild>dir
Volume in drive C is SYSTEM
Volume Serial Number is 3831-C38D
Directory of C:\src\sdlbuild
. <DIR> 09-14-00 9:04p .
.. <DIR> 09-14-00 9:04p ..
SETUP PY 1,301 09-27-00 1:32a setup.py
CONFIG PY 2,972 09-27-00 1:30a config.py
FREETYPE <DIR> 09-14-00 9:04p freetype
SDL-1 1 <DIR> 09-14-00 9:04p SDL-1.1
SDL_IM~1 10 <DIR> 09-14-00 9:04p SDL_image-1.0.10
SDL_MI~1 6 <DIR> 09-14-00 9:04p SDL_mixer-1.0.6
SDL_TT~1 2 <DIR> 09-14-00 9:04p SDL_ttf-1.2.2
SMPEG-~1 0 <DIR> 09-14-00 9:04p smpeg-0.4.0
PYSDL-~1 7 <DIR> 09-15-00 12:44a pysdl-0.0.7
CONFIG <DIR> 09-27-00 1:24a config
2 file(s) 4,273 bytes
10 dir(s) 320.33 MB free
-----------------------------------------------------------
if you've got win32&msvc you're ready to go, just issue the
standard distutils command
"python setup.py install"
this will verbosely compile all the needed source and
create a new "sdl.pyd" in your python directory.
if you're using a different setup. it is fairly straightforward
how it works. in the "config" directory is a small module for each
dependency. it contains several optional lists of compile info.
if you look at the ones in there, it is really self-explanatory.
a quick look at config/sdl.py should be all the docs you need
(hopefully??)
hopefully people can try this out and report results. if any
of you have distutil experience from the past, it could be of
great help right now.
what's nice about this setup is you can drop in a new
version of a library, and this setup will compile in the
highest versioned directory it finds for that library and
compile it in. no extra work like rearranging include paths.
on my cel-400, the compile takes about 4 minutes and creates
a 500kb sdl.pyd
if anyone wants to hear me pimp all the great features of
distutils again, i'll be glad :]
PS. and finally, it looks like python2.0b2 is binary
compatible with python2.0b1 (at least on my machine)
so you don't really have to go recompiling all your
extensions
|
|
From: Pete S. <pe...@vi...> - 2000-09-27 17:08:19
Attachments:
distutils_test.zip
|
blarg. here's the attachment! |
|
From: Pete S. <pe...@vi...> - 2000-09-28 00:50:38
|
ok, this has been rattling around my head all day. i've got to get some ideas out, or my head will bust. after chewing on the "single binary" idea, i've grown to dislike it. the main reason that it ties the compile process way to tightly to its dependencies. there's a better way. so i'm putting all that aside and have created a new, extremely simple distutil for pysdl that gets pysdl compiled and linked to its dependencies. it's pretty cool, and i'll release that here soon. in the meantime. if you haven't tried it before, getting all the pysdl dependencies compiled under WIN is a major chore. none of the packages compile 'out of the box', but need paths changed and flags altered to get each library happy. i've got a different compiling script almost done that compiles each library into its own .DLL and .LIB on windows. i'm just going to add a little optional glue between this build and what the pysdl distutil script can use. i think this is a great way to make everything work. it doesn't change things too much from how it is now, the whole process is just simpler and more streamlined how is the compiling scene under linux? i know it is a lot smoother, since that's where all the packages are originally meant to compile (plus linux is much more compiler friendly). it looks pretty easy to just do a "./configure;make install" or grab a 'devel' package. is there any room for improvement getting pysdl started from scratch? in any event i'll have distutils working really well with pysdl, and a cleaner compile pipeline for us WIN users before the week is out. |
|
From: Ray K. <rh...@ne...> - 2000-09-29 23:51:00
|
Pete Shinners wrote: > > after chewing on the "single binary" idea, i've grown > to dislike it. the main reason that it ties the compile > process way to tightly to its dependencies. there's a > better way. > > so i'm putting all that aside and have created a > new, extremely simple distutil for pysdl that gets > pysdl compiled and linked to its dependencies. > it's pretty cool, and i'll release that here soon. > > in the meantime. if you haven't tried it before, > getting all the pysdl dependencies compiled under WIN > is a major chore. none of the packages compile > 'out of the box', but need paths changed and flags > altered to get each library happy. i've got a different > compiling script almost done that compiles each library > into its own .DLL and .LIB on windows. i'm just going > to add a little optional glue between this build and > what the pysdl distutil script can use. I've got patches for most of those libs (jpeg, gif, zlib, and freetype) to allow a cross compile of a DLL from linux -> win32. The same patches will also work with Sam's new mingw32 win32 native package. Binaries of the .dll/.a files are at http://www.libsdl.org/Xmingw32 and I can make the patches available to anyone who wants them. I believe that mingw32 is going to become the "officially supported" SDL win32 compile environment, from what Sam's been saying on IRC. It should also not be too difficult to build a VC .lib file from the dll using a tool like implib. -Ray |