Which version do you want to install?
VERSION=v1.6.14
Clone the Nim repo
git clone --depth 1 --branch $VERSION https://github.com/nim-lang/Nim
Clone the csources for an earlier Nim version
cd Nim && git clone --depth 1 https://github.com/nim-lang/csources_v1 csources
Build the csources
pushd csources && sh build.sh
Go back into the Nim directory and compile Koch
popd && bin/nim c koch
Get Koch to compile the newer Nim version
./koch boot -d:release
Your new Nim™ will be in bin/nim
. Enjoy!
Literally just:
./koch nimble
- The bottleneck here is compiling Koch; depending on the combination of csources and Nim repo version it may or may not work. Building csources itself however should always work.
- Nimble at the moment wants to dynamically link with OpenSSL 1.1.
- You also want
cacert.pem
to be accessible to Nimble to be able to download packages. - I've tested with MSYS2 MinGW64 environment (2023-05-26 snapshot). Works on my machine!