-
Notifications
You must be signed in to change notification settings - Fork 248
Fix setup-depends dependencies #124
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7d83f19
Use setup-depends from nix-tools output
hamishmack 591cdfe
Use `-package ghc` when building Setup.hs
hamishmack fea0492
Include --package-db when building Setup
hamishmack 0031f30
Fix missing args resulting from rebase error
hamishmack 7f89e65
Use makeConfigFiles
hamishmack 87d7074
Suggestion: wire parts of the builder together in the same place
rvl 95f1ae7
Add missing lib arg
hamishmack 3872708
Use build GHC and packages for building setup
hamishmack 021e65a
Manual fix for nix-tools/pkgs.nix
hamishmack a1fd9de
Regenerate nix-tools
hamishmack b224850
Fix for tests on case insensitive FS (macOS)
hamishmack 2d2b4f9
Use patched version of Cabal to build nix-tools
hamishmack d4d57b4
Update nix-tools/default.nix
hamishmack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles }: | ||
|
||
{ setup-depends, package, name, src, flags }: | ||
|
||
let | ||
fullName = "${name}-setup"; | ||
|
||
includeGhcPackage = lib.any (p: p.identifier.name == "ghc") setup-depends; | ||
|
||
configFiles = makeSetupConfigFiles { | ||
inherit (package) identifier; | ||
inherit fullName flags; | ||
component = { | ||
depends = setup-depends; | ||
libs = []; | ||
frameworks = []; | ||
doExactConfig = false; | ||
}; | ||
}; | ||
|
||
in | ||
stdenv.lib.fix (drv: | ||
stdenv.mkDerivation { | ||
name = "${fullName}"; | ||
inherit src; | ||
nativeBuildInputs = [ghc]; | ||
|
||
CABAL_CONFIG = configFiles + /cabal.config; | ||
phases = ["unpackPhase" "buildPhase" "installPhase"]; | ||
buildPhase = '' | ||
for f in Setup.hs Setup.lhs; do | ||
if [ -f $f ]; then | ||
echo Compiling package $f | ||
ghc $f '' + (if includeGhcPackage then "-package ghc " else "") | ||
+ ''-package-db ${configFiles}/package.conf.d --make -o ./Setup | ||
setup=$(pwd)/Setup | ||
fi | ||
done | ||
[ -f ./Setup ] || (echo Failed to build Setup && exit 1) | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
install ./Setup $out/bin/Setup | ||
''; | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.