Discussion:
[ab] lispbuilder-sdl on Mac with OpenMCL
Frank Buss
2006-02-05 07:53:12 UTC
Permalink
Now it works on Mac, too, with OpenMCL 1.0:

Loading Image...

The trick was to start the Cocoa REPL first with (require "cocoa"). Then,
after loading CFFI, the SDL library has to be loaded with this line:

(cffi:load-foreign-library "/Library/Frameworks/SDL.framework/SDL")

ASDF is included in OpenMCL and can be loaded with (load
"/path-to-OpenMCL/tools/asdf.lisp")

The mouse-painter program doesn't work, because the program doesn't receive
the mouse events. I think this could be a problem with mixed Carbon/Cocoa
event handling.
--
Frank Buss, fb at frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Justin Heyes-Jones
2006-02-05 15:17:00 UTC
Permalink
Post by Frank Buss
http://www.frank-buss.de/tmp/lispbuilder-sdl-mac.png
The trick was to start the Cocoa REPL first with (require "cocoa"). Then,
(cffi:load-foreign-library "/Library/Frameworks/SDL.framework/SDL")
I was wondering about this... the user has to go in and edit the library
loading format depending on the lisp implementation and where they put the
library. Perhaps we could use the +Lispworks and other feature conditionals
to tidy that up so it works unchanged, or provide the user with a function
or special variable they must provide which becomes the parameter to
load-foreign-library

BTW I added close-foreign-library to the util.lisp file.

ASDF is included in OpenMCL and can be loaded with (load
Post by Frank Buss
"/path-to-OpenMCL/tools/asdf.lisp")
The mouse-painter program doesn't work, because the program doesn't receive
the mouse events. I think this could be a problem with mixed Carbon/Cocoa
event handling.
I can't help you with that as I've no Mac knowledge. I hope it's fixable.


Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lispniks.com/pipermail/application-builder/attachments/20060205/324ce02b/attachment.html
Frank Buss
2006-02-05 19:23:58 UTC
Permalink
Post by Justin Heyes-Jones
I was wondering about this... the user has to go in and edit the
library loading format depending on the lisp implementation and
where they put the library.
For developer computers the libraries could be installed in default
directories, then the packages should work without manual editing the files,
but it should be possible to override the directory, e.g.:

1. probe-file for a file specified in the variable *sdl-library*
2. check, if the sdl library can be loaded without a directory
3. probe-file for sdl library in default directories, like
/usr/lib/libSDL.so and /Library/Frameworks/SDL.framework/SDL

In *sdl-library* the full name of the library could be provided, like
"/mydirectory/libSDL.so" on Linux. For the other tests, all 3 platforms
could be tested: on Mac the name of the library is always in a directory
called SDL.framework (but this directory can be in current directory) and
the library name itself is SDL, on Windows the name is sdl.dll and it will
be found even if it is not in the same directory, e.g. if it is in
c:\windows (this means the 2nd test needs to be written like (ignore-errors
(load-foreign-library ...))) and on Linux the library name is always
libSDL.so.

With this concept we don't need to test for different Lisp implementations
or operating systems and it simply works on every current and future Lisp
implementation and operating system.
--
Frank Buss, fb at frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Justin Heyes-Jones
2006-02-06 02:51:11 UTC
Permalink
Post by Frank Buss
Post by Justin Heyes-Jones
I was wondering about this... the user has to go in and edit the
library loading format depending on the lisp implementation and
where they put the library.
For developer computers the libraries could be installed in default
directories, then the packages should work without manual editing the files,
1. probe-file for a file specified in the variable *sdl-library*
2. check, if the sdl library can be loaded without a directory
3. probe-file for sdl library in default directories, like
/usr/lib/libSDL.so and /Library/Frameworks/SDL.framework/SDL
In *sdl-library* the full name of the library could be provided, like
"/mydirectory/libSDL.so" on Linux. For the other tests, all 3 platforms
could be tested: on Mac the name of the library is always in a directory
called SDL.framework (but this directory can be in current directory) and
the library name itself is SDL, on Windows the name is sdl.dll and it will
be found even if it is not in the same directory, e.g. if it is in
c:\windows (this means the 2nd test needs to be written like
(ignore-errors
(load-foreign-library ...))) and on Linux the library name is always
libSDL.so.
With this concept we don't need to test for different Lisp implementations
or operating systems and it simply works on every current and future Lisp
implementation and operating system.
Sounds good,

Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lispniks.com/pipermail/application-builder/attachments/20060205/d64b8e6b/attachment.html
Loading...