Skip to content

Use hpack to generate cabal files when required #80

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions builder/comp-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, flags
, revision
, cabalFile
, cabal-generator
, patches ? []

, preUnpack ? null, postUnpack ? null
Expand Down Expand Up @@ -244,6 +245,10 @@ stdenv.mkDerivation ({
cat ${cabalFile} > ${package.identifier.name}.cabal
'';

postPatch = lib.optionalString (cabal-generator == "hpack") ''
hpack
'';

configurePhase = ''
runHook preConfigure
echo Configure flags:
Expand Down
3 changes: 2 additions & 1 deletion builder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{ flags
, package
, components
, cabal-generator

, name
, sha256
Expand Down Expand Up @@ -74,7 +75,7 @@ let
comp-builder = haskellLib.weakCallPackage pkgs ./comp-builder.nix { inherit ghc haskellLib nonReinstallablePkgs withPackage; };

buildComp = componentId: component: comp-builder {
inherit componentId component package name src flags setup cabalFile patches revision
inherit componentId component package name src flags setup cabalFile cabal-generator patches revision
preUnpack postUnpack preConfigure postConfigure
preBuild postBuild preCheck postCheck
preInstall postInstall preHaddock postHaddock
Expand Down