setup_ext.sh 2.56 KB
Newer Older
Tobias WEBER's avatar
Tobias WEBER committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
#
# downloads external libraries
# @author Tobias Weber <tweber@ill.fr>
# @date 6-apr-18
# @license see 'LICENSE' file
#

# -----------------------------------------------------------------------------
# tools
WGET=wget
# -----------------------------------------------------------------------------


# -----------------------------------------------------------------------------
# URLs for external libs
TLIBS=https://forge.frm2.tum.de/cgit/cgit.cgi/frm2/mira/tlibs.git/snapshot/tlibs-master.tar.bz2
QCP=http://www.qcustomplot.com/release/2.0.0/QCustomPlot-source.tar.gz

# local file names
TLIBS_LOCAL=${TLIBS##*[/\\]}
QCP_LOCAL=${QCP##*[/\\]}
# -----------------------------------------------------------------------------


# -----------------------------------------------------------------------------
# cleans externals
function clean_dirs()
{
	rm -rf tlibs
	rm -rf qcp
}

function clean_files()
{
	rm -f ${TLIBS_LOCAL}
	rm -f ${QCP_LOCAL}
}
# -----------------------------------------------------------------------------


# -----------------------------------------------------------------------------
function dl_tlibs()
{
	if ! ${WGET} ${TLIBS}
	then
		echo -e "Error downloading tlibs.";
		exit -1;
	fi

	if ! tar xjvf ${TLIBS_LOCAL}
	then
		echo -e "Error extracting tlibs.";
		exit -1;
	fi

	mv tlibs-master tlibs
}


function dl_qcp()
{
	if ! ${WGET} ${QCP}
	then
		echo -e "Error downloading qcp.";
		exit -1;
	fi


	if ! tar xzvf ${QCP_LOCAL}
	then
		echo -e "Error extracting qcp.";
		exit -1;
	fi

	mv qcustomplot-source qcp
}
# -----------------------------------------------------------------------------


cd ext

echo -e "\n--------------------------------------------------------------------------------"
echo -e "Removing old libs...\n"
clean_dirs
clean_files
echo -e "--------------------------------------------------------------------------------\n"

echo -e "\n--------------------------------------------------------------------------------"
echo -e "Installing external tlibs library...\n"
dl_tlibs
echo -e "--------------------------------------------------------------------------------\n"

echo -e "\n--------------------------------------------------------------------------------"
echo -e "Installing external qcustomplot library...\n"
dl_qcp
echo -e "--------------------------------------------------------------------------------\n"

echo -e "\n--------------------------------------------------------------------------------"
echo -e "Removing temporary files...\n"
clean_files
echo -e "--------------------------------------------------------------------------------\n"