diff mbox series

[bug#46021] Acknowledgement ([PATCH]: gnu: ecl: Propagate some dependencies used in header files)

Message ID 86bldi8fid.fsf@163.com
State Accepted
Headers show
Series [bug#46021] Acknowledgement ([PATCH]: gnu: ecl: Propagate some dependencies used in header files) | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Zhu Zihao Jan. 21, 2021, 3:40 p.m. UTC

Comments

Zhu Zihao Jan. 29, 2021, 1:56 a.m. UTC | #1
ping.
Guillaume Le Vaillant Jan. 29, 2021, 8:49 a.m. UTC | #2
Zhu Zihao <all_but_last@163.com> skribis:

> ECL's header includes the header of gmp, libgc, libatomic-ops and
> libffi. This help fix some program use ecl as build input failed to link
> with it.

I tried a `guix environment -C --ad-hoc ecl -- ecl --eval '(compile-file "test.lisp")'`
and ECL compiled the file successfully, so it must have found the
headers it needed.

Could you give an example of build failure solved by your patch?
Zhu Zihao Jan. 29, 2021, 9:34 a.m. UTC | #3
Guillaume Le Vaillant writes:

> Zhu Zihao <all_but_last@163.com> skribis:
>
>> ECL's header includes the header of gmp, libgc, libatomic-ops and
>> libffi. This help fix some program use ecl as build input failed to link
>> with it.
>
> I tried a `guix environment -C --ad-hoc ecl -- ecl --eval '(compile-file "test.lisp")'`
> and ECL compiled the file successfully, so it must have found the
> headers it needed.

Because we already wrapped ECL executable with CPATH and LIBRARY_PATH
environment variable. so any compilation done in ECL can find the
library and header.

If some 3-rd party program want to link with ECL(If they use ECL as
thier extension language). Compiler will failed to find gmp, libgc etc.

A simple example here, start with `guix environment --ad-hoc ecl`

```
chino@asus-laptop:~/tmp$ cat test.c
#include <ecl/ecl.h>

int main() {
  cl_boot(0, NULL);
  return 0;
}
chino@asus-laptop:~/tmp$ CFLAGS="$(ecl-config --cflags) $(ecl-config --ldflags) $(ecl-config --libs)"
chino@asus-laptop:~/tmp$ LANG=en_US.utf-8 gcc -c test.c -o test $CFLAGS
In file included from /gnu/store/lzfxjn036h3kis13lcc222rpwcnqazkr-ecl-20.4.24/include/ecl/ecl.h:37,
                 from test.c:1:
/gnu/store/lzfxjn036h3kis13lcc222rpwcnqazkr-ecl-20.4.24/include/ecl/config.h:59:10: fatal error: gmp.h: No such file or directory
   59 | #include "gmp.h"
      |          ^~~~~~~
compilation terminated.
```
Guillaume Le Vaillant Feb. 2, 2021, 9:39 a.m. UTC | #4
Patch pushed as 90ad8bd1a63abbf94f2ebb9f10630773d1f15ece.
Thanks.
diff mbox series

Patch

From 191564b413e7e95e0e246935026392cd152464fe Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Thu, 21 Jan 2021 23:06:52 +0800
Subject: [PATCH] gnu: ecl: Propagate some dependencies used in header files.

* gnu/packages/lisp.scm(ecl)[inputs]: Remove.
[propagated-inputs]: Add gmp, libatomic-ops, libgc, libffi.
---
 gnu/packages/lisp.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 3c09b0af8a..fb4f7cb7bd 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -236,7 +236,7 @@  interface to the Tk widget system.")
      `(("cl-asdf" ,cl-asdf)
        ("which" ,which)
        ("texinfo" ,texinfo)))
-    (inputs
+    (propagated-inputs
      `(("gmp" ,gmp)
        ("libatomic-ops" ,libatomic-ops)
        ("libgc" ,libgc)
-- 
2.30.0