haskell / haskell/cabal

Add support for foreign-library to v2-install

Open
#6,046 1 comment 1 reaction 1 assignee Claimed by @typedrat View on GitHub
cabal-install: cmd/install cabal-install: v2-build system type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

`cabal v2-install .` does install foreign libraries (`foreign-library`) into the store but doesn't symlink/copy them into `~/.cabal/lib` directory.

[3.3.2.8.Foreign libraries, Cabal User's Guide](https://www.haskell.org/cabal/users-guide/developing-packages.html#foreign-libraries) says

> ... we install foreign libraries in `~/.cabal/lib`, much like we install executables in `~/.cabal/bin`.

but it only applies to `v1-install`.

I'd like to `v2-install` foreign libraries, not just `v2-build`, because the former embeds proper rpaths that refer to `~/.cabal/store/`, whereas the latter leaves references to `dist-newstyle/`.

Currently I'm doing something like:

```
find ~/.cabal/store -name 'libmyforeignlib.so' -exec ls -t {} + |
head -n1 |
xargs cp -t /path/to/lib/
```

but I'd like to be able to do something like this instead:

```
cabal v2-install --installdir-lib=/path/to/lib/ .
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.