Cabal build dependency using a git repo

I have a library which isn't on Hackage that I would like to use as a build dependency in another project. In Rubygems you can provide a git repository in the absence of an actual Rubygems repository. Does Cabal support something like that? I would like to specify that a particular build depend can be fetched from a given git repository rather than from Hackage and have Cabal fetch it when installing the build dependencies. I'm guessing that it's not possible because I don't see a mention of this feature anywhere. If it's not possible, how do people typically handle this problem? Git submodules?

Michael Baker
I have a library which isn't on Hackage that I would like to use as a build dependency in another project. In Rubygems you can provide a git repository in the absence of an actual Rubygems repository.
Use a git submodule (or place the source code to the package anywhere on your file system) then use `cabal sandbox add-source <path>`. Provided of course that you're using cabal sandboxes. -- Peter Jones, Founder, Devalot.com Defending the honor of good code

On Mon, Dec 9, 2013 at 3:45 PM, Peter Jones
Michael Baker
writes: I have a library which isn't on Hackage that I would like to use as a
build
dependency in another project. In Rubygems you can provide a git repository in the absence of an actual Rubygems repository.
Use a git submodule (or place the source code to the package anywhere on your file system) then use `cabal sandbox add-source <path>`. Provided of course that you're using cabal sandboxes.
What is commonly done if you aren't using sandboxes? I would rather not use them in an effort to make installing this project easier on my users, because the current Haskell Platform doesn't have sandboxes yet.

On 09/12/13 23:02, Michael Baker wrote:
On Mon, Dec 9, 2013 at 3:45 PM, Peter Jones
wrote: Michael Baker
writes: I have a library which isn't on Hackage that I would like to use as a
build
dependency in another project. In Rubygems you can provide a git repository in the absence of an actual Rubygems repository.
Use a git submodule (or place the source code to the package anywhere on your file system) then use `cabal sandbox add-source <path>`. Provided of course that you're using cabal sandboxes.
What is commonly done if you aren't using sandboxes? I would rather not use them in an effort to make installing this project easier on my users, because the current Haskell Platform doesn't have sandboxes yet.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
Sandboxes are for development. If you really want to make it easy for your users, publish your other package to Hackage. If that's not an option, perhaps require them to install the other package manually first? Maybe provide a script which fetches sources and cabal installs. -- Mateusz K.

Michael Baker
On Mon, Dec 9, 2013 at 3:45 PM, Peter Jones
wrote: Michael Baker
writes: I have a library which isn't on Hackage that I would like to use as a
build
dependency in another project. In Rubygems you can provide a git repository in the absence of an actual Rubygems repository.
Use a git submodule (or place the source code to the package anywhere on your file system) then use `cabal sandbox add-source <path>`. Provided of course that you're using cabal sandboxes.
What is commonly done if you aren't using sandboxes? I would rather not use them in an effort to make installing this project easier on my users, because the current Haskell Platform doesn't have sandboxes yet.
I believe it's possible to run your own installation of the Hackage server or at least host packages on a web server under a specific directory structure. You can then configure cabal to fetch packages from your private Hackage mirror. Then you just host your private packages and any necessary public packages. More details: http://comonad.com/reader/2012/hackage-mirror/ -- Peter Jones, Founder, Devalot.com Defending the honor of good code

Ok, I'll try that. Thanks.
On Tue, Dec 10, 2013 at 9:44 AM, Peter Jones
Michael Baker
writes: On Mon, Dec 9, 2013 at 3:45 PM, Peter Jones
wrote: Michael Baker
writes: I have a library which isn't on Hackage that I would like to use as a
build
dependency in another project. In Rubygems you can provide a git repository in the absence of an actual Rubygems repository.
Use a git submodule (or place the source code to the package anywhere on your file system) then use `cabal sandbox add-source <path>`. Provided of course that you're using cabal sandboxes.
What is commonly done if you aren't using sandboxes? I would rather not use them in an effort to make installing this project easier on my users, because the current Haskell Platform doesn't have sandboxes yet.
I believe it's possible to run your own installation of the Hackage server or at least host packages on a web server under a specific directory structure. You can then configure cabal to fetch packages from your private Hackage mirror. Then you just host your private packages and any necessary public packages. More details:
http://comonad.com/reader/2012/hackage-mirror/
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

I honestly recommend a sandbox. That is exactly the scenario they are used in,
and there is no effect on your users since it’s just a local development concern.
On Dec 10, 2013, at 10:55 AM, Michael Baker
Ok, I'll try that. Thanks.
On Tue, Dec 10, 2013 at 9:44 AM, Peter Jones
wrote: Michael Baker writes: On Mon, Dec 9, 2013 at 3:45 PM, Peter Jones
wrote: Michael Baker
writes: I have a library which isn't on Hackage that I would like to use as a
build
dependency in another project. In Rubygems you can provide a git repository in the absence of an actual Rubygems repository.
Use a git submodule (or place the source code to the package anywhere on your file system) then use `cabal sandbox add-source <path>`. Provided of course that you're using cabal sandboxes.
What is commonly done if you aren't using sandboxes? I would rather not use them in an effort to make installing this project easier on my users, because the current Haskell Platform doesn't have sandboxes yet.
I believe it's possible to run your own installation of the Hackage server or at least host packages on a web server under a specific directory structure. You can then configure cabal to fetch packages from your private Hackage mirror. Then you just host your private packages and any necessary public packages. More details:
http://comonad.com/reader/2012/hackage-mirror/
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (4)
-
Jack Henahan
-
Mateusz Kowalczyk
-
Michael Baker
-
Peter Jones