Open ivanperez-keera opened 1 week ago
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.)
I'm interested in being able to call
runhaskell
exposing specific libraries, from any directory, and without having acabal.project
orpackage.env
in the current directory. I can pass any arguments or environment variables I want torunhaskell
, 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"'