annotate etc/setup_as_dml.sh @ 16:b2b7aecaeb2c

Added DML CPACK archive
author samer
date Fri, 23 Jan 2015 17:16:06 +0000
parents ef88a4afac7a
children 11e21255b404
rev   line source
samer@0 1 #!/bin/sh
samer@9 2 # ------------------ CONFIG ----------------
samer@0 3
samer@9 4 INSTALL_SWI=no
samer@13 5 SS_USER=<DML_USER_NAME HERE>
samer@13 6 MAKE_HUMDRUM=yes
samer@11 7
samer@14 8 if [ -x matlab ]; then
samer@14 9 HAVE_MATLAB=yes
samer@14 10 else
samer@14 11 HAVE_MATLAB=no
samer@14 12 fi
samer@14 13
samer@11 14 # ------------------ END OF CONFIG ---------
samer@0 15
samer@3 16 function install_swi {
samer@11 17 # cd ~/downloads
samer@11 18 # wget http://www.swi-prolog.org/download/devel/src/pl-7.1.29.tar.gz
samer@11 19 # cd ~/src
samer@11 20 # tar xzf pl-7.1.29.tar.gz
samer@9 21 unpack_into ~/src http://www.swi-prolog.org/download/devel/src/pl-7.1.29.tar.gz
samer@9 22 cd ~/src/pl-7.1.29
samer@3 23 cp build.templ build
samer@3 24 patch build ~/etc/swipl-build.patch
samer@3 25 ./build
samer@3 26 }
samer@3 27
samer@9 28 function unpack_into {
samer@9 29 arname=$(basename "$2")
samer@11 30 wget_into ~/downloads "$2" && cd "$1" && tar xzf ~/downloads/$arname
samer@11 31 }
samer@11 32
samer@11 33 function cp_into {
samer@11 34 name=$(basename "$2")
samer@11 35 mkdir -p "$1"
samer@11 36 wget_into ~/downloads "$2" && cp -p "$name" "$1"
samer@9 37 }
samer@0 38
samer@9 39 function wget_into {
samer@11 40 name=$(basename "$2")
samer@9 41 mkdir -p "$1"
samer@9 42 cd "$1"
samer@11 43 if [ -a "$name" ]; then
samer@11 44 echo "Aready existing in $1: $2."
samer@11 45 else
samer@13 46 echo "Please download from $2 and put it in $1."
samer@13 47 exit 1
samer@13 48 # echo "I am going to download into $1 from $2."
samer@13 49 # echo "You may be asked for a password."
samer@13 50 # wget --user=$SS_USER --ask-password "$2"
samer@13 51 # wget "$2"
samer@11 52 fi
samer@9 53 }
samer@9 54
samer@9 55 function get_repo_into {
samer@9 56 dest="$1"
samer@9 57 repo="$3"
samer@9 58 cmd=$2
samer@9 59 shift 3
samer@9 60
samer@9 61 name=$(basename "$repo")
samer@11 62 mkdir -p "$dest"
samer@9 63 cd "$dest"
samer@9 64 if [ -d $name ]; then
samer@9 65 echo "$name repository alread present in $dest"
samer@9 66 else
samer@9 67 $cmd clone "$repo" $*
samer@9 68 fi
samer@9 69 }
samer@9 70
samer@9 71 if [ $INSTALL_SWI == yes ]; then
samer@9 72 install_swi
samer@9 73 fi
samer@0 74
samer@14 75 if [ $INSTALL_SWI_PACKS == yes ]; then
samer@14 76 swipl -g 'maplist(pack_install,[lambda,prosqlite,memo,callgraph,swipe,sparkle,musicbrainz,plsmf,plumdrum,sindice]), halt'
samer@14 77 if [ $HAVE_MATLAB == yes ]; then
samer@14 78 swipl -g 'pack_install(plml), halt'
samer@14 79 end
samer@14 80 fi
samer@14 81
samer@0 82 # DOWNLOADS FROM REPOs
samer@11 83 get_repo_into ~/src/github git https://github.com/samer--/ClioPatria
samer@12 84 cd ~/src/github/ClioPatria && git checkout dml
samer@9 85 get_repo_into ~/src/github git https://github.com/humdrum-tools/humdrum-tools --recursive
samer@11 86 if [ $MAKE_HUMDRUM == yes ]; then
samer@11 87 cd ~/src/github/humdrum-tools && make
samer@11 88 fi
samer@11 89
samer@9 90 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-cliopatria
samer@9 91 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/ishara
samer@9 92 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/kernscores-utf8
samer@14 93 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-datasets
samer@0 94
samer@11 95 cp_into ~/lib/beets https://code.soundsoftware.ac.uk/attachments/download/1284/music-ro.db
samer@3 96
samer@11 97 mkdir -p ~/var/dml/memo_db