samer@0: #!/bin/sh samer@9: # ------------------ CONFIG ---------------- samer@0: samer@9: INSTALL_SWI=no samer@19: INSTALL_SWI_PACKS=no samer@19: SS_USER=samer samer@19: MAKE_HUMDRUM=no 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@9: unpack_into ~/src http://www.swi-prolog.org/download/devel/src/pl-7.1.29.tar.gz samer@9: cd ~/src/pl-7.1.29 samer@3: cp build.templ build samer@3: patch build ~/etc/swipl-build.patch samer@3: ./build 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 samer@13: echo "Please download from $2 and put it in $1." samer@13: exit 1 samer@13: # echo "I am going to download into $1 from $2." samer@13: # echo "You may be asked for a password." samer@13: # wget --user=$SS_USER --ask-password "$2" samer@13: # 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 samer@14: swipl -g 'maplist(pack_install,[lambda,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 samer@12: cd ~/src/github/ClioPatria && git checkout dml 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 samer@11: samer@9: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-cliopatria samer@9: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/ishara samer@9: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/kernscores-utf8 samer@14: get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-datasets samer@0: samer@11: 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