Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing library in specific location on Mac and using it later #10362

Open
ivanperez-keera opened this issue Sep 16, 2024 · 1 comment
Open

Comments

@ivanperez-keera
Copy link
Contributor

ivanperez-keera commented Sep 16, 2024

I'm interested in being able to call runhaskell exposing specific libraries, from any directory, and without having a cabal.project or package.env in the current directory. I can pass any arguments or environment variables I want to runhaskell, and I should place all files in a specific location (call it /myLibraryDir), not in the user's home.

What is the way of installing a library with Cabal so that all files and libraries are installed in under specific path, and can later be found?

I'm looking for the arguments to:

cabal <some_installation_command> <arguments> myLibrary

such that later I can run from any directory:

runhaskell <arguments> <<< 'import MyModule; main = putStrLn "Success"'

@geekosaur
Copy link
Collaborator

I believe the supported way to do this is not to use cabal at all, but the Setup.hs interface. However, what you're asking for will still be made difficult by ghc, which in the absence of cabal or stack will look in its global package db and an old-style user package db only; you would have to point ghc/ghci/runghc/etc. to any additional package db you used. (You must use a package db.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants