libffi's weird packaging

Ryan Schmidt ryandesign at macports.org
Mon Dec 28 04:58:30 PST 2015


On Dec 28, 2015, at 02:54, Mojca Miklavec wrote:
> 
> I wonder if there is any special reason for this weird packaging of
> libffi (the include files in particular; does it conflicts with other
> libraries?):
> 
> Port libffi contains:
>  /opt/local/lib/libffi-3.2.1/include/ffi.h
>  /opt/local/lib/libffi-3.2.1/include/ffitarget.h
>  /opt/local/lib/libffi.6.dylib
>  /opt/local/lib/libffi.a
>  /opt/local/lib/libffi.dylib
>  /opt/local/lib/libffi.la
>  /opt/local/lib/pkgconfig/libffi.pc
>  /opt/local/share/info/libffi.info
>  /opt/local/share/man/man3/ffi.3.gz
>  /opt/local/share/man/man3/ffi_call.3.gz
>  /opt/local/share/man/man3/ffi_prep_cif.3.gz
>  /opt/local/share/man/man3/ffi_prep_cif_var.3.gz

I don't know why it's done that way. I agree the location of the include files is odd. If that comes from libffi's build system, ask the developers why. If that comes from the portfile, use "svn blame" to find out who did it and ask them why. 


> When building moarvm which needs ffi.h and apparently doesn't care
> about "libffi.pc" yet, I had to add the following to the Portfile
> which looks like a relatively bad idea to me:
> 
>    configure.cflags-append "-I${prefix}/lib/libffi-3.2.1/include"
> 
> Can someone suggest me what to do (other than asking moarvm
> maintainers to fix the libffi detection and use)?

Look at some of the other portfiles that use libffi, which call pkg-config in a pre-configure block so as not to hardcore the path or version information in the portfile. Or, if you can, modify the build system to use pkg-config directly, then send the patch to the developers. 


More information about the macports-dev mailing list