Skip to content

Commit

Permalink
Merge pull request #244 from digitallyinduced/ghcide
Browse files Browse the repository at this point in the history
Added integration for ghcide
  • Loading branch information
mpscholten authored Oct 16, 2020
2 parents 0cf3c37 + ba5be74 commit b1e786e
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 6 deletions.
2 changes: 1 addition & 1 deletion NixSupport/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let
}) {};

ghc = pkgs.haskell.packages.${compiler};
allHaskellPackages = ghc.ghcWithPackages (p: haskellDeps p);
allHaskellPackages = ghc.ghcWithPackages (p: builtins.concatLists [ (haskellDeps p) [p.haskell-language-server] ] );
allNativePackages = builtins.concatLists [ (otherDeps pkgs) [pkgs.postgresql] (if pkgs.stdenv.isDarwin then [pkgs.darwin.apple_sdk.frameworks.Cocoa] else []) ];
in
pkgs.stdenv.mkDerivation {
Expand Down
16 changes: 16 additions & 0 deletions NixSupport/haskell-packages/hslogger.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ mkDerivation, base, bytestring, containers, deepseq, HUnit
, network, network-bsd, old-locale, stdenv, time, unix
}:
mkDerivation {
pname = "hslogger";
version = "1.3.1.0";
sha256 = "0nyar9xcblx5jwks85y8f4jfy9k1h4ss6rvj4mdbiidrq3v688vz";
libraryHaskellDepends = [
base bytestring containers deepseq network network-bsd old-locale
time unix
];
testHaskellDepends = [ base HUnit ];
homepage = "https://github.com/hvr/hslogger/wiki";
description = "Versatile logging framework";
license = stdenv.lib.licenses.bsd3;
}
10 changes: 10 additions & 0 deletions NixSupport/haskell-packages/network-bsd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ mkDerivation, base, deepseq, network, stdenv }:
mkDerivation {
pname = "network-bsd";
version = "2.8.1.0";
sha256 = "0kid0811lv4x761fd5gv6lsc8p5j2bn41rfd366pjb642p562jfr";
libraryHaskellDepends = [ base deepseq network ];
homepage = "https://github.com/haskell/network-bsd";
description = "POSIX network database (<netdb.h>) API";
license = stdenv.lib.licenses.bsd3;
}
14 changes: 14 additions & 0 deletions NixSupport/haskell-packages/network.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDerivation, base, bytestring, deepseq, directory, hspec
, hspec-discover, HUnit, stdenv, unix
}:
mkDerivation {
pname = "network";
version = "3.0.0.1";
sha256 = "03f7gi3skz2ivack73wgn0zsppxwscl6j6xvwjal6i7y3rzajiam";
libraryHaskellDepends = [ base bytestring deepseq unix ];
testHaskellDepends = [ base bytestring directory hspec HUnit ];
testToolDepends = [ hspec-discover ];
homepage = "https://github.com/haskell/network";
description = "Low-level networking interface";
license = stdenv.lib.licenses.bsd3;
}
7 changes: 5 additions & 2 deletions NixSupport/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let
"tz"
"http2-client"
"typerep-map"
"hslogger"
];

doJailbreakPackages = [
Expand All @@ -14,13 +15,15 @@ let
"ihp"
"http-media"
"countable-inflections"
"haskell-language-server"
"hslogger"
];

dontHaddockPackages = [
];

nixPkgsRev = "da7ddd822e32aeebea00e97ab5aeca9758250a40";
nixPkgsSha256 = "0zbxbk4m72psbvd5p4qprcpiadndq1j2v517synijwp2vxc7cnv6";
nixPkgsRev = "07e5844fdf6fe99f41229d7392ce81cfe191bcfc";
nixPkgsSha256 = "0p2z6jidm4rlp2yjfl553q234swj1vxl8z0z8ra1hm61lfrlcmb9";

compiler = "ghc883";

Expand Down
2 changes: 1 addition & 1 deletion ihp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ mkDerivation {
cp exe/IHP/CLI/run-script $out/bin/run-script
mkdir -p $out/lib/IHP
cp -r lib/IHP/* $out/lib/IHP
cp -r lib/IHP/* lib/IHP/.hie-bios $out/lib/IHP
'';
}
1 change: 1 addition & 0 deletions lib/IHP/.hie-bios
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make print-ghc-options GHC_RTS_FLAGS='' | tr ' ' '\n' > "$HIE_BIOS_OUTPUT"
15 changes: 13 additions & 2 deletions lib/IHP/Makefile.dist
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@ GHC_EXTENSIONS+= -XDerivingVia
GHC_EXTENSIONS+= -Werror=missing-fields
GHC_EXTENSIONS+= -fwarn-incomplete-patterns

GHC_OPTIONS=-threaded -i. -ibuild -iConfig
GHC_RTS_FLAGS := -A256m -n2m

GHC_OPTIONS=-threaded -i. -ibuild -iConfig -iIHP
GHC_OPTIONS+= ${GHC_EXTENSIONS}
GHC_OPTIONS+= -j2
GHC_OPTIONS+= +RTS -A256m -n2m --RTS

ifneq ($(GHC_RTS_FLAGS),)
GHC_OPTIONS+= +RTS ${GHC_RTS_FLAGS} --RTS
endif

GHC_OPTIONS+= -package ihp
GHC_OPTIONS+= -rtsopts=all

Expand Down Expand Up @@ -171,3 +177,8 @@ build/Script/Main/%.hs: Application/Script/%.hs
echo "import qualified Config" >> $@
echo "import Application.Script.$* (run)" >> $@
echo "main = runScript run" >> $@

hie.yaml: # Configuration for haskell-language-server
echo "cradle:" > hie.yaml
echo " bios:" >> hie.yaml
echo " program: build/ihp-lib/.hie-bios" >> hie.yaml

0 comments on commit b1e786e

Please sign in to comment.