Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on cabal and ghcup.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/cabal.e>
#           or at <http://angg.twu.net/e/cabal.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.disambiguation»		(to "disambiguation")
# «.cabal-install-2022»		(to "cabal-install-2022")
# «.cabal-PATH»			(to "cabal-PATH")
# «.stack-cabal-hell»		(to "stack-cabal-hell")
# «.cabal-from-git»		(to "cabal-from-git")
# «.min-version-base»		(to "min-version-base")
# «.deleting-cabal-dirs»	(to "deleting-cabal-dirs")
# «.installing-agda»		(to "installing-agda")
# «.installing-ghc»		(to "installing-ghc")
# «.installing-idris»		(to "installing-idris")
# «.ghcup»			(to "ghcup")
# «.cabal-update»		(to "cabal-update")
# «.installdir»			(to "installdir")
# «.list»			(to "list")
# «.cabal-init»			(to "cabal-init")

# (find-es "haskell" "cabal")
# (find-es "haskell" "cabal-PATH")

https://www.haskell.org/cabal/




#####
#
# disambiguation
# 2022oct08
#
#####

# «disambiguation»  (to ".disambiguation")
# The Cabal/Stack Disambiguation Guide:
#   https://gist.github.com/merijn/8152d561fb8b011f9313c48d876ceb07
#
# https://packages.debian.org/bullseye/cabal-install




#####
#
# cabal-install-2022
# 2022oct08
#
#####

# «cabal-install-2022»  (to ".cabal-install-2022")
# (find-zsh "installeddebs | sort | grep cabal")
# (find-zsh "availabledebs | sort | grep cabal")
# (find-status   "cabal-install")
# (find-vldifile "cabal-install.list")
# (find-udfile   "cabal-install/")
# (find-man "1 cabal")
# (find-fline "~/.cabal/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# To delete a previous installation:
du -ch ~/.cabal/
rm -Rf ~/.cabal/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# sudo apt-get install cabal-install
apti cabal-install

cabal update
cabal install Cabal cabal-install
cabal install hoogle



# (find-esgrep "grep --color=auto -nH --null -e cabal-install *.e")




#####
#
# Adding ~/.cabal/bin/ to my $PATH
# 2022oct08
#
#####

# «cabal-PATH»  (to ".cabal-PATH")
# (find-angg ".zshrc" "cabal")
# (find-es "haskell" "cabal-PATH")
# (find-fline "~/.cabal/bin/")
# (find-fline "~/.ghcup/bin/")




#####
#
# Stack vs Cabal and Cabal Hell
# 2021apr24
#
#####

# «stack-cabal-hell»  (to ".stack-cabal-hell")
# Build Haskell projects with either cabal or stack:
# https://medium.com/@fommil/why-not-both-8adadb71a5ed
#   https://github.com/symbiont-io/jaeger-flamegraph/blob/master/jaeger-flamegraph.cabal
#   https://hackage.haskell.org/package/jaeger-flamegraph
# https://www.well-typed.com/blog/2014/09/how-we-might-abolish-cabal-hell-part-1/
# https://www.well-typed.com/blog/2015/01/how-we-might-abolish-cabal-hell-part-2/






#####
#
# Cabal from git
# 2019jun06
#
#####

# «cabal-from-git» (to ".cabal-from-git")
# https://github.com/haskell/cabal/
# https://github.com/haskell/cabal/issues
# (find-git-links "https://github.com/haskell/cabal" "cabal")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# rm -Rfv ~/usrc/cabal/
cd      ~/usrc/
git clone https://github.com/haskell/cabal
cd      ~/usrc/cabal/
git pull

# (find-fline "~/usrc/")
# (find-fline "~/usrc/cabal/")

# (code-c-d "cabal" "~/usrc/cabal/")
# (find-gitk "~/usrc/cabal/")
# (find-cabalfile "")
# (find-cabalfile "README.md")
# (find-cabalfile "bootstrap/")
# (find-cabalfile "oC")
# (find-cabalfile "oc")
# (find-cabalfile "Cabal/Distribution/Parsec.hs")
# (find-cabalfile "Cabal/Distribution/Parsec.hs" "#if !(MIN_VERSION_base(4,13,0))")

apti cabal-install

cd      ~/usrc/cabal/
(cd Cabal; cabal install)          |& tee oC
(cd cabal-install; cabal install)  |& tee oc

aptrm cabal-install

      w cabal
laf $(w cabal)

cabal
cabal-install
cd /tmp/
cabal update
cabal install ghc
cabal install --lib ghc
cabal install --lib ghci

w ghci

aptrm ghc

# (find-fline "~/.cabal/config")

# (find-sh "ghc --help")
# (find-sh "ghc --version")




#####
#
# MIN_VERSION_base
# 2019jun06
#
#####

# «min-version-base» (to ".min-version-base")
# http://www.edsko.net/2014/09/13/haskell-cpp-macros/
#if MIN_VERSION_base(4,7,0)




#####
#
# deleting-cabal-dirs
# 2019aug15
#
#####

