Last active
October 9, 2018 02:02
-
-
Save satosystems/a48e8c8f3733739d79cc to your computer and use it in GitHub Desktop.
さくらのレンタルサーバ スタンダードに Haskell 環境を構築する手順 ref: https://qiita.com/satosystems/items/22db821b2f9e447feed3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias cabal='TMPDIR=~/.tmp LANG=en_US.UTF-8 cabal' | |
export PATH=$HOME/usr/bin:$PATH | |
export PATH=$HOME/.cabal/bin:$PATH | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/rts-1.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/ghc-prim-0.3.1.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/integer-gmp-0.5.1.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/base-4.7.0.2 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/filepath-1.3.0.2 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/array-0.5.0.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/deepseq-1.3.0.2 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/bytestring-0.10.4.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/containers-0.5.5.1 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/old-locale-1.0.0.6 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/time-1.4.2 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/unix-2.7.0.1 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/directory-1.2.1.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/process-1.2.0.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/hpc-0.6.0.1 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/pretty-1.1.1.1 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/template-haskell-2.9.0.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/Cabal-1.18.1.5 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/binary-0.7.1.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/bin-package-db-0.0.0.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/hoopl-3.10.0.1 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/transformers-0.3.0.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/xhtml-3000.2.1 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/terminfo-0.4.0.0 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/haskeline-0.7.1.2 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/ghc-7.8.4 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/old-time-1.1.0.2 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/haskell98-2.0.0.3 | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/${HOME}/usr/lib/ghc-7.8.4/haskell2010-1.1.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cabal install --only-dependencies | |
...(snip) | |
checking whether we are cross compiling... configure: error: in `/var/tmp/cabal-tmp-8769/network-2.6.2.1': | |
...(snip) | |
cabal: Error: some packages failed to install: | |
network-2.6.2.1 failed during the configure step. The exception was: | |
ExitFailure 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir foo | |
$ cd foo | |
$ cabal sandbox init | |
$ cabal init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rm -rf ~/.ghc ~/.cabal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget -c --no-check-certificate https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-x86_64-portbld-freebsd.tar.xz | |
$ tar xf ghc-7.8.4-x86_64-portbld-freebsd.tar.xz | |
$ cd ghc-7.8.4 | |
$ ./configure --prefix=$HOME/usr | |
$ gmake install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ghc --version | |
The Glorious Glasgow Haskell Compilation System, version 7.8.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo 'main = putStrLn "hello"' > hello.hs | |
$ ghc hello.hs | |
[1 of 1] Compiling Main ( hello.hs, hello.o ) | |
Linking hello ... | |
$ ./hello | |
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ LINK=/usr/bin/ld | |
+ #LINK="$(for link in collect2 ld; do | |
+ # echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -qw $link && | |
+ # echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -w $link | | |
+ # sed -e "s|\(.*$link\).*|\1|" -e 's/ //g' -e 's|"||' && break | |
+ #done)" | |
- LINK="$(for link in collect2 ld; do | |
- echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -qw $link && | |
- echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -w $link | | |
- sed -e "s|\(.*$link\).*|\1|" -e 's/ //g' -e 's|"||' && break | |
- done)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -O http://hackage.haskell.org/package/cabal-install-1.22.6.0/cabal-install-1.22.6.0.tar.gz | |
$ tar xf cabal-install-1.22.6.0.tar.gz | |
$ cd cabal-install-1.22.6.0 | |
$ vi bootstrap.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ LINK=/usr/bin/ld | |
+ #LINK="$(for link in collect2 ld; do | |
+ # echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -qw $link && | |
+ # echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -w $link | | |
+ # sed -e "s|\(.*$link\).*|\1|" -e 's/ //g' -e 's|"||' && break | |
+ #done)" | |
- LINK="$(for link in collect2 ld; do | |
- echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -qw $link && | |
- echo 'main;' | ${CC} -v -x c - -o /dev/null -\#\#\# 2>&1 | grep -w $link | | |
- sed -e "s|\(.*$link\).*|\1|" -e 's/ //g' -e 's|"||' && break | |
- done)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ TAR="tar -f -" ./bootstrap.sh --no-doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ TAR="tar -f -" ./bootstrap.sh --no-doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cabal --version | |
cabal-install version 1.22.6.0 | |
using version 1.22.4.0 of the Cabal library |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment