Skip to content

Instantly share code, notes, and snippets.

@shaicoleman
Last active August 29, 2015 14:20
Show Gist options
  • Save shaicoleman/ed76656836d5112e2409 to your computer and use it in GitHub Desktop.
Save shaicoleman/ed76656836d5112e2409 to your computer and use it in GitHub Desktop.
Nim install script
#!/bin/bash
echo Installing dependencies...
# APT based systems. Tested on: Ubuntu 14.04
[[ -f /etc/debian_version ]] && sudo apt-get update
[[ -f /etc/debian_version ]] && sudo apt-get -y install git mercurial curl build-essential libzip-dev
# RPM based systems. Tested on: CentOS 7
[[ -f /etc/redhat-release ]] && [[ -x /usr/bin/sudo ]] || yum -y install sudo
[[ -f /etc/redhat-release ]] && sudo yum -y groupinstall "Development Tools" --exclude=subversion --exclude='systemtap*' --exclude=valgrind
[[ -f /etc/redhat-release ]] && sudo yum -y install libzip-devel zlib-devel git mercurial
cd /tmp
[[ -d /tmp/Nim ]] && rm -rf /tmp/Nim
echo Cloning from git the Nim devel branch...
git clone -b devel git://github.com/Araq/Nim.git
cd /tmp/Nim
# known good version: 0.10.3 devel version, 2015-04-26
git checkout 1cb14f888a4534d8e71f1fb9a64ba172558e138e
echo Cloning from git the Nim csources devel branch...
git clone -b devel --depth 1 git://github.com/nim-lang/csources
cd csources
echo Building the csources
sh build.sh
cd ..
echo Building koch
bin/nim c koch
echo Booting koch
./koch boot -d:release
echo Installing koch
sudo ./koch install /usr/local
sudo ln -sf /usr/local/nim/bin/nim /usr/local/bin/nim
git clone https://github.com/nim-lang/nimble.git
cd nimble
nim c -r src/nimble install
sudo cp /tmp/Nim/nimble/src/nimble /usr/local/nim/bin/nimble
sudo ln -sf /usr/local/nim/bin/nimble /usr/local/bin/nimble
nimble update
nimble install random
nimble install strfmt@#devel
nimble install nake
nimble install sha1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment