wolffd@88: #!/bin/bash wolffd@89: samer@9: # ------------------ CONFIG ---------------- samer@0: wolffd@90: INSTALL_SWI=yes wolffd@90: INSTALL_SWI_PACKS=yes wolffd@87: SS_USER=$DML_WGET_USER wolffd@87: SS_PASS=$DML_WGET_PASS wolffd@90: MAKE_HUMDRUM=yes samer@11: samer@14: if [ -x matlab ]; then samer@14: HAVE_MATLAB=yes samer@14: else samer@14: HAVE_MATLAB=no samer@14: fi samer@14: samer@11: # ------------------ END OF CONFIG --------- samer@0: samer@3: function install_swi { samer@11: # cd ~/downloads samer@11: # wget http://www.swi-prolog.org/download/devel/src/pl-7.1.29.tar.gz samer@11: # cd ~/src samer@11: # tar xzf pl-7.1.29.tar.gz samer@31: unpack_into ~/src http://www.swi-prolog.org/download/devel/src/pl-7.1.30.tar.gz samer@31: cd ~/src/pl-7.1.30 samer@3: cp build.templ build samer@3: patch build ~/etc/swipl-build.patch samer@3: ./build wolffd@97: cd ~/src/swipl wolffd@97: ./upgrade_swipl 7.3.9 samer@3: } samer@3: samer@9: function unpack_into { samer@9: arname=$(basename "$2") samer@11: wget_into ~/downloads "$2" && cd "$1" && tar xzf ~/downloads/$arname samer@11: } samer@11: samer@11: function cp_into { samer@11: name=$(basename "$2") samer@11: mkdir -p "$1" samer@11: wget_into ~/downloads "$2" && cp -p "$name" "$1" samer@9: } samer@0: samer@9: function wget_into { samer@11: name=$(basename "$2") samer@9: mkdir -p "$1" samer@9: cd "$1" samer@11: if [ -a "$name" ]; then samer@11: echo "Aready existing in $1: $2." samer@11: else wolffd@87: # echo "Please download from $2 and put it in $1." wolffd@87: # exit 1 wolffd@87: echo "I am going to download into $1 from $2." samer@13: # echo "You may be asked for a password." wolffd@87: # wget --user=$DML_WGET_USER --password=$DML_WGET_PASS "$2" wolffd@87: wget "$2" samer@11: fi samer@9: } samer@9: samer@9: function get_repo_into { samer@9: dest="$1" samer@9: repo="$3" samer@9: cmd=$2 samer@9: shift 3 samer@9: samer@9: name=$(basename "$repo") samer@11: mkdir -p "$dest" samer@9: cd "$dest" samer@9: if [ -d $name ]; then samer@9: echo "$name repository alread present in $dest" samer@9: else samer@9: $cmd clone "$repo" $* samer@9: fi samer@9: } samer@9: samer@9: if [ $INSTALL_SWI == yes ]; then samer@9: install_swi samer@9: fi samer@0: samer@14: if [ $INSTALL_SWI_PACKS == yes ]; then wolffd@100: swipl -g 'maplist(pack_install,[lambda,real,prosqlite,memo,callgraph,swipe,sparkle,musicbrainz,plsmf,plumdrum,sindice]), halt' samer@14: if [ $HAVE_MATLAB == yes ]; then samer@14: swipl -g 'pack_install(plml), halt' samer@19: fi samer@14: fi samer@14: samer@0: # DOWNLOADS FROM REPOs samer@11: get_repo_into ~/src/github git https://github.com/samer--/ClioPatria wolffd@99: cd ~/src/github/ClioPatria wolffd@99: # git checkout dml wolffd@99: git checkout d868d5f978d665d2acb07ee83b640f05f2e9eaef #current dev cliopatria version (2016) wolffd@99: # git checkout 9f657262a4612748a5ef374d96a0257344e4032d #current VM clio version (2015) samer@9: get_repo_into ~/src/github git https://github.com/humdrum-tools/humdrum-tools --recursive samer@11: if [ $MAKE_HUMDRUM == yes ]; then samer@11: cd ~/src/github/humdrum-tools && make samer@11: fi wolffd@96: # Added isearch - is this the correct source ? wolffd@96: get_repo_into ~/src/github git https://github.com/samer--/isearch samer@11: wolffd@87: # get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-cliopatria # private repo wolffd@95: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-open-cliopatria dml-cliopatria # public corresponding wolffd@87: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/ishara # public repo wolffd@87: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/kernscores-utf8 # public repo wolffd@89: # get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-datasets # private data samer@0: wolffd@87: # cp_into ~/lib/beets https://code.soundsoftware.ac.uk/attachments/download/1284/music-ro.db samer@3: samer@11: mkdir -p ~/var/dml/memo_db samer@19: cd ~/var/dml && tar xzf var-dml-cpack.tar.gz