haskell.nix/test/extra-hackage/README.md
Maxim Koltsov 07031ee224
External hackages (#535)
* Add support for external Hackage repositories

Currently haskell.nix is not able to build Cabal projects that depend on
packages from private Hackage repositories, as it make only main Hackage
available to cabal. This is unfortunate.

This commit adds this functionality, by allowing the user to pass
`extra-hackages` and `extra-hackage-tarballs` to `mkPkgSet` and
`callCabalToNix` respectively, to add as much extra repositories as
needed.

This repositories are first made available to Cabal when calling
`v2-configure`, resulting in correct plans. Later they are combined with
global Hackage when building dependencies of the local packages.

* Use cabal.project.freeze if available

Currently callCabalProjectToNix does not copy `cabal.project.freeze`
from source directory, leading to different build plans when building
components with nix and when building project with `cabal new-build`
inside `nix-shell`.

This behavior is undesired, so this commits fixes it.

* Add tests for extra-hackages functionality

Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
2020-05-02 18:16:34 +08:00

595 B

Tests for extra Hackage functionality

This directory contains two packages, external-package-demo and external-package-user, the second one depends on the first one. Both packages were created with cabal init.

external-package-demo was uploaded to local Hackage at localhost and 01-index.tar.gz from that Hackage was downloaded to this directory. Then the index file was processed with hackage-to-nix, the result is in hackage/ directory.

The tests check that cabalProject' is able to construct plan with dependencies from extra Hackage and then build the package itself.