generated from fortran-lang/fortran-forum-article-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-prerequisites.sh
executable file
·130 lines (122 loc) · 3.74 KB
/
install-prerequisites.sh
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/sh
set -e # exit on error
if command -v stack 1> /dev/null 2>&1 ; then
echo "Found stack"
else
echo "Haskell stack not found."
echo "Installing Haskell stack"
curl -sSL https://get.haskellstack.org/ | sh
if command -v stack 1> /dev/null 2>&1 ; then
echo "Haskell stack installation successful."
else
echo "ERROR: Haskell stack installation unsuccessful."
exit 1
fi
fi
if command -v pandoc 1> /dev/null 2>&1 ; then
echo "Found pandoc"
else
echo "pandoc not found."
echo "Installing pandoc"
stack install pandoc
if command -v pandoc 1> /dev/null 2>&1 ; then
echo "pandoc installation successful."
else
echo "ERROR: pandoc installation unsuccessful."
exit 1
fi
fi
if command -v py-pandoc-include-code 1> /dev/null 2>&1 ; then
echo "Found py-pandoc-include-code"
else
echo "py-pandoc-include-code not found"
echo "Installing py-pandoc-include-code"
pip install git+https://github.com/veneres/py-pandoc-include-code.git
if command -v py-pandoc-include-code 1> /dev/null 2>&1 ; then
echo "py-pandoc-include-code installation successful."
else
echo "ERROR: py-pandoc-include-code installation unsuccessful."
exit 1
fi
fi
if command -v make 1> /dev/null 2>&1 ; then
echo "Found make"
else
echo "make not found."
echo "Installing make"
if command -v apt 1> /dev/null 2>&1 ; then
sudo apt install make
elif command -v yum 1> /dev/null 2>&1 ; then
sudo yum install make
elif command -v dnf 1> /dev/null 2>&1 ; then
sudo dnf install make
elif command -v pacman 1> /dev/null 2>&1 ; then
sudo pacman -S make
elif command -v brew 1> /dev/null 2>&1 ; then
brew install make
fi
if command -v make 1> /dev/null 2>&1 ; then
echo "make installation successful."
else
echo "ERROR: make installation unsuccessful."
exit 1
fi
fi
if command -v codespell 1> /dev/null 2>&1 ; then
echo "Found codespell"
else
echo "codespell not found."
echo "Installing codespell"
if command -v pip 1> /dev/null 2>&1 ; then
pip install --user codespell
elif command -v apt 1> /dev/null 2>&1 ; then
sudo apt install codespell
elif command -v yum 1> /dev/null 2>&1 ; then
sudo yum install codespell
elif command -v dnf 1> /dev/null 2>&1 ; then
sudo dnf install codespell
elif command -v pacman 1> /dev/null 2>&1 ; then
sudo pacman -S codespell
elif command -v brew 1> /dev/null 2>&1 ; then
brew install codespell
fi
if command -v codespell 1> /dev/null 2>&1 ; then
echo "codespell installation successful."
else
echo "ERROR: codespell installation unsuccessful."
exit 1
fi
fi
if command -v pdflatex 1> /dev/null 2>&1 ; then
echo "Found LaTeX"
else
echo "LaTeX not found."
echo "Installing LaTeX"
if command -v apt 1> /dev/null 2>&1 ; then
sudo apt install texlive-latex-recommended texlive-latex-extra texlive-science
elif command -v yum 1> /dev/null 2>&1 ; then
sudo yum install texlive-latex-recommended texlive-latex-extra texlive-science
elif command -v dnf 1> /dev/null 2>&1 ; then
sudo dnf install texlive-latex-recommended texlive-latex-extra texlive-science
elif command -v pacman 1> /dev/null 2>&1 ; then
sudo pacman -S texlive-latex-recommended texlive-latex-extra texlive-science
elif command -v brew 1> /dev/null 2>&1 ; then
brew install texlive-latex-recommended texlive-latex-extra texlive-science
fi
if command -v pdflatex 1> /dev/null 2>&1 ; then
echo "LaTeX installation successful."
else
echo "ERROR: LaTeX installation unsuccessful."
exit 1
fi
fi
if command -v fpm 1> /dev/null 2>&1 ; then
echo "Found fpm"
else
echo "fpm not found."
echo "Installing fpm"
wget https://github.com/fortran-lang/fpm/archive/refs/tags/v0.9.0.tar.gz
tar -xf v0.9.0.tar.gz
cd v0.9.0
./install.sh
fi