# «deleting-cabal-dirs» (to ".deleting-cabal-dirs")
# (find-es "agda" "plfa-install")
# (find-fline "~/.ghc/")
# (find-fline "~/.ghc/x86_64-linux-8.0.1/package.conf.d/")
# (find-fline "~/.cabal/")
# (find-fline "~/.cabal/logs/")
# (find-fline "~/.cabal/packages/")
# (find-fline "~/.cabal/packages/hackage.haskell.org/")
# (find-fline "~/.cabal/share/doc/")
# (find-fline "~/.cabal/share/doc/x86_64-linux-ghc-8.0.1/")
# (find-sh "cd ~/.cabal/share/doc/ && find * | sort")
# (find-fline "~/LOGS/2019aug15.hackage")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv ~/.cabal/
rm -Rfv ~/.ghc/



#####
#
# Installing Agda
# 2019aug15
#
#####

# «installing-agda» (to ".installing-agda")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cabal update
cabal install Agda
cabal install alex
cabal install happy
cabal install Agda




#####
#
# installing-ghc
# 2021jan10
#
#####

# «installing-ghc»  (to ".installing-ghc")
# https://www.haskell.org/cabal/
# https://www.schoolofhaskell.com/user/simonmichael/how-to-cabal-install
# https://www.schoolofhaskell.com/user/simonmichael/how-to-cabal-install#could-not-resolve-dependencies--cabal-hell
# (find-sh "cabal --version")
# (find-sh "cabal --help")
# (find-sh "cabal list --installed")

* (eepitch-bash)
* (eepitch-kill)
* (eepitch-bash)
function ghc-pkg-reset() {
    read -p 'erasing all your user ghc and cabal packages - are you sure (y/n) ? ' ans
    test x$ans == xy && ( \
        echo 'erasing directories under ~/.ghc'; rm -rf `find ~/.ghc -maxdepth 1 -type d`; \
        echo 'erasing ~/.cabal/lib'; rm -rf ~/.cabal/lib; \
        # echo 'erasing ~/.cabal/packages'; rm -rf ~/.cabal/packages; \
        # echo 'erasing ~/.cabal/share'; rm -rf ~/.cabal/share; \
        )
}
ghc-pkg-reset

# Or:
rm -rf ~/.ghc ~/.cabal

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

cabal update

cabal install ghc
cabal install ghc --reinstall
cabal install ghci
cabal install ghci --reinstall
cabal install ghci-8.10.2

# (find-sh "cabal help")
# (find-sh "cabal list ghc")
# (find-sh "cabal list ghci")

http://ix.io/2LBD

aptrm ghc





#####
#
# installing-idris
# 2019oct19
#
#####

# «installing-idris» (to ".installing-idris")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cabal update
cabal install idris
cabal install --force-reinstalls Idris

# cabal install Idris-ct
# cabal install idris-ct
# cabal update




#####
#
# ghcup
# 2021jan25
#
#####

# «ghcup»  (to ".ghcup")
# (find-es "ghcup" "2021-jan")




#####
#
# cabal-update
# 2021apr24
#
#####

# «cabal-update»  (to ".cabal-update")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cabal
cabal --help
# (find-sh "cabal --help")
# (find-sh "cabal help update")

cd /tmp/
cabal --verbose=3 update |& tee ocu
# (find-fline "~/.cabal/")
# (find-fline "~/.cabal/packages/")
# (find-fline "~/.cabal/packages/hackage.haskell.org/")




#####
#
# installdir
# 2021jul02
#
#####

# «installdir»  (to ".installdir")

/home/edrx/AGDA(edrx:sc)# cabal install Agda
Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
 - Agda-2.6.2 (lib:Agda, exe:agda, exe:agda-mode) (requires build)
Starting     Agda-2.6.2 (all, legacy fallback)
Building     Agda-2.6.2 (all, legacy fallback)
Installing   Agda-2.6.2 (all, legacy fallback)
Completed    Agda-2.6.2 (all, legacy fallback)
Warning: installdir is not defined. Set it in your cabal config file or use
--installdir=<path>. Using default installdir: "/home/edrx/.cabal/bin"
Symlinking 'agda' to '/home/edrx/.cabal/bin/agda'
Symlinking 'agda-mode' to '/home/edrx/.cabal/bin/agda-mode'
/home/edrx/AGDA(edrx:sc)# 



#####
#
# cabal list
# 2022sep19
#
#####

# «list»  (to ".list")
# (find-fline "~/LOGS/2022sep19.haskell" "cabal list --installed --package-db=")
# (find-sh "cabal --help")

ghc-pkg --help



#####
#
# cabal-init
# 2022sep20
#
#####

# «cabal-init»  (to ".cabal-init")
# https://cabal.readthedocs.io/en/stable/
# https://cabal.readthedocs.io/en/stable/developing-packages.html
# https://cabal.readthedocs.io/en/stable/developing-packages.html#using-cabal-init
# https://cabal.readthedocs.io/en/stable/cabal-commands.html#cabal-repl
# (find-hooglefile "hoogle.cabal" "build-depends:")
# (find-fline "~/LOGS/2022sep20.haskell")
# (find-fline "~/LOGS/2022sep20.haskell" "cabal init")
# (find-fline "~/LOGS/2022sep20.haskell" "<sm> cabal repl does that for you")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/tmp/foo2/")
rm -Rv /tmp/foo2/
mkdir  /tmp/foo2/
cd     /tmp/foo2/
# cabal init
cabal init --interactive

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-sh "cabal --help")
# (find-sh "cabal --help" "repl")
cd /tmp/foo2/
cabal repl






#  Local Variables:
#  coding:               utf-8-unix
#  ee-anchor-format:     "«%s»"
#  End: