Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Trinkle committed Oct 24, 2016
1 parent 2355693 commit 1cd0740
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkgs/development/compilers/ghcjs/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ mkDerivation
, haskellPackages
, test-framework
, test-framework-hunit
, test-framework-quickcheck2
Expand Down Expand Up @@ -49,10 +50,12 @@
src = ghcjsBootSrc;
}
, shims ? import ./shims.nix { inherit fetchFromGitHub; }

, ghcLibdir ? null
}:
let
inherit (bootPkgs) ghc;
version = "0.2.0";
version = "0.2.1";

in mkDerivation (rec {
pname = "ghcjs";
Expand Down Expand Up @@ -126,6 +129,7 @@ in mkDerivation (rec {
--with-cabal ${cabal-install}/bin/cabal \
--with-gmp-includes ${gmp.dev}/include \
--with-gmp-libraries ${gmp.out}/lib
${if ghcLibdir == null then "" else ''echo "${ghcLibdir}" >$out/lib/ghcjs-${version}/ghc_libdir''}
'';
passthru = let
ghcjsNodePkgs = pkgs.nodePackages.override {
Expand All @@ -138,6 +142,7 @@ in mkDerivation (rec {
isGhcjs = true;
inherit nodejs ghcjsBoot;
inherit (ghcjsNodePkgs) "socket.io";
ghcPackages = haskellPackages;

# This is the list of the Stage 1 packages that are built into a booted ghcjs installation
# It can be generated with the command:
Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/haskell-modules/with-packages-wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, ignoreCollisions ? false, withLLVM ? false
, postBuild ? ""
, haskellPackages
, ghcLibdir ? null
}:

# This wrapper works only with GHC 6.12 or later.
Expand Down Expand Up @@ -44,11 +45,19 @@ let
llvm = lib.makeBinPath
([ llvmPackages.llvm ]
++ lib.optional stdenv.isDarwin llvmPackages.clang);
ghcLibdirLink = stdenv.mkDerivation {
name = "ghc_libdir";
inherit ghcLibdir;
buildCommand = ''
mkdir -p ${libDir}
echo "$ghcLibdir" > ${libDir}/ghc_libdir_override
'';
};
in
if paths == [] && !withLLVM then ghc else
buildEnv {
inherit (ghc) name;
paths = paths ++ [ghc];
paths = paths ++ [ghc] ++ lib.optional isGhcjs ghcLibdirLink;
inherit ignoreCollisions;
postBuild = ''
. ${makeWrapper}/nix-support/setup-hook
Expand Down Expand Up @@ -93,6 +102,7 @@ buildEnv {
done
${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"}
${lib.optionalString (isGhcjs && ghcLibdir != null) "mv ${libDir}/ghc_libdir_override ${libDir}/ghc_libdir"}
$out/bin/${ghcCommand}-pkg check
'' + postBuild;
passthru = {
Expand Down

0 comments on commit 1cd0740

Please sign in to comment.