git.iko.soy/typeable/nixpkgs
on master help sign in
Merge branch 'haskell-updates'.
commitae999f25c125ee54e57dacb2d8276acd4a233420 authorPeter Simons <simons@cryp.to> dateThu 1 Jan 2015, 19:26 (12 years ago) parent975e6230a0965f
14 files changed+696−5
pkgs/build-support/cabal/ghcjs.nix+283 pkgs/development/compilers/elm/elm-reactor.nix+1 pkgs/development/compilers/ghcjs/default.nix+90 pkgs/development/compilers/ghcjs/ghcjs.patch+72 pkgs/development/compilers/ghcjs/wrapper.nix+77 pkgs/development/libraries/haskell/Cabal/head.nix+26 pkgs/development/libraries/haskell/ghcjs-dom/default.nix+2−2 pkgs/development/libraries/haskell/ghcjs-prim/default.nix+12 pkgs/development/libraries/haskell/hask/default.nix+1 pkgs/development/libraries/haskell/webkit/default.nix+2−2 pkgs/tools/package-management/cabal-install/head.nix+33 pkgs/top-level/all-packages.nix+1 pkgs/top-level/haskell-defaults.nix+74 pkgs/top-level/haskell-packages.nix+22−1
pkgs/build-support/cabal/ghcjs.nixnew file+283
@@ -0,0 +1,283 @@
1+# generic builder for Cabal packages
2+
3+{ stdenv, fetchurl, lib, pkgconfig, ghcjs, ghc, Cabal, jailbreakCabal, glibcLocales
4+, gnugrep, coreutils, hscolour # hscolour is unused
5+, enableLibraryProfiling ? false
6+, enableSharedLibraries ? false
7+, enableSharedExecutables ? false
8+, enableStaticLibraries ? true
9+, enableCheckPhase ? stdenv.lib.versionOlder "7.4" ghc.version
10+, enableHyperlinkSource ? false
11+, extension ? (self : super : {})
12+}:
13+
14+let
15+ enableFeature = stdenv.lib.enableFeature;
16+ versionOlder = stdenv.lib.versionOlder;
17+ optional = stdenv.lib.optional;
18+ optionals = stdenv.lib.optionals;
19+ optionalString = stdenv.lib.optionalString;
20+ filter = stdenv.lib.filter;
21+
22+ defaultSetupHs = builtins.toFile "Setup.hs" ''
23+ import Distribution.Simple
24+ main = defaultMain
25+ '';
26+in
27+
28+{
29+ mkDerivation =
30+ args : # arguments for the individual package, can modify the defaults
31+ let # These attributes are removed in the end. This is in order not to spoil the build
32+ # environment overly, but also to keep hash-backwards-compatible with the old cabal.nix.
33+ internalAttrs = [
34+ "internalAttrs" "buildDepends" "buildTools" "extraLibraries" "pkgconfigDepends"
35+ "isLibrary" "isExecutable" "testDepends"
36+ ];
37+
38+ # Stuff happening after the user preferences have been processed. We remove
39+ # internal attributes and strip null elements from the dependency lists, all
40+ # in the interest of keeping hashes stable.
41+ postprocess =
42+ x : (removeAttrs x internalAttrs) // {
43+ buildInputs = filter (y : ! (y == null)) x.buildInputs;
44+ propagatedBuildInputs = filter (y : ! (y == null)) x.propagatedBuildInputs;
45+ propagatedUserEnvPkgs = filter (y : ! (y == null)) x.propagatedUserEnvPkgs;
46+ doCheck = enableCheckPhase && x.doCheck;
47+ hyperlinkSource = enableHyperlinkSource && x.hyperlinkSource;
48+ };
49+
50+ defaults =
51+ self : { # self is the final version of the attribute set
52+
53+ # pname should be defined by the client to be the package basename
54+ # version should be defined by the client to be the package version
55+
56+ # fname is the internal full name of the package
57+ fname = "${self.pname}-${self.version}";
58+
59+ # name is the external full name of the package; usually we prefix
60+ # all packages with haskell- to avoid name clashes for libraries;
61+ # if that is not desired (for applications), name can be set to
62+ # fname.
63+ name = if self.isLibrary then
64+ if enableLibraryProfiling && self.enableSharedLibraries then
65+ "haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}-profiling-shared"
66+ else if enableLibraryProfiling && !self.enableSharedLibraries then
67+ "haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}-profiling"
68+ else if !enableLibraryProfiling && self.enableSharedLibraries then
69+ "haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}-shared"
70+ else
71+ "haskell-${self.pname}-ghcjs${ghc.ghc.version}-${self.version}"
72+ else
73+ "${self.pname}-${self.version}";
74+
75+ # the default download location for Cabal packages is Hackage,
76+ # you still have to specify the checksum
77+ src = fetchurl {
78+ url = "mirror://hackage/${self.pname}/${self.fname}.tar.gz";
79+ inherit (self) sha256;
80+ };
81+
82+ # default buildInputs are just ghc, if more buildInputs are required
83+ # buildInputs can be extended by the client by using extraBuildInputs,
84+ # but often propagatedBuildInputs is preferable anyway
85+ buildInputs = [ghc ghc.ghc.parent.Cabal_HEAD] ++ self.extraBuildInputs;
86+ extraBuildInputs = self.buildTools ++
87+ (optionals self.doCheck self.testDepends) ++
88+ (if self.pkgconfigDepends == [] then [] else [pkgconfig]) ++
89+ (if self.isLibrary then [] else self.buildDepends ++ self.extraLibraries ++ self.pkgconfigDepends);
90+
91+ # we make sure that propagatedBuildInputs is defined, so that we don't
92+ # have to check for its existence
93+ propagatedBuildInputs = if self.isLibrary then self.buildDepends ++ self.extraLibraries ++ self.pkgconfigDepends else [];
94+
95+ # By default, also propagate all dependencies to the user environment. This is required, otherwise packages would be broken, because
96+ # GHC also needs all dependencies to be available.
97+ propagatedUserEnvPkgs = if self.isLibrary then self.buildDepends else [];
98+
99+ # library directories that have to be added to the Cabal files
100+ extraLibDirs = [];
101+
102+ # build-depends Cabal field
103+ buildDepends = [];
104+
105+ # target(s) passed to the cabal build phase as an argument
106+ buildTarget = "";
107+
108+ # build-depends Cabal fields stated in test-suite stanzas
109+ testDepends = [];
110+
111+ # target(s) passed to the cabal test phase as an argument
112+ testTarget = "";
113+
114+ # build-tools Cabal field
115+ buildTools = [];
116+
117+ # extra-libraries Cabal field
118+ extraLibraries = [];
119+
120+ # pkgconfig-depends Cabal field
121+ pkgconfigDepends = [];
122+
123+ isLibrary = ! self.isExecutable;
124+ isExecutable = false;
125+
126+ # ignore version restrictions on the build inputs that the cabal file might specify
127+ jailbreak = false;
128+
129+ # pass the '--enable-split-objs' flag to cabal in the configure stage
130+ enableSplitObjs = false; # !stdenv.isDarwin; # http://hackage.haskell.org/trac/ghc/ticket/4013
131+
132+ # pass the '--enable-tests' flag to cabal in the configure stage
133+ # and run any regression test suites the package might have
134+ doCheck = false; #enableCheckPhase;
135+
136+ # pass the '--hyperlink-source' flag to ./Setup haddock
137+ hyperlinkSource = enableHyperlinkSource;
138+
139+ # abort the build if the configure phase detects that the package
140+ # depends on multiple versions of the same build input
141+ strictConfigurePhase = true;
142+
143+ # pass the '--enable-library-vanilla' flag to cabal in the
144+ # configure stage to enable building shared libraries
145+ inherit enableStaticLibraries;
146+
147+ # pass the '--enable-shared' flag to cabal in the configure
148+ # stage to enable building shared libraries
149+ inherit enableSharedLibraries;
150+
151+ # pass the '--enable-executable-dynamic' flag to cabal in
152+ # the configure stage to enable linking shared libraries
153+ inherit enableSharedExecutables;
154+
155+ extraConfigureFlags = [
156+ (enableFeature self.enableSplitObjs "split-objs")
157+ (enableFeature enableLibraryProfiling "library-profiling")
158+ (enableFeature true "shared")
159+ (optional (versionOlder "7" ghc.version) (enableFeature self.enableStaticLibraries "library-vanilla"))
160+ (optional (versionOlder "7.4" ghc.version) (enableFeature self.enableSharedExecutables "executable-dynamic"))
161+ (optional (versionOlder "7" ghc.version) (enableFeature self.doCheck "tests"))
162+ ];
163+
164+ # GHC needs the locale configured during the Haddock phase.
165+ LANG = "en_US.UTF-8";
166+ LOCALE_ARCHIVE = optionalString stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
167+
168+ # compiles Setup and configures
169+ configurePhase = ''
170+ eval "$preConfigure"
171+
172+ ${optionalString self.jailbreak "${ghc.ghc.parent.jailbreakCabal}/bin/jailbreak-cabal ${self.pname}.cabal"}
173+
174+ PATH=$PATH:${ghc.ghc.ghc}/bin
175+
176+ for i in Setup.hs Setup.lhs ${defaultSetupHs}; do
177+ test -f $i && break
178+ done
179+ ghc --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
180+
181+ for p in $extraBuildInputs $propagatedBuildInputs $propagatedNativeBuildInputs; do
182+ PkgDir="$p/lib/ghcjs-${ghc.ghc.version}_ghc-${ghc.ghc.ghc.version}/package.conf.d"
183+ if [ -f "$PkgDir/package.cache" ]; then
184+ extraConfigureFlags+=" --package-db=$PkgDir"
185+ continue;
186+ fi
187+ if [ -d "$p/include" ]; then
188+ extraConfigureFlags+=" --extra-include-dirs=$p/include"
189+ fi
190+ for d in lib{,64}; do
191+ if [ -d "$p/$d" ]; then
192+ extraConfigureFlags+=" --extra-lib-dirs=$p/$d"
193+ fi
194+ done
195+ done
196+
197+ configureFlags+=" --package-db=${ghc.ghc}/${ghc.ghc.libDir}/package.conf.d"
198+
199+ ${optionalString (self.enableSharedExecutables && self.stdenv.isLinux) ''
200+ configureFlags+=" --ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.ghc.name}/${self.pname}-${self.version}";
201+ ''}
202+ ${optionalString (self.enableSharedExecutables && self.stdenv.isDarwin) ''
203+ configureFlags+=" --ghc-option=-optl=-Wl,-headerpad_max_install_names";
204+ ''}
205+
206+ echo "configure flags: $extraConfigureFlags $configureFlags"
207+ ./Setup configure --ghcjs --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \
208+ --libsubdir='$pkgid' $extraConfigureFlags $configureFlags 2>&1 \
209+ ${optionalString self.strictConfigurePhase ''
210+ | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log"
211+ if ${gnugrep}/bin/egrep -q '^Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
212+ echo >&2 "*** abort because of serious configure-time warning from Cabal"
213+ exit 1
214+ fi
215+ ''}
216+
217+ eval "$postConfigure"
218+ '';
219+
220+ # builds via Cabal
221+ buildPhase = ''
222+ eval "$preBuild"
223+
224+ ./Setup build ${self.buildTarget}
225+
226+ export GHC_PACKAGE_PATH=$(${ghc.GHCPackages})
227+ #test -n "$noHaddock" || ./Setup haddock --html --hoogle \
228+ # ${optionalString self.hyperlinkSource "--hyperlink-source"}
229+
230+ eval "$postBuild"
231+ '';
232+
233+ checkPhase = optional self.doCheck ''
234+ eval "$preCheck"
235+
236+ ./Setup test ${self.testTarget}
237+
238+ eval "$postCheck"
239+ '';
240+
241+ # installs via Cabal; creates a registration file for nix-support
242+ # so that the package can be used in other Haskell-builds; also
243+ # adds all propagated build inputs to the user environment packages
244+ installPhase = ''
245+ eval "$preInstall"
246+
247+ ./Setup copy
248+
249+ mkdir -p $out/bin # necessary to get it added to PATH
250+
251+ local confDir=$out/lib/ghcjs-${ghc.ghc.version}_ghc-${ghc.ghc.ghc.version}/package.conf.d
252+ local installedPkgConf=$confDir/${self.fname}.installedconf
253+ local pkgConf=$confDir/${self.fname}.conf
254+ mkdir -p $confDir
255+ ./Setup register --gen-pkg-config=$pkgConf
256+ if test -f $pkgConf; then
257+ echo '[]' > $installedPkgConf
258+ GHC_PACKAGE_PATH=$installedPkgConf ghcjs-pkg --global register $pkgConf --force --package-db=$confDir || true
259+ ghcjs-pkg recache --package-db=$confDir
260+ fi
261+
262+ if test -f $out/nix-support/propagated-native-build-inputs; then
263+ ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
264+ fi
265+
266+ ${optionalString (self.enableSharedExecutables && self.isExecutable && self.stdenv.isDarwin) ''
267+ for exe in $out/bin/* ; do
268+ 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
269+ done
270+ ''}
271+
272+ eval "$postInstall"
273+ '';
274+
275+ # We inherit stdenv and ghc so that they can be used
276+ # in Cabal derivations.
277+ inherit stdenv ghc;
278+ };
279+ in
280+ stdenv.mkDerivation (postprocess (let super = defaults self // args self;
281+ self = super // extension self super;
282+ in self));
283+}
pkgs/development/compilers/elm/elm-reactor.nix+1
@@ -22,5 +22,6 @@ cabal.mkDerivation (self: {
2222 description = "Interactive development tool for Elm programs";
2323 license = self.stdenv.lib.licenses.bsd3;
2424 platforms = self.ghc.meta.platforms;
25+ broken = true;
2526 };
2627})
pkgs/development/compilers/ghcjs/default.nixnew file+90
@@ -0,0 +1,90 @@
1+{ nodejs, cabal, filepath, HTTP, HUnit, mtl, network, QuickCheck, random, stm
2+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2, time
3+, zlib, aeson, attoparsec, bzlib, dataDefault, ghcPaths, hashable
4+, haskellSrcExts, haskellSrcMeta, lens, optparseApplicative
5+, parallel, safe, shelly, split, stringsearch, syb, systemFileio
6+, systemFilepath, tar, terminfo, textBinary, unorderedContainers
7+, vector, wlPprintText, yaml, fetchgit, Cabal, cabalInstall
8+, regexPosix, alex, happy, git, gnumake, gcc, autoconf, patch
9+, automake, libtool, gmp, base16Bytestring
10+, cryptohash, executablePath, transformersCompat, haddockApi
11+, haddock, hspec, xhtml, primitive, cacert, pkgs, ghc
12+, coreutils
13+, ghcjsPrim
14+}:
15+let
16+ version = "0.1.0";
17+ libDir = "share/ghcjs/${pkgs.stdenv.system}-${version}-${ghc.ghc.version}/ghcjs";
18+ ghcjsBoot = fetchgit {
19+ url = git://github.com/ghcjs/ghcjs-boot.git;
20+ rev = "5c7a71472d5a797e895914d3b82cea447a058793";
21+ sha256 = "0dp97bgbnlr3sd9yfnk27p6dfv46fi26sn6y6qv1wxs5i29kmjav";
22+ };
23+ shims = fetchgit {
24+ url = git://github.com/ghcjs/shims.git;
25+ rev = "99bbd4bed584ec42bfcc5ea61c3808a2c670053d";
26+ sha256 = "1my3gqkln7hgm0bpy32pnhwjfza096alh0n9x9ny8xfpxhmzz4h6";
27+ };
28+in cabal.mkDerivation (self: rec {
29+ pname = "ghcjs";
30+ inherit version;
31+ src = fetchgit {
32+ url = git://github.com/ghcjs/ghcjs.git;
33+ rev = "4b9461e8be646d5152a0ae7ece5b3616bf938637";
34+ sha256 = "19g62j1kkdwcgp0042ppmskwbvfk7qkf1fjs8bpjc6wwd19ipiar";
35+ };
36+ isLibrary = true;
37+ isExecutable = true;
38+ jailbreak = true;
39+ noHaddock = true;
40+ doCheck = false;
41+ buildDepends = [
42+ filepath HTTP mtl network random stm time zlib aeson attoparsec
43+ bzlib dataDefault ghcPaths hashable haskellSrcExts haskellSrcMeta
44+ lens optparseApplicative parallel safe shelly split
45+ stringsearch syb systemFileio systemFilepath tar terminfo textBinary
46+ unorderedContainers vector wlPprintText yaml
47+ alex happy git gnumake gcc autoconf automake libtool patch gmp
48+ base16Bytestring cryptohash executablePath haddockApi
49+ transformersCompat QuickCheck haddock hspec xhtml
50+ ghcjsPrim regexPosix
51+ ];
52+ buildTools = [ nodejs git ];
53+ testDepends = [
54+ HUnit testFramework testFrameworkHunit
55+ ];
56+ patches = [ ./ghcjs.patch ];
57+ postPatch = ''
58+ substituteInPlace Setup.hs --replace "/usr/bin/env" "${coreutils}/bin/env"
59+ substituteInPlace src/Compiler/Info.hs --replace "@PREFIX@" "$out"
60+ substituteInPlace src-bin/Boot.hs --replace "@PREFIX@" "$out"
61+ '';
62+ preBuild = ''
63+ local topDir=$out/${libDir}
64+ mkdir -p $topDir
65+
66+ cp -r ${ghcjsBoot} $topDir/ghcjs-boot
67+ chmod -R u+w $topDir/ghcjs-boot
68+
69+ cp -r ${shims} $topDir/shims
70+ chmod -R u+w $topDir/shims
71+ '';
72+ postInstall = ''
73+ PATH=$out/bin:${Cabal}/bin:$PATH LD_LIBRARY_PATH=${gmp}/lib:${gcc.gcc}/lib64:$LD_LIBRARY_PATH \
74+ env -u GHC_PACKAGE_PATH $out/bin/ghcjs-boot \
75+ --dev \
76+ --with-cabal ${cabalInstall}/bin/cabal \
77+ --with-gmp-includes ${gmp}/include \
78+ --with-gmp-libraries ${gmp}/lib
79+ '';
80+ passthru = {
81+ inherit libDir;
82+ };
83+ meta = {
84+ homepage = "https://github.com/ghcjs/ghcjs";
85+ description = "GHCJS is a Haskell to JavaScript compiler that uses the GHC API";
86+ license = self.stdenv.lib.licenses.bsd3;
87+ platforms = self.ghc.meta.platforms;
88+ maintainers = [ self.stdenv.lib.maintainers.jwiegley ];
89+ };
90+})
pkgs/development/compilers/ghcjs/ghcjs.patchnew file+72
@@ -0,0 +1,72 @@
1+diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
2+index 988955b..a55f07b 100644
3+--- a/src-bin/Boot.hs
4++++ b/src-bin/Boot.hs
5+@@ -512,9 +512,7 @@ initPackageDB :: B ()
6+ initPackageDB = do
7+ msg info "creating package databases"
8+ initDB "--global" <^> beLocations . blGlobalDB
9+- traverseOf_ _Just initUser <^> beLocations . blUserDBDir
10+ where
11+- initUser dir = rm_f (dir </> "package.conf") >> initDB "--user" (dir </> "package.conf.d")
12+ initDB dbName db = do
13+ rm_rf db >> mkdir_p db
14+ ghcjs_pkg_ ["init", toTextI db] `catchAny_` return ()
15+@@ -538,29 +536,22 @@ installDevelopmentTree = subTop $ do
16+ msgD info $ "preparing development boot tree"
17+ checkpoint' "ghcjs-boot-git" "ghcjs-boot repository already cloned and prepared" $ do
18+ testGit "ghcjs-boot" >>= \case
19+- Just False -> failWith "ghcjs-boot already exists and is not a git repository"
20+- Just True -> do
21+- msg info "ghcjs-boot repository already exists but checkpoint not reached, cleaning first, then cloning"
22+- rm_rf "ghcjs-boot"
23++ Just _ -> do
24++ msg info "ghcjs-boot repository already exists; initializing ghcjs-boot"
25+ initGhcjsBoot
26+ Nothing -> do
27+ msgD info "cloning ghcjs-boot git repository"
28+ initGhcjsBoot
29+ checkpoint' "shims-git" "shims repository already cloned" $ do
30+ testGit "shims" >>= \case
31+- Just False -> failWith "shims already exists and is not a git repository"
32+- Just True -> do
33+- msgD info "shims repository already exists but checkpoint not reached, cleaning first, then cloning"
34+- rm_rf "shims"
35+- cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
36++ Just _ -> do
37++ msgD info "shims repository already exists; moving on"
38+ Nothing -> do
39+ msgD info "cloning shims git repository"
40+ cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
41+ where
42+ initGhcjsBoot = sub $ do
43+- cloneGit bootDescr "ghcjs-boot" bsrcBootDevBranch bsrcBootDev
44+ cd "ghcjs-boot"
45+- git_ ["submodule", "update", "--init", "--recursive"]
46+ mapM_ patchPackage =<< allPackages
47+ preparePrimops
48+ buildGenPrim
49+@@ -1086,7 +1077,9 @@ cabalInstallFlags parmakeGhcjs = do
50+ , "--builddir", "dist"
51+ , "--with-compiler", ghcjs ^. pgmLocText
52+ , "--with-hc-pkg", ghcjsPkg ^. pgmLocText
53+- , "--prefix", toTextI instDir
54++ , "--prefix", "@PREFIX@"
55++ , "--libdir", "$prefix/lib/$compiler"
56++ , "--libsubdir", "$pkgid"
57+ , bool haddock "--enable-documentation" "--disable-documentation"
58+ , "--haddock-html"
59+ -- workaround for hoogle support being broken in haddock for GHC 7.10RC1
60+diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
61+index 33a401f..5d09c86 100644
62+--- a/src/Compiler/Info.hs
63++++ b/src/Compiler/Info.hs
64+@@ -49,7 +49,7 @@ compilerInfo nativeToo dflags = do
65+ -- | the directory to use if started without -B flag
66+ getDefaultTopDir :: IO FilePath
67+ getDefaultTopDir = do
68+- appdir <- getAppUserDataDirectory "ghcjs"
69++ let appdir = "@PREFIX@/share/ghcjs"
70+ return (appdir </> subdir </> "ghcjs")
71+ where
72+ targetARCH = arch
pkgs/development/compilers/ghcjs/wrapper.nixnew file+77
@@ -0,0 +1,77 @@
1+{ stdenv, ghc, makeWrapper, coreutils, writeScript }:
2+let
3+ ghcjs = ghc;
4+ packageDBFlag = "-package-db";
5+
6+ GHCGetPackages = writeScript "ghc-get-packages.sh" ''
7+ #! ${stdenv.shell}
8+ # Usage:
9+ # $1: version of GHC
10+ # $2: invocation path of GHC
11+ # $3: prefix
12+ version="$1"
13+ if test -z "$3"; then
14+ prefix="${packageDBFlag} "
15+ else
16+ prefix="$3"
17+ fi
18+ PATH="$PATH:$2"
19+ IFS=":"
20+ for p in $PATH; do
21+ 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
22+ # output takes place here
23+ test -f $i/package.cache && echo -n " $prefix$i"
24+ done
25+ done
26+ '';
27+
28+ GHCPackages = writeScript "ghc-packages.sh" ''
29+ #! ${stdenv.shell} -e
30+ declare -A GHC_PACKAGES_HASH # using bash4 hashs to get uniq paths
31+
32+ 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?
33+ case "$arg" in
34+ ${packageDBFlag}) ;;
35+ *)
36+ CANONICALIZED="$(${coreutils}/bin/readlink -f -- "$arg")"
37+ GHC_PACKAGES_HASH["$CANONICALIZED"]= ;;
38+ esac
39+ done
40+
41+ for path in ''${!GHC_PACKAGES_HASH[@]}; do
42+ echo -n "$path:"
43+ done
44+ '';
45+in
46+stdenv.mkDerivation {
47+ name = "ghcjs-ghc${ghcjs.ghc.version}-${ghcjs.version}-wrapper";
48+
49+ buildInputs = [makeWrapper];
50+ propagatedBuildInputs = [ghcjs];
51+
52+ unpackPhase = "true";
53+ installPhase = ''
54+ runHook preInstall
55+
56+ mkdir -p $out/bin
57+ for prg in ghcjs ; do
58+ makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$(${GHCGetPackages} ${ghcjs.version} \"\$(dirname \$0)\")"
59+ done
60+ for prg in ghcjs-pkg ; do
61+ makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$(${GHCGetPackages} ${ghcjs.version} \"\$(dirname \$0)\" -${packageDBFlag}=)"
62+ done
63+
64+ mkdir -p $out/nix-support
65+ ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
66+
67+ mkdir -p $out/share/doc
68+ ln -s $ghc/lib $out/lib
69+ ln -s $ghc/share/doc/ghc $out/share/doc/ghc-${ghcjs.version}
70+
71+ runHook postInstall
72+ '';
73+
74+ ghc = ghcjs;
75+ inherit GHCGetPackages GHCPackages;
76+ inherit (ghcjs) meta version;
77+}
pkgs/development/libraries/haskell/Cabal/head.nixnew file+26
@@ -0,0 +1,26 @@
1+{ cabal, filepath, HTTP, HUnit, mtl, network, QuickCheck
2+, random, stm, testFramework, testFrameworkHunit
3+, testFrameworkQuickcheck2, time, zlib, fetchgit
4+}:
5+
6+cabal.mkDerivation (self: {
7+ pname = "Cabal";
8+ version = "HEAD";
9+ src = fetchgit {
10+ url = git://github.com/haskell/cabal.git;
11+ rev = "699d4df12e1ec75e9100b521fb3690eaa6986635";
12+ sha256 = "112wz0mq7b0hvlj69imnwja2n4kv75m49yy5y8924gik9801zjba";
13+ };
14+ preConfigure = "cd Cabal";
15+
16+ doCheck = false;
17+ noHaddock = true;
18+
19+ buildDepends = [
20+ filepath HTTP mtl network random stm time zlib QuickCheck
21+ ];
22+ testDepends = [
23+ filepath HTTP HUnit mtl network QuickCheck stm testFramework
24+ testFrameworkHunit testFrameworkQuickcheck2 time zlib
25+ ];
26+})
pkgs/development/libraries/haskell/ghcjs-dom/default.nix+2−2
@@ -4,8 +4,8 @@
44
55cabal.mkDerivation (self: {
66 pname = "ghcjs-dom";
7− version = "0.1.1.1";
8− sha256 = "0fwwm658gf4fp32zmfskfayi480ddsf40y2cfla88a7l1rbacwif";
7+ version = "0.1.1.3";
8+ sha256 = "0pdxb2s7fflrh8sbqakv0qi13jkn3d0yc32xhg2944yfjg5fvlly";
99 buildDepends = [ ghcjsBase mtl text ];
1010 meta = {
1111 description = "DOM library that supports both GHCJS and WebKitGTK";
pkgs/development/libraries/haskell/ghcjs-prim/default.nixnew file+12
@@ -0,0 +1,12 @@
1+{ cabal, primitive, fetchgit }:
2+
3+cabal.mkDerivation (self: {
4+ pname = "ghcjs-prim";
5+ version = "0.1.0.0";
6+ src = fetchgit {
7+ url = git://github.com/ghcjs/ghcjs-prim.git;
8+ rev = "8e003e1a1df10233bc3f03d7bbd7d37de13d2a84";
9+ sha256 = "11k2r87s58wmpxykn61lihn4vm3x67cm1dygvdl26papifinj6pz";
10+ };
11+ buildDepends = [ primitive ];
12+})
pkgs/development/libraries/haskell/hask/default.nix+1
@@ -12,5 +12,6 @@ cabal.mkDerivation (self: {
1212 description = "Categories";
1313 license = self.stdenv.lib.licenses.bsd3;
1414 platforms = self.ghc.meta.platforms;
15+ broken = true;
1516 };
1617})
pkgs/development/libraries/haskell/webkit/default.nix+2−2
@@ -6,8 +6,8 @@
66
77cabal.mkDerivation (self: {
88 pname = "webkit";
9− version = "0.13.0.3";
10− sha256 = "0l05cg6krafpcfszcka03x7gay8wg1fhd0gpbn2cchfshfkicgxc";
9+ version = "0.13.1.1";
10+ sha256 = "0652as9wq0ajaqmcx14y2svishccgrywyagrbzga7m06r3h94dz5";
1111 buildDepends = [ cairo glib gtk mtl pango text ];
1212 buildTools = [ gtk2hsBuildtools ];
1313 pkgconfigDepends = [ webkit ];
pkgs/tools/package-management/cabal-install/head.nixnew file+33
@@ -0,0 +1,33 @@
1+{ cabal, Cabal, filepath, HTTP, HUnit, mtl, network, QuickCheck
2+, random, stm, testFramework, testFrameworkHunit
3+, testFrameworkQuickcheck2, time, zlib, fetchgit
4+}:
5+
6+cabal.mkDerivation (self: {
7+ pname = "cabal-install";
8+ version = "HEAD";
9+ src = Cabal.src;
10+ isLibrary = true;
11+ isExecutable = true;
12+ doCheck = false;
13+ preConfigure = "cd cabal-install";
14+ noHaddock = true;
15+ buildDepends = [
16+ Cabal filepath HTTP mtl network random stm time zlib
17+ ];
18+ testDepends = [
19+ Cabal filepath HTTP HUnit mtl network QuickCheck stm testFramework
20+ testFrameworkHunit testFrameworkQuickcheck2 time zlib
21+ ];
22+ postInstall = ''
23+ mkdir $out/etc
24+ mv bash-completion $out/etc/bash_completion.d
25+ '';
26+ meta = {
27+ homepage = "http://www.haskell.org/cabal/";
28+ description = "The command-line interface for Cabal and Hackage";
29+ license = self.stdenv.lib.licenses.bsd3;
30+ platforms = self.ghc.meta.platforms;
31+ maintainers = [ self.stdenv.lib.maintainers.andres ];
32+ };
33+})
pkgs/top-level/all-packages.nix+1
@@ -3374,6 +3374,7 @@ let
33743374 haskellPackages_ghc784_profiling = recurseIntoAttrs haskell.packages_ghc784.profiling;
33753375 haskellPackages_ghc784 = recurseIntoAttrs haskell.packages_ghc784.highPrio;
33763376 haskellPackages_ghcHEAD = haskell.packages_ghcHEAD;
3377+ haskellPackages_ghcjs = haskell.packages_ghcjs;
33773378
33783379 haxe = callPackage ../development/compilers/haxe { };
33793380
pkgs/top-level/haskell-defaults.nix+74
@@ -17,6 +17,15 @@
1717 ghcHEADPrefs = self : super : super // {
1818 cabalInstall_1_20_0_4 = super.cabalInstall_1_20_0_4.override { Cabal = null; };
1919 mtl = self.mtl_2_2_1;
20+ ghcjsBase = null;
21+ ghcjsDom = with self; super.ghcjsDom.override {
22+ cabal = self.cabal.override {
23+ extension = self: super: {
24+ configureFlags = [ "-f-ghcjs" "-fwebkit" "-f-gtk3" ];
25+ buildDepends = [ mtl glib transformers gtk webkit ];
26+ };
27+ };
28+ };
2029 };
2130
2231 ghc784Prefs = self : super : ghcHEADPrefs self super // {
@@ -232,6 +241,71 @@
232241 prefFun = ghc784Prefs;
233242 };
234243
244+ packages_ghcjs =
245+ packages {
246+ ghcPath = ../development/compilers/ghc/7.8.4.nix;
247+ ghcBinary = if stdenv.isDarwin then ghc783Binary else ghc742Binary;
248+ prefFun = self : super : super // {
249+ ghc = let parent = packages_ghc784; in
250+ callPackage ../development/compilers/ghcjs/wrapper.nix {
251+ ghc = parent.ghcjs // { inherit parent; };
252+ };
253+ cabal = self.cabalJs;
254+ buildLocalCabalWithArgs = args: super.buildLocalCabalWithArgs (args // {
255+ nativePkgs = packages_ghc784;
256+ });
257+ ghcjsDom = with self; super.ghcjsDom.override {
258+ cabal = self.cabal.override {
259+ extension = self: super: {
260+ configureFlags = [ ];
261+ buildDepends = [ mtl ghcjsBase ];
262+ };
263+ };
264+ };
265+ # This is the list of packages that are built into a booted ghcjs installation
266+ # It can be generated with the command:
267+ # 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;/'"
268+ Cabal = null;
269+ aeson = null;
270+ array = null;
271+ async = null;
272+ attoparsec = null;
273+ base = null;
274+ binary = null;
275+ rts = null;
276+ bytestring = null;
277+ caseInsensitive = null;
278+ containers = null;
279+ deepseq = null;
280+ directory = null;
281+ dlist = null;
282+ extensibleExceptions = null;
283+ filepath = null;
284+ ghcPrim = null;
285+ ghcjsBase = null;
286+ ghcjsPrim = null;
287+ hashable = null;
288+ integerGmp = null;
289+ mtl = null;
290+ oldLocale = null;
291+ oldTime = null;
292+ parallel = null;
293+ pretty = null;
294+ primitive = null;
295+ process = null;
296+ scientific = null;
297+ stm = null;
298+ syb = null;
299+ templateHaskell = null;
300+ text = null;
301+ time = null;
302+ transformers = null;
303+ unix = null;
304+ unorderedContainers = null;
305+ vector = null;
306+ };
307+ };
308+
235309 packages_ghc763 =
236310 packages { ghcPath = ../development/compilers/ghc/7.6.3.nix;
237311 ghcBinary = ghc704Binary;
pkgs/top-level/haskell-packages.nix+22−1
@@ -103,6 +103,15 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
103103 extension = self : super : {};
104104 };
105105
106+ cabalJs = callPackage ../build-support/cabal/ghcjs.nix {
107+ Cabal = null; # prefer the Cabal version shipped with the compiler
108+ hscolour = self.hscolourBootstrap;
109+ inherit enableLibraryProfiling enableCheckPhase
110+ enableStaticLibraries enableSharedLibraries enableSharedExecutables;
111+ glibcLocales = if pkgs.stdenv.isLinux then pkgs.glibcLocales else null;
112+ extension = self : super : {};
113+ };
114+
106115 # A variant of the cabal build driver that disables unit testing.
107116 # Useful for breaking cycles, where the unit test of a package A
108117 # 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
356365 Cabal_1_16_0_3 = callPackage ../development/libraries/haskell/Cabal/1.16.0.3.nix {};
357366 Cabal_1_18_1_3 = callPackage ../development/libraries/haskell/Cabal/1.18.1.3.nix {};
358367 Cabal_1_20_0_2 = callPackage ../development/libraries/haskell/Cabal/1.20.0.2.nix {};
368+ Cabal_HEAD = callPackage ../development/libraries/haskell/Cabal/head.nix {};
359369 Cabal = null; # core package since forever
360370
361371 cabalCargs = callPackage ../development/libraries/haskell/cabal-cargs {};
@@ -942,10 +952,20 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
942952
943953 ghcid = callPackage ../development/tools/haskell/ghcid {};
944954
945− ghcjsDom = callPackage ../development/libraries/haskell/ghcjs-codemirror {};
955+ ghcjs = callPackage ../development/compilers/ghcjs {
956+ Cabal = self.Cabal_HEAD;
957+ cabalInstall = self.cabalInstall_HEAD;
958+ haddock = self.haddock.override {
959+ Cabal = null;
960+ };
961+ };
962+
963+ ghcjsDom = callPackage ../development/libraries/haskell/ghcjs-dom {};
946964
947965 ghcjsCodemirror = callPackage ../development/libraries/haskell/ghcjs-codemirror {};
948966
967+ ghcjsPrim = callPackage ../development/libraries/haskell/ghcjs-prim {};
968+
949969 ghcMod = callPackage ../development/libraries/haskell/ghc-mod { inherit (pkgs) emacs; };
950970
951971 ghcMtl = callPackage ../development/libraries/haskell/ghc-mtl {};
@@ -3163,6 +3183,7 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
31633183 cabalInstall_1_16_0_2 = callPackage ../tools/package-management/cabal-install/1.16.0.2.nix { Cabal = self.Cabal_1_16_0_3; };
31643184 cabalInstall_1_18_0_3 = callPackage ../tools/package-management/cabal-install/1.18.0.3.nix { Cabal = self.Cabal_1_18_1_3; };
31653185 cabalInstall_1_20_0_4 = callPackage ../tools/package-management/cabal-install/1.20.0.4.nix { Cabal = self.Cabal_1_20_0_2; };
3186+ cabalInstall_HEAD = callPackage ../tools/package-management/cabal-install/head.nix { Cabal = self.Cabal_HEAD; };
31663187 cabalInstall = self.cabalInstall_1_20_0_4;
31673188
31683189 codex = callPackage ../development/tools/haskell/codex {};