Make it possible to directly link a haskell library with an external static C library(.a).
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Since it's not possible, https://github.com/jakubfijalkowski/hlibsass#static-shared-or-external-version-of-libsass says
> By default, hLibsass uses a local (built during cabal configure), static version of libsass. This is the recommended approach, as it ensures that the package uses compatible version of the library. However, this implies that the libsass.a file will be copied to the installation directory of the package (probably to a sandbox, so this should not be a problem) and GHCi won't work neither for this package nor any other that depends on hLibsass (it will either segfault or complain about unresolved symbols).
>
> hLibsass may be configured to use a shared version of LibSass. Just specify the sharedLibsass flag during configure/install and hLibsass will build the shared version. This will build a .so (or .a + .dll) file that will be copied to the installation directory and allow GHCi to work properly (except on Windows - but that's because of an import library that hLibsass needs to link against). This may require adjusting LD_LIBRARY_PATH (it should work without this, but I was unable to make it work all the time). You may use tools/libpath.sh to extract correct path from ghc-pkg.
>
> hLibsass may use LibSass version installed in the system - specify externalLibsass flag and the build process will not build local version of LibSass and just relay on the existing one.
This issue is also related to https://github.com/jakubfijalkowski/hlibsass/issues/4
If a haskell binding to a C/C++ library is directly linked with a static library, we can avoid this issue.
Contributor guide
Assessment
This issue has not been assessed yet.