Example #1
0
def snappy(snappy_url=SNAPPY_URL, install=False):
  if util.dir_exists("$HOME/lib/snappy"):
    print "snappy already exists in $HOME/lib/snappy"
    return

  with settings(warn_only=True):
    run("mkdir $HOME/lib")

  basename = os.path.basename(snappy_url).replace(".tar.gz", "")
  dest_path = "$HOME/lib/" + basename
  util.remote_archive(snappy_url, dest_path)
  with cd(dest_path):
    run("./configure")
    run("make")
    if install:
      sudo("make install")

  with cd("$HOME/lib"):
    run("ln -s -f %s snappy" % basename)

  with cd("$HOME/lib/%s" % basename):
    run("./snappy_unittest")

  print "headers: $HOME/lib/snappy"
  print "libs: $HOME/lib/snappy/.lib"
Example #2
0
def install_ghc_from_source(ghc_url=GHC_URL, ghc_version=GHC_VERSION):
  apt.apt_install("libgmp3c2 libgmp3-dev")

  if not util.dir_exists("$HOME/builds"):
    util.mkdir("$HOME/builds")

  build_dir = "$HOME/builds/" + ghc_version
  util.remote_archive(ghc_url, build_dir)
  with cd(build_dir):
    run("./configure --prefix=/usr/local")
    sudo("make install")
Example #3
0
def install_haskell_platform_from_source( \
    platform_url=HASKELL_PLATFORM_URL, \
    platform_version=HASKELL_PLATFORM_VERSION):

  apt.apt_install("mesa-common-dev freeglut3-dev")

  if not util.dir_exists("$HOME/builds"):
    util.mkdir("$HOME/builds")

  build_dir = "$HOME/builds/" + platform_version
  util.remote_archive(platform_url, build_dir)
  with cd(build_dir):
    run("./configure --prefix=/usr/local")
    run("make")
    sudo("make install")
Example #4
0
def leveldb(leveldb_url=LEVELDB_URL, use_snappy=True):
  snappy()

  if util.dir_exists("$HOME/lib/leveldb"):
    print "leveldb already exists in $HOME/lib/leveldb"
    return

  with settings(warn_only=True):
    run("mkdir $HOME/lib")

  basename = os.path.basename(leveldb_url).replace(".tar.gz", "")
  dest_path = "$HOME/lib/" + basename
  util.remote_archive(leveldb_url, dest_path)
  with cd(dest_path):
    if use_snappy:
      run("CXXFLAGS=\"-I ~/lib/snappy -L ~/lib/snappy/.libs/\" make all")
    else:
      run("make all")

  with cd("$HOME/lib"):
    run("ln -s -f %s leveldb" % basename)

  print "headers: $HOME/lib/leveldb/include/leveldb"
  print "libs: $HOME/lib/leveldb"