]> hydra-www.ietfng.org Git - dyna2/commitdiff
Make a 'misc/' folder for odds and ends
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 21 May 2013 21:22:33 +0000 (17:22 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Thu, 23 May 2013 04:19:27 +0000 (00:19 -0400)
Move HaddockPaths and vimrc there; add GHC bootstrapping script for
safe-keeping.

Makefile
README.md
misc/HaddockPaths.hs [moved from src/Dyna/XXX/HaddockPaths.hs with 98% similarity]
misc/ghc-bootstrap.sh [new file with mode: 0644]
misc/vimrc [moved from vimrc with 100% similarity]

index a74250d0064139507bde63ca503213ea2d9744f1..b083392241c193a7f11e410bf529dd8dfd2d52c6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ haddock:
        haddock --html -o dist/alldoc \
         --ignore-all-exports -w --optghc=-isrc \
         -t "Dyna -- GIT `git describe --always`" \
-        `runghc -isrc Dyna.XXX.HaddockPaths "$(HADDOCK_HTML)"` \
+        `runghc -imisc HaddockPaths "$(HADDOCK_HTML)"` \
         `grep -ie '^\( \|\t\)*main-is:' dyna.cabal | sed -e "s/^.*Is: */src\//"`
 
 # If the cabal file doesn't do the right thing, this tries to work through
index 75524ea1e6f2cbfed45f577ef019d21c75d706b4..60a9a4fc9ce18b1f7366be9a829d9ce2066b2688 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,6 +5,7 @@ An overview of the source tree
     *  expected/       -- Expected output for self-tests.  Named by program and backend, both.
 * external/
     * damsl-k3         -- The DAMSL K3 tree, tracked as a git submodule.
+* misc/                -- Pretty much what it says on the tin
 * src/Dyna/
     * Analysis         -- The heart of the compiler
         * Mode         -- A re-implementation of the Mercury mode system
similarity index 98%
rename from src/Dyna/XXX/HaddockPaths.hs
rename to misc/HaddockPaths.hs
index 62e36b088845eaf81d667343b7de54ba321192be..e24922060ef3ecffb44cafdcb5e1761d0ad91d9e 100644 (file)
@@ -10,7 +10,7 @@
 -- the same license as Cabal.
 
 {-# LANGUAGE ScopedTypeVariables #-}
-module Dyna.XXX.HaddockPaths where
+module HaddockPaths where
 
 import           Control.Monad
 import           Data.Either
diff --git a/misc/ghc-bootstrap.sh b/misc/ghc-bootstrap.sh
new file mode 100644 (file)
index 0000000..1162bf2
--- /dev/null
@@ -0,0 +1,117 @@
+#!/bin/bash
+
+# This script is useful for bringing up a Haskell world on a machine which
+# doesn't have one (use the ghc tarballs) or to bring one up from source.
+# Written because I was tracking ghc HEAD for a while, but stuck here
+# because it's proven itself useful to bring up a Dyna-capable environment
+# on a few machines.
+
+GHCVER=7.6.3
+
+HTMLROOT="../../"
+
+CABAL_BOOTSTRAP_PKGS="transformers-0.3.0.0 \
+         mtl-2.1.2 \
+         text-0.11.2.3 \
+         zlib-0.5.4.0 \
+         parsec-3.1.3 \
+         network-2.4.1.0 \
+         random-1.0.1.1 \
+         HTTP-4000.2.6 \
+         cabal-install-1.16.0.2"
+
+HROOT=$HOME/src/haskell
+HPATH=$HROOT/_inst
+HBIN=$HPATH/bin
+HLIB=$HPATH/lib/ghc-$GHCVER
+
+export CABALOPTS_BOOTSTRAP="--prefix=$HPATH --global --enable-library-profiling"
+export CABALOPTS="--prefix=$HPATH --global --enable-library-profiling \
+                  --haddock-html --haddock-html-location=${HTMLROOT}/\$pkgid/html/"
+
+export PATH=$HBIN:$PATH
+
+# Enable some hackery around library files being misnamed
+export LD_LIBRARY_PATH=$HLIB${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+
+CMD=$1;
+shift;
+
+case $CMD in
+    install)
+    $HBIN/cabal install $CABALOPTS --global $@;
+    ;;
+
+    buildpwd)
+    $HBIN/runghc Setup configure $CABALOPTS --global $@ &&
+    $HBIN/runghc Setup build &&
+    $HBIN/runghc Setup install
+    ;;
+
+    run)
+    export PREFIX=$HPATH
+    $@
+    ;;
+
+    reinstall)
+    export PREFIX=$HPATH
+    cd $HROOT
+    rm -rf _inst &&
+    (cd ghc-$GHCVER;
+        (./boot || exit 0) &&
+        ./configure --prefix=$PREFIX &&
+        if [ -x ./boot]; then make -j 12 all; fi ) && 
+    (cd ghc-$GHCVER; make install) &&
+        # Hack around Debian's foolishness
+    (ln -s /usr/lib/libgmp.so.? _inst/lib/ghc-$GHCVER/libgmp.so) &&
+        # Bootstrap cabal-install
+    (cd pkgs; for i in $CABAL_BOOTSTRAP_PKGS ;
+      do (cd $i; $HBIN/runghc Setup configure $CABALOPTS_BOOTSTRAP;
+                 $HBIN/runghc Setup build;
+                 $HBIN/runghc Setup install)
+      done) &&
+        # Now, reinstall so that we get documentation
+    (cd pkgs; for i in $CABAL_BOOTSTRAP_PKGS;
+      do (cd $i; $HBIN/cabal install $CABALOPTS --force-reinstalls); done) &&
+        # And last, build everything else we need out of cabal
+    $HBIN/cabal update &&
+        # Pull in the packages on which Dyna will depend as well as 
+    $HBIN/cabal install $CABALOPTS -j12 \
+        blaze-builder \
+        blaze-html \
+        charset \
+        criterion \
+        either \
+        fingertree \
+        fingertree-psqueue \
+        haskeline \
+        HUnit \
+        keys \
+        lens \
+        MonadCatchIO-transformers \
+        pandoc \
+        recursion-schemes \
+        reducers \
+        'semigroups>=0.9' \
+        tagged \
+        terminfo \
+        trifecta \
+        test-framework \
+        test-framework-golden \
+        test-framework-hunit \
+        test-framework-quickcheck2 \
+        test-framework-smallcheck \
+        test-framework-th \
+        unordered-containers \
+        unification-fd \
+        utf8-string \
+        wl-pprint-extras \
+        wl-pprint-terminfo &&
+        # Link in some documentation from the GHC-bundled libraries just so we have a complete list
+    (cd _inst/share/doc; find ghc/html/libraries/ -maxdepth 1 -type d -exec ln -s {} . \; -exec ln -s . {}/html \;)
+    ;;   
+
+    *)
+    echo "I'm sorry, Dave?"
+    ;;
+esac
similarity index 100%
rename from vimrc
rename to misc/vimrc