[Nix-dev] patches to add mkcl and fix ecl
Tomas Hlavaty
tom at logand.com
Sat Mar 28 02:06:05 CET 2015
Hi Michael,
attached is a patch which fixes ecl, using the gmp and libffi supplied
by nix, preserving the dffi ecl feature.
Michael Raskin <7c6f434c at mail.ru> writes:
>>>>2) to fix ecl, another common lisp implementation
>>>
>>> I think adding a wrapper that sets NIX_CFLAGS_COMPILE and
>>> NIX_CFLAGS_LINK is a better last-ditch solution than just forbidding
>>> libffi (I don't remember if ECL has an option to just add generic
>>> cflags).
>>
>>Could you please give me more clue, or better point me at an example,
>>how to write this? My nix skills are not up for that just yet.
>
> Look at bittornado expression, for example, it sets PYTHONPATH for use
> at runtime.
>
> For ECL we need to set NIX_CFLAGS_COMPILE, I guess. Any flags in
> NIX_CFLAGS_COMPILE are treated by NixPkgs gcc as if passed to gcc
> directly. There are also NIX_LDFLAGS.
>
>>If we want to use libffi, then it needs to be in propagateBuildInputs.
>
> Good catch.
>
>>Ecl invokes gcc at runtime, to compile lisp files. At this point,
>>libffi needs to be passed as gcc arg -I${libffi}/lib, which is not
>>happening at the moment, and I haven't found a way how to do this.
>>
>>So unless this runtime gcc invocation works (with or without) libffi,
>>ecl is not usable.
I tried a few things as you suggested but without success. E.g.
NIX_CFLAGS_COMPILE = [ "-I${libffi}/include" ];
NIX_LDFLAGS = [ "-L${libffi}/lib" ];
or
wrapProgram $out/bin/ecl \
--prefix NIX_CFLAGS_COMPILE ' ' "-I${libffi}/include" \
--prefix NIX_LDFLAGS ' ' "-L${libffi}/lib"
but that did not work. I think it makes sense, because it is ecl which
creates the gcc arguments, not nix.
The attached patch adds with-libffi-prefix to configure.ac (similar to
the existing with-gmp-prefix) and re-runs autoconf.
Thank you for your help!
Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ensure-that-gmp-and-libffi-are-found-when-compiling-.patch
Type: text/x-patch
Size: 3179 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150328/f1d3fe8f/attachment.bin
More information about the nix-dev
mailing list