Update devel-install,sh
[geeqie.git] / scripts / devel-install.sh
1 #!/bin/sh
2
3 #/*
4 # * Copyright (C) 2023 The Geeqie Team
5 # *
6 # * Author: Colin Clark
7 # *
8 # * This program is free software; you can redistribute it and/or modify
9 # * it under the terms of the GNU General Public License as published by
10 # * the Free Software Foundation; either version 2 of the License, or
11 # * (at your option) any later version.
12 # *
13 # * This program is distributed in the hope that it will be useful,
14 # * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # * GNU General Public License for more details.
17 # *
18 # * You should have received a copy of the GNU General Public License along
19 # * with this program; if not, write to the Free Software Foundation, Inc.,
20 # * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 # */
22
23 ## @file
24 ## @brief Install additional files for Geeqie development purposes
25 ##
26
27 if ! { [ -d ".git" ] && [ -d "src" ] && [ -f "geeqie.1" ] && [ -f "doxygen.conf" ]; }
28 then
29     printf "This is not the project root directory\n"
30     exit 1
31 fi
32
33 if ! zenity --title="Install files for Geeqie development" --question --text "This script will install:\n
34 <tt>
35 curl                # for this script
36 default-jre         # for doxygen diagrams
37 libdw-dev           # for devel=enabled
38 libdwarf-dev        # for devel=enabled
39 libunwind-dev       # for devel=enabled
40 shellcheck          # for meson tests
41 texlive-font-utils  # for doxygen diagrams
42 xvfb                # for meson tests
43 </tt>
44
45 The following will be downloaded to $HOME/bin/ and made executable:\n
46 <tt>
47 https://github.com/plantuml/plantuml/releases/download/<i>latest</i>/plantuml-<i>latest</i>.jar  # for doxygen diagrams
48 https://raw.githubusercontent.com/Anvil/bash-doxygen/master/doxygen-bash.sed       # for documenting script files\n
49 </tt>
50
51 Continue?" --width=300
52 then
53     exit 0
54 fi
55
56 if ! mkdir -p "$HOME"/bin
57 then
58     printf "Cannot create %s\n" "$HOME"/bin
59     exit 1
60 fi
61
62 sudo apt install curl
63 sudo apt install default-jre
64 sudo apt install libdw-dev
65 sudo apt install libdwarf-dev
66 sudo apt install libunwind-dev
67 sudo apt install shellcheck
68 sudo apt install texlive-font-utils
69 sudo apt install xvfb
70
71 cd "$HOME"/bin || exit 1
72
73 if ! [ -f doxygen-bash.sed ]
74 then
75     wget https://raw.githubusercontent.com/Anvil/bash-doxygen/master/doxygen-bash.sed
76     chmod +x doxygen-bash.sed
77 fi
78
79 latest_plantuml=$(curl --silent -qI https://github.com/plantuml/plantuml/releases/latest | awk -F '/' '/^location/ {print  substr($NF, 1, length($NF)-1)}')
80
81 if ! [ -f "plantuml-${latest_plantuml#v}.jar" ]
82 then
83     wget "https://github.com/plantuml/plantuml/releases/download/$latest_plantuml/plantuml-${latest_plantuml#v}.jar"
84     ln --symbolic --force "plantuml-${latest_plantuml#v}.jar" plantuml.jar
85     chmod +x plantuml.jar
86 fi
87
88