Merge pull request #7734 from cstrahan/ghcjs-improvements
ghcjs: properly wrap binaries in environment
This commit is contained in:
@@ -39,10 +39,6 @@
|
||||
}:
|
||||
let
|
||||
version = "0.1.0";
|
||||
ghcArch = if pkgs.stdenv.system == "i686-linux"
|
||||
then "i386-linux"
|
||||
else pkgs.stdenv.system;
|
||||
libDir = "share/ghcjs/${ghcArch}-${version}-${ghc.version}/ghcjs";
|
||||
ghcjsBoot = fetchgit {
|
||||
url = git://github.com/ghcjs/ghcjs-boot.git;
|
||||
rev = "ab8765edcb507b8b810e3c324fd5bd5af2b69d8f"; # 7.10 branch
|
||||
@@ -84,14 +80,19 @@ in mkDerivation (rec {
|
||||
];
|
||||
patches = [ ./ghcjs.patch ];
|
||||
postPatch = ''
|
||||
substituteInPlace Setup.hs --replace "/usr/bin/env" "${coreutils}/bin/env"
|
||||
substituteInPlace src/Compiler/Info.hs --replace "@PREFIX@" "$out"
|
||||
substituteInPlace Setup.hs \
|
||||
--replace "/usr/bin/env" "${coreutils}/bin/env"
|
||||
|
||||
substituteInPlace src/Compiler/Info.hs \
|
||||
--replace "@PREFIX@" "$out" \
|
||||
--replace "@VERSION@" "${version}"
|
||||
|
||||
substituteInPlace src-bin/Boot.hs \
|
||||
--replace "@PREFIX@" "$out" \
|
||||
--replace "@CC@" "${stdenv.cc}/bin/cc"
|
||||
'';
|
||||
preBuild = ''
|
||||
local topDir=$out/${libDir}
|
||||
local topDir=$out/lib/ghcjs-${version}
|
||||
mkdir -p $topDir
|
||||
|
||||
cp -r ${ghcjsBoot} $topDir/ghcjs-boot
|
||||
@@ -116,9 +117,9 @@ in mkDerivation (rec {
|
||||
--with-gmp-libraries ${gmp}/lib
|
||||
'';
|
||||
passthru = {
|
||||
inherit libDir;
|
||||
isGhcjs = true;
|
||||
nativeGhc = ghc;
|
||||
inherit nodejs;
|
||||
};
|
||||
|
||||
homepage = "https://github.com/ghcjs/ghcjs";
|
||||
|
||||
@@ -60,15 +60,21 @@ index 3c68dcf..64f3cf7 100644
|
||||
, "--haddock-html"
|
||||
-- workaround for hoogle support being broken in haddock for GHC 7.10RC1
|
||||
diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
|
||||
index 33a401f..5d09c86 100644
|
||||
index 33a401f..79833c5 100644
|
||||
--- a/src/Compiler/Info.hs
|
||||
+++ b/src/Compiler/Info.hs
|
||||
@@ -49,7 +49,7 @@ compilerInfo nativeToo dflags = do
|
||||
@@ -48,13 +48,7 @@ compilerInfo nativeToo dflags = do
|
||||
|
||||
-- | the directory to use if started without -B flag
|
||||
getDefaultTopDir :: IO FilePath
|
||||
getDefaultTopDir = do
|
||||
-getDefaultTopDir = do
|
||||
- appdir <- getAppUserDataDirectory "ghcjs"
|
||||
+ let appdir = "@PREFIX@/share/ghcjs"
|
||||
return (appdir </> subdir </> "ghcjs")
|
||||
where
|
||||
targetARCH = arch
|
||||
- return (appdir </> subdir </> "ghcjs")
|
||||
- where
|
||||
- targetARCH = arch
|
||||
- targetOS = os
|
||||
- subdir = targetARCH ++ '-':targetOS ++ '-':getFullCompilerVersion
|
||||
+getDefaultTopDir = return "@PREFIX@/lib/ghcjs-@VERSION@"
|
||||
|
||||
getDefaultLibDir :: IO FilePath
|
||||
getDefaultLibDir = getDefaultTopDir
|
||||
|
||||
Reference in New Issue
Block a user