Merge branch 'haskell-updates'.
This commit is contained in:
commit
ae999f25c1
|
@ -0,0 +1,283 @@
|
|||
# generic builder for Cabal packages
|
||||
|
||||
{ stdenv, fetchurl, lib, pkgconfig, ghcjs, ghc, Cabal, jailbreakCabal, glibcLocales
|
||||
, gnugrep, coreutils, hscolour # hscolour is unused
|
||||
, enableLibraryProfiling ? false
|
||||
, enableSharedLibraries ? false
|
||||
, enableSharedExecutables ? false
|
||||
, enableStaticLibraries ? true
|
||||
, enableCheckPhase ? stdenv.lib.versionOlder "7.4" ghc.version
|
||||
, enableHyperlinkSource ? false
|
||||
, extension ? (self : super : {})
|
||||
}:
|
||||
|
||||
let
|
||||
enableFeature = stdenv.lib.enableFeature;
|
||||
versionOlder = stdenv.lib.versionOlder;
|
||||
optional = stdenv.lib.optional;
|
||||
optionals = stdenv.lib.optionals;
|
||||
optionalString = stdenv.lib.optionalString;
|
||||
filter = stdenv.lib.filter;
|
||||
|
||||
defaultSetupHs = builtins.toFile "Setup.hs" ''
|
||||
import Distribution.Simple
|
||||
main = defaultMain
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
mkDerivation =
|
||||
args : # arguments for the individual package, can modify the defaults
|
||||
let # These attributes are removed in the end. This is in order not to spoil the build
|
||||
# environment overly, but also to keep hash-backwards-compatible with the old cabal.nix.
|
||||
internalAttrs = [
|
||||
"internalAttrs" "buildDepends" "buildTools" "extraLibraries" "pkgconfigDepends"
|
||||
"isLibrary" "isExecutable" "testDepends"
|
||||
];
|
||||
|
||||
# Stuff happening after the user preferences have been processed. We remove
|
||||
# internal attributes and strip null elements from the dependency lists, all
|
||||
# in the interest of keeping hashes stable.
|
||||
postprocess =
|
||||
x : (removeAttrs x internalAttrs) // {
|
||||
buildInputs = filter (y : ! (y == null)) x.buildInputs;
|
||||
propagatedBuildInputs = filter (y : ! (y == null)) x.propagatedBuildInputs;
|
||||
propagatedUserEnvPkgs = filter (y : ! (y == null)) x.propagatedUserEnvPkgs;
|
||||
doCheck = enableCheckPhase && x.doCheck;
|
||||
hyperlinkSource = enableHyperlinkSource && x.hyperlinkSource;
|
||||
};
|
||||
|
||||
defaults =
|
||||
self : { # self is the final version of the attribute set
|
||||
|
||||
# pname should be defined by the client to be the package basename
|
||||
# version should be defined by the client to be the package version
|
||||
|
||||
# fname is the internal full name of the package
|
||||
fname = "${self.pname}-${self.version}";
|
||||
|
||||
# name is the external full name of the package; usually we prefix
|
||||
# all packages with haskell- to avoid name clashes for libraries;
|
||||
# if that is not desired (for applications), name can be set to
|
||||
# fname.
|
||||
name = if self.isLibrary then
|
||||
if enableLibraryProfiling && self.enableSharedLibraries then
|
||||
"haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}-profiling-shared"
|
||||
else if enableLibraryProfiling && !self.enableSharedLibraries then
|
||||
"haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}-profiling"
|
||||
else if !enableLibraryProfiling && self.enableSharedLibraries then
|
||||
"haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}-shared"
|
||||
else
|
||||
"haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}"
|
||||
else
|
||||
"${self.pname}-${self.version}";
|
||||
|
||||
# the default download location for Cabal packages is Hackage,
|
||||
# you still have to specify the checksum
|
||||
src = fetchurl {
|
||||
url = "mirror://hackage/${self.pname}/${self.fname}.tar.gz";
|
||||
inherit (self) sha256;
|
||||
};
|
||||
|
||||
# default buildInputs are just ghc, if more buildInputs are required
|
||||
# buildInputs can be extended by the client by using extraBuildInputs,
|
||||
# but often propagatedBuildInputs is preferable anyway
|
||||
buildInputs = [ghc ghc.ghc.parent.Cabal_HEAD] ++ self.extraBuildInputs;
|
||||
extraBuildInputs = self.buildTools ++
|
||||
(optionals self.doCheck self.testDepends) ++
|
||||
(if self.pkgconfigDepends == [] then [] else [pkgconfig]) ++
|
||||
(if self.isLibrary then [] else self.buildDepends ++ self.extraLibraries ++ self.pkgconfigDepends);
|
||||
|
||||
# we make sure that propagatedBuildInputs is defined, so that we don't
|
||||
# have to check for its existence
|
||||
propagatedBuildInputs = if self.isLibrary then self.buildDepends ++ self.extraLibraries ++ self.pkgconfigDepends else [];
|
||||
|
||||
# By default, also propagate all dependencies to the user environment. This is required, otherwise packages would be broken, because
|
||||
# GHC also needs all dependencies to be available.
|
||||
propagatedUserEnvPkgs = if self.isLibrary then self.buildDepends else [];
|
||||
|
||||
# library directories that have to be added to the Cabal files
|
||||
extraLibDirs = [];
|
||||
|
||||
# build-depends Cabal field
|
||||
buildDepends = [];
|
||||
|
||||
# target(s) passed to the cabal build phase as an argument
|
||||
buildTarget = "";
|
||||
|
||||
# build-depends Cabal fields stated in test-suite stanzas
|
||||
testDepends = [];
|
||||
|
||||
# target(s) passed to the cabal test phase as an argument
|
||||
testTarget = "";
|
||||
|
||||
# build-tools Cabal field
|
||||
buildTools = [];
|
||||
|
||||
# extra-libraries Cabal field
|
||||
extraLibraries = [];
|
||||
|
||||
# pkgconfig-depends Cabal field
|
||||
pkgconfigDepends = [];
|
||||
|
||||
isLibrary = ! self.isExecutable;
|
||||
isExecutable = false;
|
||||
|
||||
# ignore version restrictions on the build inputs that the cabal file might specify
|
||||
jailbreak = false;
|
||||
|
||||
# pass the '--enable-split-objs' flag to cabal in the configure stage
|
||||
enableSplitObjs = false; # !stdenv.isDarwin; # http://hackage.haskell.org/trac/ghc/ticket/4013
|
||||
|
||||
# pass the '--enable-tests' flag to cabal in the configure stage
|
||||
# and run any regression test suites the package might have
|
||||
doCheck = false; #enableCheckPhase;
|
||||
|
||||
# pass the '--hyperlink-source' flag to ./Setup haddock
|
||||
hyperlinkSource = enableHyperlinkSource;
|
||||
|
||||
# abort the build if the configure phase detects that the package
|
||||
# depends on multiple versions of the same build input
|
||||
strictConfigurePhase = true;
|
||||
|
||||
# pass the '--enable-library-vanilla' flag to cabal in the
|
||||
# configure stage to enable building shared libraries
|
||||
inherit enableStaticLibraries;
|
||||
|
||||
# pass the '--enable-shared' flag to cabal in the configure
|
||||
# stage to enable building shared libraries
|
||||
inherit enableSharedLibraries;
|
||||
|
||||
# pass the '--enable-executable-dynamic' flag to cabal in
|
||||
# the configure stage to enable linking shared libraries
|
||||
inherit enableSharedExecutables;
|
||||
|
||||
extraConfigureFlags = [
|
||||
(enableFeature self.enableSplitObjs "split-objs")
|
||||
(enableFeature enableLibraryProfiling "library-profiling")
|
||||
(enableFeature true "shared")
|
||||
(optional (versionOlder "7" ghc.version) (enableFeature self.enableStaticLibraries "library-vanilla"))
|
||||
(optional (versionOlder "7.4" ghc.version) (enableFeature self.enableSharedExecutables "executable-dynamic"))
|
||||
(optional (versionOlder "7" ghc.version) (enableFeature self.doCheck "tests"))
|
||||
];
|
||||
|
||||
# GHC needs the locale configured during the Haddock phase.
|
||||
LANG = "en_US.UTF-8";
|
||||
LOCALE_ARCHIVE = optionalString stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
|
||||
|
||||
# compiles Setup and configures
|
||||
configurePhase = ''
|
||||
eval "$preConfigure"
|
||||
|
||||
${optionalString self.jailbreak "${ghc.ghc.parent.jailbreakCabal}/bin/jailbreak-cabal ${self.pname}.cabal"}
|
||||
|
||||
PATH=$PATH:${ghc.ghc.ghc}/bin
|
||||
|
||||
for i in Setup.hs Setup.lhs ${defaultSetupHs}; do
|
||||
test -f $i && break
|
||||
done
|
||||
ghc --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
|
||||
|
||||
for p in $extraBuildInputs $propagatedBuildInputs $propagatedNativeBuildInputs; do
|
||||
PkgDir="$p/lib/ghcjs-${ghc.ghc.version}_ghc-${ghc.ghc.ghc.version}/package.conf.d"
|
||||
if [ -f "$PkgDir/package.cache" ]; then
|
||||
extraConfigureFlags+=" --package-db=$PkgDir"
|
||||
continue;
|
||||
fi
|
||||
if [ -d "$p/include" ]; then
|
||||
extraConfigureFlags+=" --extra-include-dirs=$p/include"
|
||||
fi
|
||||
for d in lib{,64}; do
|
||||
if [ -d "$p/$d" ]; then
|
||||
extraConfigureFlags+=" --extra-lib-dirs=$p/$d"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
configureFlags+=" --package-db=${ghc.ghc}/${ghc.ghc.libDir}/package.conf.d"
|
||||
|
||||
${optionalString (self.enableSharedExecutables && self.stdenv.isLinux) ''
|
||||
configureFlags+=" --ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.ghc.name}/${self.pname}-${self.version}";
|
||||
''}
|
||||
${optionalString (self.enableSharedExecutables && self.stdenv.isDarwin) ''
|
||||
configureFlags+=" --ghc-option=-optl=-Wl,-headerpad_max_install_names";
|
||||
''}
|
||||
|
||||
echo "configure flags: $extraConfigureFlags $configureFlags"
|
||||
./Setup configure --ghcjs --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \
|
||||
--libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \
|
||||
${optionalString self.strictConfigurePhase ''
|
||||
| ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log"
|
||||
if ${gnugrep}/bin/egrep -q '^Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
|
||||
echo >&2 "*** abort because of serious configure-time warning from Cabal"
|
||||
exit 1
|
||||
fi
|
||||
''}
|
||||
|
||||
eval "$postConfigure"
|
||||
'';
|
||||
|
||||
# builds via Cabal
|
||||
buildPhase = ''
|
||||
eval "$preBuild"
|
||||
|
||||
./Setup build ${self.buildTarget}
|
||||
|
||||
export GHC_PACKAGE_PATH=$(${ghc.GHCPackages})
|
||||
#test -n "$noHaddock" || ./Setup haddock --html --hoogle \
|
||||
# ${optionalString self.hyperlinkSource "--hyperlink-source"}
|
||||
|
||||
eval "$postBuild"
|
||||
'';
|
||||
|
||||
checkPhase = optional self.doCheck ''
|
||||
eval "$preCheck"
|
||||
|
||||
./Setup test ${self.testTarget}
|
||||
|
||||
eval "$postCheck"
|
||||
'';
|
||||
|
||||
# installs via Cabal; creates a registration file for nix-support
|
||||
# so that the package can be used in other Haskell-builds; also
|
||||
# adds all propagated build inputs to the user environment packages
|
||||
installPhase = ''
|
||||
eval "$preInstall"
|
||||
|
||||
./Setup copy
|
||||
|
||||
mkdir -p $out/bin # necessary to get it added to PATH
|
||||
|
||||
local confDir=$out/lib/ghcjs-${ghc.ghc.version}_ghc-${ghc.ghc.ghc.version}/package.conf.d
|
||||
local installedPkgConf=$confDir/${self.fname}.installedconf
|
||||
local pkgConf=$confDir/${self.fname}.conf
|
||||
mkdir -p $confDir
|
||||
./Setup register --gen-pkg-config=$pkgConf
|
||||
if test -f $pkgConf; then
|
||||
echo '[]' > $installedPkgConf
|
||||
GHC_PACKAGE_PATH=$installedPkgConf ghcjs-pkg --global register $pkgConf --force --package-db=$confDir || true
|
||||
ghcjs-pkg recache --package-db=$confDir
|
||||
fi
|
||||
|
||||
if test -f $out/nix-support/propagated-native-build-inputs; then
|
||||
ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
|
||||
fi
|
||||
|
||||
${optionalString (self.enableSharedExecutables && self.isExecutable && self.stdenv.isDarwin) ''
|
||||
for exe in $out/bin/* ; do
|
||||
install_name_tool -add_rpath $out/lib/${ghc.ghc.name}/${self.pname}-${self.version} $exe || true # Ignore failures, which seem to be due to hitting bash scripts rather than binaries
|
||||
done
|
||||
''}
|
||||
|
||||
eval "$postInstall"
|
||||
'';
|
||||
|
||||
# We inherit stdenv and ghc so that they can be used
|
||||
# in Cabal derivations.
|
||||
inherit stdenv ghc;
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation (postprocess (let super = defaults self // args self;
|
||||
self = super // extension self super;
|
||||
in self));
|
||||
}
|
|
@ -22,5 +22,6 @@ cabal.mkDerivation (self: {
|
|||
description = "Interactive development tool for Elm programs";
|
||||
license = self.stdenv.lib.licenses.bsd3;
|
||||
platforms = self.ghc.meta.platforms;
|
||||
broken = true;
|
||||
};
|
||||
})
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
{ nodejs, cabal, filepath, HTTP, HUnit, mtl, network, QuickCheck, random, stm
|
||||
, testFramework, testFrameworkHunit, testFrameworkQuickcheck2, time
|
||||
, zlib, aeson, attoparsec, bzlib, dataDefault, ghcPaths, hashable
|
||||
, haskellSrcExts, haskellSrcMeta, lens, optparseApplicative
|
||||
, parallel, safe, shelly, split, stringsearch, syb, systemFileio
|
||||
, systemFilepath, tar, terminfo, textBinary, unorderedContainers
|
||||
, vector, wlPprintText, yaml, fetchgit, Cabal, cabalInstall
|
||||
, regexPosix, alex, happy, git, gnumake, gcc, autoconf, patch
|
||||
, automake, libtool, gmp, base16Bytestring
|
||||
, cryptohash, executablePath, transformersCompat, haddockApi
|
||||
, haddock, hspec, xhtml, primitive, cacert, pkgs, ghc
|
||||
, coreutils
|
||||
, ghcjsPrim
|
||||
}:
|
||||
let
|
||||
version = "0.1.0";
|
||||
libDir = "share/ghcjs/${pkgs.stdenv.system}-${version}-${ghc.ghc.version}/ghcjs";
|
||||
ghcjsBoot = fetchgit {
|
||||
url = git://github.com/ghcjs/ghcjs-boot.git;
|
||||
rev = "5c7a71472d5a797e895914d3b82cea447a058793";
|
||||
sha256 = "0dp97bgbnlr3sd9yfnk27p6dfv46fi26sn6y6qv1wxs5i29kmjav";
|
||||
};
|
||||
shims = fetchgit {
|
||||
url = git://github.com/ghcjs/shims.git;
|
||||
rev = "99bbd4bed584ec42bfcc5ea61c3808a2c670053d";
|
||||
sha256 = "1my3gqkln7hgm0bpy32pnhwjfza096alh0n9x9ny8xfpxhmzz4h6";
|
||||
};
|
||||
in cabal.mkDerivation (self: rec {
|
||||
pname = "ghcjs";
|
||||
inherit version;
|
||||
src = fetchgit {
|
||||
url = git://github.com/ghcjs/ghcjs.git;
|
||||
rev = "4b9461e8be646d5152a0ae7ece5b3616bf938637";
|
||||
sha256 = "19g62j1kkdwcgp0042ppmskwbvfk7qkf1fjs8bpjc6wwd19ipiar";
|
||||
};
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
jailbreak = true;
|
||||
noHaddock = true;
|
||||
doCheck = false;
|
||||
buildDepends = [
|
||||
filepath HTTP mtl network random stm time zlib aeson attoparsec
|
||||
bzlib dataDefault ghcPaths hashable haskellSrcExts haskellSrcMeta
|
||||
lens optparseApplicative parallel safe shelly split
|
||||
stringsearch syb systemFileio systemFilepath tar terminfo textBinary
|
||||
unorderedContainers vector wlPprintText yaml
|
||||
alex happy git gnumake gcc autoconf automake libtool patch gmp
|
||||
base16Bytestring cryptohash executablePath haddockApi
|
||||
transformersCompat QuickCheck haddock hspec xhtml
|
||||
ghcjsPrim regexPosix
|
||||
];
|
||||
buildTools = [ nodejs git ];
|
||||
testDepends = [
|
||||
HUnit testFramework testFrameworkHunit
|
||||
];
|
||||
patches = [ ./ghcjs.patch ];
|
||||
postPatch = ''
|
||||
substituteInPlace Setup.hs --replace "/usr/bin/env" "${coreutils}/bin/env"
|
||||
substituteInPlace src/Compiler/Info.hs --replace "@PREFIX@" "$out"
|
||||
substituteInPlace src-bin/Boot.hs --replace "@PREFIX@" "$out"
|
||||
'';
|
||||
preBuild = ''
|
||||
local topDir=$out/${libDir}
|
||||
mkdir -p $topDir
|
||||
|
||||
cp -r ${ghcjsBoot} $topDir/ghcjs-boot
|
||||
chmod -R u+w $topDir/ghcjs-boot
|
||||
|
||||
cp -r ${shims} $topDir/shims
|
||||
chmod -R u+w $topDir/shims
|
||||
'';
|
||||
postInstall = ''
|
||||
PATH=$out/bin:${Cabal}/bin:$PATH LD_LIBRARY_PATH=${gmp}/lib:${gcc.gcc}/lib64:$LD_LIBRARY_PATH \
|
||||
env -u GHC_PACKAGE_PATH $out/bin/ghcjs-boot \
|
||||
--dev \
|
||||
--with-cabal ${cabalInstall}/bin/cabal \
|
||||
--with-gmp-includes ${gmp}/include \
|
||||
--with-gmp-libraries ${gmp}/lib
|
||||
'';
|
||||
passthru = {
|
||||
inherit libDir;
|
||||
};
|
||||
meta = {
|
||||
homepage = "https://github.com/ghcjs/ghcjs";
|
||||
description = "GHCJS is a Haskell to JavaScript compiler that uses the GHC API";
|
||||
license = self.stdenv.lib.licenses.bsd3;
|
||||
platforms = self.ghc.meta.platforms;
|
||||
maintainers = [ self.stdenv.lib.maintainers.jwiegley ];
|
||||
};
|
||||
})
|
|
@ -0,0 +1,72 @@
|
|||
diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
|
||||
index 988955b..a55f07b 100644
|
||||
--- a/src-bin/Boot.hs
|
||||
+++ b/src-bin/Boot.hs
|
||||
@@ -512,9 +512,7 @@ initPackageDB :: B ()
|
||||
initPackageDB = do
|
||||
msg info "creating package databases"
|
||||
initDB "--global" <^> beLocations . blGlobalDB
|
||||
- traverseOf_ _Just initUser <^> beLocations . blUserDBDir
|
||||
where
|
||||
- initUser dir = rm_f (dir </> "package.conf") >> initDB "--user" (dir </> "package.conf.d")
|
||||
initDB dbName db = do
|
||||
rm_rf db >> mkdir_p db
|
||||
ghcjs_pkg_ ["init", toTextI db] `catchAny_` return ()
|
||||
@@ -538,29 +536,22 @@ installDevelopmentTree = subTop $ do
|
||||
msgD info $ "preparing development boot tree"
|
||||
checkpoint' "ghcjs-boot-git" "ghcjs-boot repository already cloned and prepared" $ do
|
||||
testGit "ghcjs-boot" >>= \case
|
||||
- Just False -> failWith "ghcjs-boot already exists and is not a git repository"
|
||||
- Just True -> do
|
||||
- msg info "ghcjs-boot repository already exists but checkpoint not reached, cleaning first, then cloning"
|
||||
- rm_rf "ghcjs-boot"
|
||||
+ Just _ -> do
|
||||
+ msg info "ghcjs-boot repository already exists; initializing ghcjs-boot"
|
||||
initGhcjsBoot
|
||||
Nothing -> do
|
||||
msgD info "cloning ghcjs-boot git repository"
|
||||
initGhcjsBoot
|
||||
checkpoint' "shims-git" "shims repository already cloned" $ do
|
||||
testGit "shims" >>= \case
|
||||
- Just False -> failWith "shims already exists and is not a git repository"
|
||||
- Just True -> do
|
||||
- msgD info "shims repository already exists but checkpoint not reached, cleaning first, then cloning"
|
||||
- rm_rf "shims"
|
||||
- cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
|
||||
+ Just _ -> do
|
||||
+ msgD info "shims repository already exists; moving on"
|
||||
Nothing -> do
|
||||
msgD info "cloning shims git repository"
|
||||
cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
|
||||
where
|
||||
initGhcjsBoot = sub $ do
|
||||
- cloneGit bootDescr "ghcjs-boot" bsrcBootDevBranch bsrcBootDev
|
||||
cd "ghcjs-boot"
|
||||
- git_ ["submodule", "update", "--init", "--recursive"]
|
||||
mapM_ patchPackage =<< allPackages
|
||||
preparePrimops
|
||||
buildGenPrim
|
||||
@@ -1086,7 +1077,9 @@ cabalInstallFlags parmakeGhcjs = do
|
||||
, "--builddir", "dist"
|
||||
, "--with-compiler", ghcjs ^. pgmLocText
|
||||
, "--with-hc-pkg", ghcjsPkg ^. pgmLocText
|
||||
- , "--prefix", toTextI instDir
|
||||
+ , "--prefix", "@PREFIX@"
|
||||
+ , "--libdir", "$prefix/lib/$compiler"
|
||||
+ , "--libsubdir", "$pkgid"
|
||||
, bool haddock "--enable-documentation" "--disable-documentation"
|
||||
, "--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
|
||||
--- a/src/Compiler/Info.hs
|
||||
+++ b/src/Compiler/Info.hs
|
||||
@@ -49,7 +49,7 @@ compilerInfo nativeToo dflags = do
|
||||
-- | the directory to use if started without -B flag
|
||||
getDefaultTopDir :: IO FilePath
|
||||
getDefaultTopDir = do
|
||||
- appdir <- getAppUserDataDirectory "ghcjs"
|
||||
+ let appdir = "@PREFIX@/share/ghcjs"
|
||||
return (appdir </> subdir </> "ghcjs")
|
||||
where
|
||||
targetARCH = arch
|
|
@ -0,0 +1,77 @@
|
|||
{ stdenv, ghc, makeWrapper, coreutils, writeScript }:
|
||||
let
|
||||
ghcjs = ghc;
|
||||
packageDBFlag = "-package-db";
|
||||
|
||||
GHCGetPackages = writeScript "ghc-get-packages.sh" ''
|
||||
#! ${stdenv.shell}
|
||||
# Usage:
|
||||
# $1: version of GHC
|
||||
# $2: invocation path of GHC
|
||||
# $3: prefix
|
||||
version="$1"
|
||||
if test -z "$3"; then
|
||||
prefix="${packageDBFlag} "
|
||||
else
|
||||
prefix="$3"
|
||||
fi
|
||||
PATH="$PATH:$2"
|
||||
IFS=":"
|
||||
for p in $PATH; do
|
||||
for i in "$p/../share/ghcjs/$system-${ghcjs.version}-${ghcjs.ghc.version}"{,/lib,/ghcjs}"/package.conf.d" "$p/../lib/ghcjs-${ghc.version}_ghc-${ghc.ghc.version}/package.conf.d" ; do
|
||||
# output takes place here
|
||||
test -f $i/package.cache && echo -n " $prefix$i"
|
||||
done
|
||||
done
|
||||
'';
|
||||
|
||||
GHCPackages = writeScript "ghc-packages.sh" ''
|
||||
#! ${stdenv.shell} -e
|
||||
declare -A GHC_PACKAGES_HASH # using bash4 hashs to get uniq paths
|
||||
|
||||
for arg in $(${GHCGetPackages} ${ghcjs.version} "$(dirname $0)"); do # Why is ghc.version passed in from here instead of captured in the other script directly?
|
||||
case "$arg" in
|
||||
${packageDBFlag}) ;;
|
||||
*)
|
||||
CANONICALIZED="$(${coreutils}/bin/readlink -f -- "$arg")"
|
||||
GHC_PACKAGES_HASH["$CANONICALIZED"]= ;;
|
||||
esac
|
||||
done
|
||||
|
||||
for path in ''${!GHC_PACKAGES_HASH[@]}; do
|
||||
echo -n "$path:"
|
||||
done
|
||||
'';
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "ghcjs-ghc${ghcjs.ghc.version}-${ghcjs.version}-wrapper";
|
||||
|
||||
buildInputs = [makeWrapper];
|
||||
propagatedBuildInputs = [ghcjs];
|
||||
|
||||
unpackPhase = "true";
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
for prg in ghcjs ; do
|
||||
makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$(${GHCGetPackages} ${ghcjs.version} \"\$(dirname \$0)\")"
|
||||
done
|
||||
for prg in ghcjs-pkg ; do
|
||||
makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$(${GHCGetPackages} ${ghcjs.version} \"\$(dirname \$0)\" -${packageDBFlag}=)"
|
||||
done
|
||||
|
||||
mkdir -p $out/nix-support
|
||||
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
||||
|
||||
mkdir -p $out/share/doc
|
||||
ln -s $ghc/lib $out/lib
|
||||
ln -s $ghc/share/doc/ghc $out/share/doc/ghc-${ghcjs.version}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
ghc = ghcjs;
|
||||
inherit GHCGetPackages GHCPackages;
|
||||
inherit (ghcjs) meta version;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{ cabal, filepath, HTTP, HUnit, mtl, network, QuickCheck
|
||||
, random, stm, testFramework, testFrameworkHunit
|
||||
, testFrameworkQuickcheck2, time, zlib, fetchgit
|
||||
}:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "Cabal";
|
||||
version = "HEAD";
|
||||
src = fetchgit {
|
||||
url = git://github.com/haskell/cabal.git;
|
||||
rev = "699d4df12e1ec75e9100b521fb3690eaa6986635";
|
||||
sha256 = "112wz0mq7b0hvlj69imnwja2n4kv75m49yy5y8924gik9801zjba";
|
||||
};
|
||||
preConfigure = "cd Cabal";
|
||||
|
||||
doCheck = false;
|
||||
noHaddock = true;
|
||||
|
||||
buildDepends = [
|
||||
filepath HTTP mtl network random stm time zlib QuickCheck
|
||||
];
|
||||
testDepends = [
|
||||
filepath HTTP HUnit mtl network QuickCheck stm testFramework
|
||||
testFrameworkHunit testFrameworkQuickcheck2 time zlib
|
||||
];
|
||||
})
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "ghcjs-dom";
|
||||
version = "0.1.1.1";
|
||||
sha256 = "0fwwm658gf4fp32zmfskfayi480ddsf40y2cfla88a7l1rbacwif";
|
||||
version = "0.1.1.3";
|
||||
sha256 = "0pdxb2s7fflrh8sbqakv0qi13jkn3d0yc32xhg2944yfjg5fvlly";
|
||||
buildDepends = [ ghcjsBase mtl text ];
|
||||
meta = {
|
||||
description = "DOM library that supports both GHCJS and WebKitGTK";
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{ cabal, primitive, fetchgit }:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "ghcjs-prim";
|
||||
version = "0.1.0.0";
|
||||
src = fetchgit {
|
||||
url = git://github.com/ghcjs/ghcjs-prim.git;
|
||||
rev = "8e003e1a1df10233bc3f03d7bbd7d37de13d2a84";
|
||||
sha256 = "11k2r87s58wmpxykn61lihn4vm3x67cm1dygvdl26papifinj6pz";
|
||||
};
|
||||
buildDepends = [ primitive ];
|
||||
})
|
|
@ -12,5 +12,6 @@ cabal.mkDerivation (self: {
|
|||
description = "Categories";
|
||||
license = self.stdenv.lib.licenses.bsd3;
|
||||
platforms = self.ghc.meta.platforms;
|
||||
broken = true;
|
||||
};
|
||||
})
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "webkit";
|
||||
version = "0.13.0.3";
|
||||
sha256 = "0l05cg6krafpcfszcka03x7gay8wg1fhd0gpbn2cchfshfkicgxc";
|
||||
version = "0.13.1.1";
|
||||
sha256 = "0652as9wq0ajaqmcx14y2svishccgrywyagrbzga7m06r3h94dz5";
|
||||
buildDepends = [ cairo glib gtk mtl pango text ];
|
||||
buildTools = [ gtk2hsBuildtools ];
|
||||
pkgconfigDepends = [ webkit ];
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{ cabal, Cabal, filepath, HTTP, HUnit, mtl, network, QuickCheck
|
||||
, random, stm, testFramework, testFrameworkHunit
|
||||
, testFrameworkQuickcheck2, time, zlib, fetchgit
|
||||
}:
|
||||
|
||||
cabal.mkDerivation (self: {
|
||||
pname = "cabal-install";
|
||||
version = "HEAD";
|
||||
src = Cabal.src;
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
doCheck = false;
|
||||
preConfigure = "cd cabal-install";
|
||||
noHaddock = true;
|
||||
buildDepends = [
|
||||
Cabal filepath HTTP mtl network random stm time zlib
|
||||
];
|
||||
testDepends = [
|
||||
Cabal filepath HTTP HUnit mtl network QuickCheck stm testFramework
|
||||
testFrameworkHunit testFrameworkQuickcheck2 time zlib
|
||||
];
|
||||
postInstall = ''
|
||||
mkdir $out/etc
|
||||
mv bash-completion $out/etc/bash_completion.d
|
||||
'';
|
||||
meta = {
|
||||
homepage = "http://www.haskell.org/cabal/";
|
||||
description = "The command-line interface for Cabal and Hackage";
|
||||
license = self.stdenv.lib.licenses.bsd3;
|
||||
platforms = self.ghc.meta.platforms;
|
||||
maintainers = [ self.stdenv.lib.maintainers.andres ];
|
||||
};
|
||||
})
|
|
@ -3374,6 +3374,7 @@ let
|
|||
haskellPackages_ghc784_profiling = recurseIntoAttrs haskell.packages_ghc784.profiling;
|
||||
haskellPackages_ghc784 = recurseIntoAttrs haskell.packages_ghc784.highPrio;
|
||||
haskellPackages_ghcHEAD = haskell.packages_ghcHEAD;
|
||||
haskellPackages_ghcjs = haskell.packages_ghcjs;
|
||||
|
||||
haxe = callPackage ../development/compilers/haxe { };
|
||||
|
||||
|
|
|
@ -17,6 +17,15 @@
|
|||
ghcHEADPrefs = self : super : super // {
|
||||
cabalInstall_1_20_0_4 = super.cabalInstall_1_20_0_4.override { Cabal = null; };
|
||||
mtl = self.mtl_2_2_1;
|
||||
ghcjsBase = null;
|
||||
ghcjsDom = with self; super.ghcjsDom.override {
|
||||
cabal = self.cabal.override {
|
||||
extension = self: super: {
|
||||
configureFlags = [ "-f-ghcjs" "-fwebkit" "-f-gtk3" ];
|
||||
buildDepends = [ mtl glib transformers gtk webkit ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ghc784Prefs = self : super : ghcHEADPrefs self super // {
|
||||
|
@ -232,6 +241,71 @@
|
|||
prefFun = ghc784Prefs;
|
||||
};
|
||||
|
||||
packages_ghcjs =
|
||||
packages {
|
||||
ghcPath = ../development/compilers/ghc/7.8.4.nix;
|
||||
ghcBinary = if stdenv.isDarwin then ghc783Binary else ghc742Binary;
|
||||
prefFun = self : super : super // {
|
||||
ghc = let parent = packages_ghc784; in
|
||||
callPackage ../development/compilers/ghcjs/wrapper.nix {
|
||||
ghc = parent.ghcjs // { inherit parent; };
|
||||
};
|
||||
cabal = self.cabalJs;
|
||||
buildLocalCabalWithArgs = args: super.buildLocalCabalWithArgs (args // {
|
||||
nativePkgs = packages_ghc784;
|
||||
});
|
||||
ghcjsDom = with self; super.ghcjsDom.override {
|
||||
cabal = self.cabal.override {
|
||||
extension = self: super: {
|
||||
configureFlags = [ ];
|
||||
buildDepends = [ mtl ghcjsBase ];
|
||||
};
|
||||
};
|
||||
};
|
||||
# This is the list of packages that are built into a booted ghcjs installation
|
||||
# It can be generated with the command:
|
||||
# nix-shell '<nixpkgs>' -A pkgs.haskellPackages_ghcjs.ghc --command "ghcjs-pkg list | sed -n 's/^ \(.*\)-\([0-9.]*\)$/\1_\2/ p' | sed 's/\./_/g' | sed 's/-\(.\)/\U\1/' | sed 's/^\([^_]*\)\(.*\)$/\1 = null;/'"
|
||||
Cabal = null;
|
||||
aeson = null;
|
||||
array = null;
|
||||
async = null;
|
||||
attoparsec = null;
|
||||
base = null;
|
||||
binary = null;
|
||||
rts = null;
|
||||
bytestring = null;
|
||||
caseInsensitive = null;
|
||||
containers = null;
|
||||
deepseq = null;
|
||||
directory = null;
|
||||
dlist = null;
|
||||
extensibleExceptions = null;
|
||||
filepath = null;
|
||||
ghcPrim = null;
|
||||
ghcjsBase = null;
|
||||
ghcjsPrim = null;
|
||||
hashable = null;
|
||||
integerGmp = null;
|
||||
mtl = null;
|
||||
oldLocale = null;
|
||||
oldTime = null;
|
||||
parallel = null;
|
||||
pretty = null;
|
||||
primitive = null;
|
||||
process = null;
|
||||
scientific = null;
|
||||
stm = null;
|
||||
syb = null;
|
||||
templateHaskell = null;
|
||||
text = null;
|
||||
time = null;
|
||||
transformers = null;
|
||||
unix = null;
|
||||
unorderedContainers = null;
|
||||
vector = null;
|
||||
};
|
||||
};
|
||||
|
||||
packages_ghc763 =
|
||||
packages { ghcPath = ../development/compilers/ghc/7.6.3.nix;
|
||||
ghcBinary = ghc704Binary;
|
||||
|
|
|
@ -103,6 +103,15 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
|
|||
extension = self : super : {};
|
||||
};
|
||||
|
||||
cabalJs = callPackage ../build-support/cabal/ghcjs.nix {
|
||||
Cabal = null; # prefer the Cabal version shipped with the compiler
|
||||
hscolour = self.hscolourBootstrap;
|
||||
inherit enableLibraryProfiling enableCheckPhase
|
||||
enableStaticLibraries enableSharedLibraries enableSharedExecutables;
|
||||
glibcLocales = if pkgs.stdenv.isLinux then pkgs.glibcLocales else null;
|
||||
extension = self : super : {};
|
||||
};
|
||||
|
||||
# A variant of the cabal build driver that disables unit testing.
|
||||
# Useful for breaking cycles, where the unit test of a package A
|
||||
# depends on package B, which has A as a regular build input.
|
||||
|
@ -356,6 +365,7 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
|
|||
Cabal_1_16_0_3 = callPackage ../development/libraries/haskell/Cabal/1.16.0.3.nix {};
|
||||
Cabal_1_18_1_3 = callPackage ../development/libraries/haskell/Cabal/1.18.1.3.nix {};
|
||||
Cabal_1_20_0_2 = callPackage ../development/libraries/haskell/Cabal/1.20.0.2.nix {};
|
||||
Cabal_HEAD = callPackage ../development/libraries/haskell/Cabal/head.nix {};
|
||||
Cabal = null; # core package since forever
|
||||
|
||||
cabalCargs = callPackage ../development/libraries/haskell/cabal-cargs {};
|
||||
|
@ -942,10 +952,20 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
|
|||
|
||||
ghcid = callPackage ../development/tools/haskell/ghcid {};
|
||||
|
||||
ghcjsDom = callPackage ../development/libraries/haskell/ghcjs-codemirror {};
|
||||
ghcjs = callPackage ../development/compilers/ghcjs {
|
||||
Cabal = self.Cabal_HEAD;
|
||||
cabalInstall = self.cabalInstall_HEAD;
|
||||
haddock = self.haddock.override {
|
||||
Cabal = null;
|
||||
};
|
||||
};
|
||||
|
||||
ghcjsDom = callPackage ../development/libraries/haskell/ghcjs-dom {};
|
||||
|
||||
ghcjsCodemirror = callPackage ../development/libraries/haskell/ghcjs-codemirror {};
|
||||
|
||||
ghcjsPrim = callPackage ../development/libraries/haskell/ghcjs-prim {};
|
||||
|
||||
ghcMod = callPackage ../development/libraries/haskell/ghc-mod { inherit (pkgs) emacs; };
|
||||
|
||||
ghcMtl = callPackage ../development/libraries/haskell/ghc-mtl {};
|
||||
|
@ -3163,6 +3183,7 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
|
|||
cabalInstall_1_16_0_2 = callPackage ../tools/package-management/cabal-install/1.16.0.2.nix { Cabal = self.Cabal_1_16_0_3; };
|
||||
cabalInstall_1_18_0_3 = callPackage ../tools/package-management/cabal-install/1.18.0.3.nix { Cabal = self.Cabal_1_18_1_3; };
|
||||
cabalInstall_1_20_0_4 = callPackage ../tools/package-management/cabal-install/1.20.0.4.nix { Cabal = self.Cabal_1_20_0_2; };
|
||||
cabalInstall_HEAD = callPackage ../tools/package-management/cabal-install/head.nix { Cabal = self.Cabal_HEAD; };
|
||||
cabalInstall = self.cabalInstall_1_20_0_4;
|
||||
|
||||
codex = callPackage ../development/tools/haskell/codex {};
|
||||
|
|
Loading…
Reference in New Issue