I want to create a Haskell Stack package that includes another Haskell Stack package as an extra-dep
. The problematic thing is that the package that i'm trying to include is a binding to some C code, using Haskell's FFI.
If I just stack unpack
and stack build
that package (HasCacBDD) it works just fine, but when I include it as an extra-dep
Stack complains about a missing library.
Looking at the Setup.hs
of that original package, I see that it basically creates an static library called libHasCacBDD.a
and puts it in the correct folder inside the .stack-work
path for it to be linked. This library is precisely the one that is giving me an error when I include it in my own project.
Looking carefully at the .stack-work
folder of my own project, I see that the mentioned libHasCacBDD.a
is indeed inside the directory hidden in some place. So fortunately, the library is being built correctly but my project cannot find it.
The official Haskell Stack documentation says something about what to do in that case, but I think it is not specific enough to give me a satisfactory answer.
What I need to do is to specify the path where the libHasCacBDD.a
library is being stored as a extra-lib-dirs
option. Nevertheless, I do not how to do that in a platform independent way (if i hardcode the path in my computer, it will just work in it and what's the point of doing a package in that case).
I created an issue on Github with more information about the particulars.
Any suggestions?