Skip to content

Commit

Permalink
update installNim
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosborn committed Dec 14, 2024
1 parent ce39c6b commit 02e3589
Showing 1 changed file with 38 additions and 32 deletions.
70 changes: 38 additions & 32 deletions build/installNim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
pwd="$PWD"

usage() {
s="------------------------------------------------------------------------"
Expand All @@ -9,7 +10,7 @@ usage() {
echo "options:"
echo " -h (this help message)"
echo " stable (install latest stable version)"
echo " <version> (install named version, e.g. 0.16.0)"
echo " <version> (install named version, e.g. 2.2.0)"
#echo " master (install master branch tracking version)"
echo " devel (install devel branch tracking version)"
echo " default stable|<version>|master|devel"
Expand Down Expand Up @@ -112,7 +113,7 @@ install() {
}

realpath2() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
[[ $1 = /* ]] && echo "$1" || echo "$pwd/${1#./}"
}

installAll() {
Expand Down Expand Up @@ -163,43 +164,48 @@ if [ $branch = "master" -o $branch = "devel" ]; then
git pull
fi

if [ -e csources ]; then
cd csources
git pull
cd ..
else
if [ $branch = "master" -o $branch = "devel" ]; then
git clone --depth 1 https://github.com/nim-lang/csources
else
cb="v1"
case $ver in
0.9.*|0.10.*|0.11.*|0.12.*) cb="v0.9.4";;
0.13.*|0.14.*|0.15.0) cb="v0.13.0";;
0.15.*) cb="v0.15.2";;
0.16.*) cb="v0.16.0";;
0.17.*) cb="v0.17.0";;
0.18.*) cb="v0.18.0";;
0.19.*) cb="v0.19.0";;
0.*|1.0.*|1.1.*|1.2.*|1.3.*|1.4.*) cb="v0.20.0";;
esac
echo "Installing csources '$cb'"
case $cb in
v1)
git clone --depth 1 https://github.com/nim-lang/csources_v1
ln -s csources_v1 csources;;
*)
git clone -b $cb --depth 1 https://github.com/nim-lang/csources;;
esac
fi
fi
#if [ -e csources ]; then
# cd csources
# git pull
# cd ..
#else
# if [ $branch = "master" -o $branch = "devel" ]; then
# git clone --depth 1 https://github.com/nim-lang/csources
# else
# cb="v2"
# case $ver in
# 0.9.*|0.10.*|0.11.*|0.12.*) cb="v0.9.4";;
# 0.13.*|0.14.*|0.15.0) cb="v0.13.0";;
# 0.15.*) cb="v0.15.2";;
# 0.16.*) cb="v0.16.0";;
# 0.17.*) cb="v0.17.0";;
# 0.18.*) cb="v0.18.0";;
# 0.19.*) cb="v0.19.0";;
# 0.*|1.0.*|1.1.*|1.2.*|1.3.*|1.4.*) cb="v0.20.0";;
# 1.5.*|1.6.*) cb="v1";;
# esac
# echo "Installing csources '$cb'"
# case $cb in
# v2)
# git clone --depth 1 https://github.com/nim-lang/csources_v2
# ln -s csources_v2 csources;;
# v1)
# git clone --depth 1 https://github.com/nim-lang/csources_v1
# ln -s csources_v1 csources;;
# *)
# git clone -b $cb --depth 1 https://github.com/nim-lang/csources;;
# esac
# fi
#fi
#cd csources && sh build.sh && cd ..

#bin/nim c koch
#./koch boot -d:release

#./koch tools
#./koch nimble
./build_all.sh
echo "Running build_all.sh"
./build_all.sh 2>&1 |tee build.log

if [ $ver = "stable" ]; then
ver=`getVer nim`
Expand Down

0 comments on commit 02e3589

Please sign in to comment.