[racket] FFI and @rpath dependencies

From: Philipp Dikmann (philipp at dikmann.de)
Date: Mon Nov 18 14:30:50 EST 2013

Dear Racket-Users,

while using ffi-lib to invoke the SDL2 and SDL2_mixer libraries (on Mac 
OS X 10.6.8), I came across a peculiar problem:
the latter requires the former and does so by depending on its location 
at "@rpath/SDL2.framework/Versions/A/SDL2".
In the context of Racket, @rpath appears to always resolve to 
"/Library/Frameworks".

This is fine for development but breaks in deployment (raco distribute): 
Although I can include & refer to the libraries in the application 
bundle using define-runtime-path, SDL2_mixer will continue to look for 
SDL2 in "/Library/Frameworks" because @rpath keeps pointing there.

I was wondering if there is a way to amend/change the directory of 
@rpath in the context of a Racket program, or wether I'm missing a 
critical point regarding the use of define-runtime-path. Or wether I'm 
stuck with fixing the libraries manually.

Thanks for your time & best regards,
Philipp

Posted on the users mailing list.