Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
ghcup
Commits
82c16365
Unverified
Commit
82c16365
authored
6 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Add a bootstrap-haskell script, fixes #36
parent
9cc652e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!40
Add a bootstrap-haskell script, fixes #36
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+18
-0
18 additions, 0 deletions
README.md
bootstrap-haskell
+75
-0
75 additions, 0 deletions
bootstrap-haskell
ghcup
+1
-1
1 addition, 1 deletion
ghcup
with
94 additions
and
1 deletion
README.md
+
18
−
0
View file @
82c16365
...
...
@@ -19,6 +19,24 @@ Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [p
## Installation
### Simple bootstrap of ghcup, GHC and cabal-install
```
sh
# complete bootstrap
curl https://raw.githubusercontent.com/haskell/ghcup/master/bootstrap-haskell
-sSf
| sh
# prepare your environment
.
"
$HOME
/.ghcup/env"
echo
'. $HOME/.ghcup/env'
>>
"
$HOME
/.bashrc"
# or similar
# now create a project, such as:
mkdir
myproject
&&
cd
myproject
cabal init
-n
--is-executable
cabal v2-run
```
### Manual install
Just place the
`ghcup`
shell script into your
`PATH`
anywhere.
E.g.:
...
...
This diff is collapsed.
Click to expand it.
bootstrap-haskell
0 → 100755
+
75
−
0
View file @
82c16365
#!/bin/sh
# safety subshell to avoid executing anything in case this script is not downloaded properly
(
die
()
{
(>
&2
printf
"
\\
033[0;31m%s
\\
033[0m
\\
n"
"
$1
"
)
exit
2
}
edo
()
{
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"
$*
"
"
$@
"
||
exit
2
}
echo
echo
"Welcome to Haskell!"
echo
echo
"This will download and install the Glasgow Haskell Compiler (GHC) for "
echo
"the Haskell programming language, and the Cabal build tool."
echo
echo
"It will add the 'cabal', 'ghc', and 'ghcup' executables to bin directory "
echo
"located at: "
echo
echo
"
$HOME
/.ghcup/bin"
echo
echo
"and create the environment file
$HOME
/.ghcup/env"
echo
"which you should source in your ~/.bashrc or similar to get the required"
echo
"PATH components."
echo
if
[
-z
"
${
BOOTSTRAP_HASKELL_NONINTERACTIVE
}
"
]
;
then
echo
"To proceed with the installation press enter, to cancel press ctrl-c."
echo
"Note that this script can be re-run at any given time."
echo
# Wait for user input to continue.
# shellcheck disable=SC2034
read
-r
answer </dev/tty
fi
edo
mkdir
-p
"
${
HOME
}
"
/.ghcup/bin
if
command
-V
"ghcup"
>
/dev/null 2>&1
;
then
if
[
-z
"
${
BOOTSTRAP_HASKELL_NO_UPGRADE
}
"
]
;
then
edo ghcup upgrade
fi
else
edo curl https://raw.githubusercontent.com/haskell/ghcup/master/ghcup
>
"
${
HOME
}
"
/.ghcup/bin/ghcup
edo
chmod
+x
"
${
HOME
}
"
/.ghcup/bin/ghcup
cat
<<-
EOF
> "
${
HOME
}
"/.ghcup/env || die "Failed to create env file"
export PATH="
\$
HOME/.cabal/bin:
\$
HOME/.ghcup/bin:
\$
PATH"
EOF
# shellcheck disable=SC1090
edo
.
"
${
HOME
}
"
/.ghcup/env
fi
edo ghcup
install
edo ghcup
set
edo ghcup install-cabal
edo cabal new-update
edo cabal new-install
--symlink-bindir
=
"
$HOME
/.cabal/bin"
cabal-install
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Installation done!"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Don't forget to source
$HOME
/.ghcup/env in your ~/.bashrc or similar."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
)
This diff is collapsed.
Click to expand it.
ghcup
+
1
−
1
View file @
82c16365
...
...
@@ -245,7 +245,7 @@ FLAGS:
-h, --help Prints help information
ARGS:
[VERSION|TAG] E.g.
\"
8.4.3
\"
or
\"
8.6.
1
\"
or
[VERSION|TAG] E.g.
\"
8.4.3
\"
or
\"
8.6.
3
\"
or
a tag like
\"
recommended
\"
or
\"
latest
\"
(default: discovers recommended version)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment