[racket] copy-shared-files and different platforms

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Aug 23 14:12:02 EDT 2014

The `copy-shared-files` declaration is for collection "info.rkt" files,
not for package "info.rkt" files. So, the one in the top-level
"info.rkt" of

 https://github.com/soegaard/racket-poppler

has no effect, since that's a multi-collection package (i.e., the
top-level "info.rkt" is a package "info.rkt" and not a collection
"info.rkt").


In a collection "info.rkt", whatever you list for `copy-shared-files`
is copied to the "lib" directory. So,

  (define copy-shared-files (list "poppler-libs"))

would mean that the "poppler-libs" directory will be copied there,
instead of individual ".dll" or ".dylib" files within that directory.
Since `ffi-lib` doesn't look in subdirectories of the library
directory, that won't be useful.


The "info.rkt" files within specific library directories look right,
such as this one:

https://github.com/soegaard/racket-poppler/blob/master/poppler-libs/poppler-win32-i386/racket-poppler/info.rkt

And those "info.rkt" files are also collection directories, so they
cause the listed libraries to be installed --- at least for the five
platforms represented in "poppler-libs".

The `install-platform` definitions in those "info.rkt" files mean that
only libraries for the current platform will be installed. It's
probably better for each directory within "poppler-libs" to be its own
package, so that an installation gets only the libraries for the
installation's platform, but the current way should work.

(For Unix variants, so far, we have been assuming that programmers will
install foreign libraries through the OS's package system.)


At Sat, 23 Aug 2014 18:21:26 +0200, Jens Axel Søgaard wrote:
> Hi All,
> 
> How exactly are copy-shared-files to be used?
> 
> I have a set of shared libraries for different platforms in:
> 
>   racket-poppler/poppler-libs/poppler-i386-macosx
>   racket-poppler/poppler-libs/poppler-win32-i386
>   etc.
> 
> My info file is here:
> 
> https://github.com/soegaard/racket-poppler/blob/master/info.rkt
> 
> I tried listing the folder poppler-libs, but it seems not to work.
> 
> /Jens Axel
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users


Posted on the users mailing list.