annotate etc/setup_as_dml.sh @ 100:a4cd935561d4 dml-dockerised tip

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