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
|
samer@3
|
29 }
|
samer@3
|
30
|
samer@9
|
31 function unpack_into {
|
samer@9
|
32 arname=$(basename "$2")
|
samer@11
|
33 wget_into ~/downloads "$2" && cd "$1" && tar xzf ~/downloads/$arname
|
samer@11
|
34 }
|
samer@11
|
35
|
samer@11
|
36 function cp_into {
|
samer@11
|
37 name=$(basename "$2")
|
samer@11
|
38 mkdir -p "$1"
|
samer@11
|
39 wget_into ~/downloads "$2" && cp -p "$name" "$1"
|
samer@9
|
40 }
|
samer@0
|
41
|
samer@9
|
42 function wget_into {
|
samer@11
|
43 name=$(basename "$2")
|
samer@9
|
44 mkdir -p "$1"
|
samer@9
|
45 cd "$1"
|
samer@11
|
46 if [ -a "$name" ]; then
|
samer@11
|
47 echo "Aready existing in $1: $2."
|
samer@11
|
48 else
|
wolffd@87
|
49 # echo "Please download from $2 and put it in $1."
|
wolffd@87
|
50 # exit 1
|
wolffd@87
|
51 echo "I am going to download into $1 from $2."
|
samer@13
|
52 # echo "You may be asked for a password."
|
wolffd@87
|
53 # wget --user=$DML_WGET_USER --password=$DML_WGET_PASS "$2"
|
wolffd@87
|
54 wget "$2"
|
samer@11
|
55 fi
|
samer@9
|
56 }
|
samer@9
|
57
|
samer@9
|
58 function get_repo_into {
|
samer@9
|
59 dest="$1"
|
samer@9
|
60 repo="$3"
|
samer@9
|
61 cmd=$2
|
samer@9
|
62 shift 3
|
samer@9
|
63
|
samer@9
|
64 name=$(basename "$repo")
|
samer@11
|
65 mkdir -p "$dest"
|
samer@9
|
66 cd "$dest"
|
samer@9
|
67 if [ -d $name ]; then
|
samer@9
|
68 echo "$name repository alread present in $dest"
|
samer@9
|
69 else
|
samer@9
|
70 $cmd clone "$repo" $*
|
samer@9
|
71 fi
|
samer@9
|
72 }
|
samer@9
|
73
|
samer@9
|
74 if [ $INSTALL_SWI == yes ]; then
|
samer@9
|
75 install_swi
|
samer@9
|
76 fi
|
samer@0
|
77
|
samer@14
|
78 if [ $INSTALL_SWI_PACKS == yes ]; then
|
samer@14
|
79 swipl -g 'maplist(pack_install,[lambda,prosqlite,memo,callgraph,swipe,sparkle,musicbrainz,plsmf,plumdrum,sindice]), halt'
|
samer@14
|
80 if [ $HAVE_MATLAB == yes ]; then
|
samer@14
|
81 swipl -g 'pack_install(plml), halt'
|
samer@19
|
82 fi
|
samer@14
|
83 fi
|
samer@14
|
84
|
samer@0
|
85 # DOWNLOADS FROM REPOs
|
samer@11
|
86 get_repo_into ~/src/github git https://github.com/samer--/ClioPatria
|
samer@12
|
87 cd ~/src/github/ClioPatria && git checkout dml
|
samer@9
|
88 get_repo_into ~/src/github git https://github.com/humdrum-tools/humdrum-tools --recursive
|
samer@11
|
89 if [ $MAKE_HUMDRUM == yes ]; then
|
samer@11
|
90 cd ~/src/github/humdrum-tools && make
|
samer@11
|
91 fi
|
samer@11
|
92
|
wolffd@87
|
93 # get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-cliopatria # private repo
|
wolffd@87
|
94 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-open-cliopatria # public corresponding
|
wolffd@87
|
95 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/ishara # public repo
|
wolffd@87
|
96 get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/kernscores-utf8 # public repo
|
wolffd@89
|
97 # get_repo_into ~/src/hg hg https://code.soundsoftware.ac.uk/hg/dml-datasets # private data
|
samer@0
|
98
|
wolffd@87
|
99 # cp_into ~/lib/beets https://code.soundsoftware.ac.uk/attachments/download/1284/music-ro.db
|
samer@3
|
100
|
samer@11
|
101 mkdir -p ~/var/dml/memo_db
|
samer@19
|
102 cd ~/var/dml && tar xzf var-dml-cpack.tar.gz
|