sq epan/dissectors/pidl/rcg/rcg.cnf
[wireshark-sm.git] / tools / arch-setup.sh
blob8c8e9f1a4df4f57bdd004a61d719e8479a5aad71
1 #!/bin/bash
2 # Setup development environment on Arch Linux
4 # Wireshark - Network traffic analyzer
5 # By Gerald Combs <gerald@wireshark.org>
6 # Copyright 1998 Gerald Combs
8 # SPDX-License-Identifier: GPL-2.0-or-later
10 # We drag in tools that might not be needed by all users; it's easier
11 # that way.
14 set -e -u -o pipefail
16 function print_usage() {
17 printf "\\nUtility to setup a pacman-based system for Wireshark development.\\n"
18 printf "The basic usage installs the needed software\\n\\n"
19 printf "Usage: %s [--install-optional] [...other options...]\\n" "$0"
20 printf "\\t--install-optional: install optional software as well\\n"
21 printf "\\t--install-test-deps: install packages required to run all tests\\n"
22 printf "\\t--install-all: install everything\\n"
23 printf "\\t[other]: other options are passed as-is to pacman\\n"
24 printf "\\tPass --noconfirm to bypass any \"are you sure?\" messages.\\n"
27 ADDITIONAL=0
28 TESTDEPS=0
29 AUR=0
30 OPTIONS=
31 for arg; do
32 case $arg in
33 --help)
34 print_usage
35 exit 0
37 --install-optional)
38 ADDITIONAL=1
40 --install-test-deps)
41 TESTDEPS=1
43 --install-all)
44 ADDITIONAL=1
45 TESTDEPS=1
46 AUR=1
49 OPTIONS="$OPTIONS $arg"
51 esac
52 done
54 # Check if the user is root
55 if [ "$(id -u)" -ne 0 ]
56 then
57 echo "You must be root."
58 exit 1
61 BASIC_LIST="base-devel
62 bcg729
63 brotli
64 c-ares
65 cmake
66 git
67 glib2
68 gnutls
69 krb5
70 libcap
71 libgcrypt
72 libilbc
73 libmaxminddb
74 libnghttp2
75 libnghttp3
76 libnl
77 libpcap
78 libssh
79 libxml2
80 lua
81 lz4
82 minizip
83 ninja
84 pcre2
85 python
86 qt6-base
87 qt6-multimedia
88 qt6-tools
89 qt6-5compat
90 sbc
91 snappy
92 spandsp
93 speexdsp
94 zlib
95 zstd"
97 ADDITIONAL_LIST="asciidoctor
98 ccache
99 docbook-xml
100 docbook-xsl
101 doxygen
102 libxslt
103 perl"
105 TESTDEPS_LIST="python-pytest
106 python-pytest-xdist"
108 ACTUAL_LIST=$BASIC_LIST
110 if [ $ADDITIONAL -ne 0 ]
111 then
112 ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST"
115 if [ $TESTDEPS -ne 0 ]
116 then
117 ACTUAL_LIST="$ACTUAL_LIST $TESTDEPS_LIST"
120 # Partial upgrades are unsupported.
121 # shellcheck disable=SC2086
122 pacman --sync --refresh --sysupgrade --needed $ACTUAL_LIST $OPTIONS || exit 2
124 if [ $ADDITIONAL -eq 0 ]
125 then
126 printf "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n"
129 if [ $TESTDEPS -eq 0 ]
130 then
131 printf "\n*** Test deps not installed. Rerun with --install-test-deps to have them.\n"
134 if [ $AUR -ne 0 ]
135 then
136 printf "\n*** These and other packages may also be found in the AUR: libsmi.\n"