2 # Setup development environment on MSYS2
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
14 function print_usage
() {
15 printf "\\nUtility to setup an MSYS2 MinGW-w64 system for Wireshark development.\\n"
16 printf "The basic usage installs the needed software\\n\\n"
17 printf "Usage: %s [--install-optional] [...other options...]\\n" "$0"
18 printf "\\t--install-optional: install optional software as well\\n"
19 printf "\\t--install-nsis-deps: install packages required to build NSIS installer\\n"
20 printf "\\t--install-test-deps: install packages required to run all tests\\n"
21 printf "\\t--install-all: install everything\\n"
22 printf "\\t[other]: other options are passed as-is to pacman\\n"
23 printf "\\tPass --noconfirm to bypass any \"are you sure?\" messages.\\n"
51 OPTIONS
="$OPTIONS $arg"
56 PACKAGE_PREFIX
="${MINGW_PACKAGE_PREFIX:-mingw-w64-x86_64}"
59 # Lua packaging is kind of a mess. Lua 5.2 is not available. Some packages have
60 # a hard dependency on LuaJIT and it conflicts with Lua 5.1 and vice-versa.
61 # This will probably have to be fixed by the MSYS2 maintainers.
62 # XXX Is this still true? We can use Lua 5.3 and 5.4 now, though we still
63 # might want to package our own version to use our UTF-8 on Windows patch
64 # (though we don't apply that patch yet.)
66 BASIC_LIST
="base-devel \
68 ${PACKAGE_PREFIX}-bcg729 \
69 ${PACKAGE_PREFIX}-brotli \
70 ${PACKAGE_PREFIX}-c-ares \
71 ${PACKAGE_PREFIX}-cmake \
72 ${PACKAGE_PREFIX}-glib2 \
73 ${PACKAGE_PREFIX}-gnutls \
74 ${PACKAGE_PREFIX}-libgcrypt \
75 ${PACKAGE_PREFIX}-libilbc \
76 ${PACKAGE_PREFIX}-libmaxminddb \
77 ${PACKAGE_PREFIX}-nghttp2 \
78 ${PACKAGE_PREFIX}-libpcap \
79 ${PACKAGE_PREFIX}-libsmi \
80 ${PACKAGE_PREFIX}-libssh \
81 ${PACKAGE_PREFIX}-libxml2 \
82 ${PACKAGE_PREFIX}-lz4 \
83 ${PACKAGE_PREFIX}-minizip \
84 ${PACKAGE_PREFIX}-ninja \
85 ${PACKAGE_PREFIX}-opencore-amr \
86 ${PACKAGE_PREFIX}-opus \
87 ${PACKAGE_PREFIX}-pcre2 \
88 ${PACKAGE_PREFIX}-python \
89 ${PACKAGE_PREFIX}-qt6-base \
90 ${PACKAGE_PREFIX}-qt6-multimedia \
91 ${PACKAGE_PREFIX}-qt6-tools \
92 ${PACKAGE_PREFIX}-qt6-translations \
93 ${PACKAGE_PREFIX}-qt6-5compat \
94 ${PACKAGE_PREFIX}-sbc \
95 ${PACKAGE_PREFIX}-snappy \
96 ${PACKAGE_PREFIX}-spandsp \
97 ${PACKAGE_PREFIX}-speexdsp \
98 ${PACKAGE_PREFIX}-toolchain \
99 ${PACKAGE_PREFIX}-winsparkle \
100 ${PACKAGE_PREFIX}-zlib \
101 ${PACKAGE_PREFIX}-zstd"
103 ADDITIONAL_LIST
="${PACKAGE_PREFIX}-asciidoctor \
104 ${PACKAGE_PREFIX}-ccache \
105 ${PACKAGE_PREFIX}-docbook-xsl \
106 ${PACKAGE_PREFIX}-doxygen \
107 ${PACKAGE_PREFIX}-libxslt \
108 ${PACKAGE_PREFIX}-perl \
109 ${PACKAGE_PREFIX}-ntldd"
111 NSISDEPS_LIST
="${PACKAGE_PREFIX}-nsis"
113 TESTDEPS_LIST
="${PACKAGE_PREFIX}-python-pytest \
114 ${PACKAGE_PREFIX}-python-pytest-xdist"
116 ACTUAL_LIST
=$BASIC_LIST
118 if [ $ADDITIONAL -ne 0 ]
120 ACTUAL_LIST
="$ACTUAL_LIST $ADDITIONAL_LIST"
123 if [ $NSISDEPS -ne 0 ]
125 ACTUAL_LIST
="$ACTUAL_LIST $NSISDEPS_LIST"
128 if [ $TESTDEPS -ne 0 ]
130 ACTUAL_LIST
="$ACTUAL_LIST $TESTDEPS_LIST"
133 # Partial upgrades are unsupported.
134 pacman
--sync --refresh --sysupgrade --needed $ACTUAL_LIST $OPTIONS ||
exit 2
136 if [ $ADDITIONAL -eq 0 ]
138 printf "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n"
141 if [ $NSISDEPS -eq 0 ]
143 printf "\n*** NSIS installer deps not installed. Rerun with --install-nsis-deps to have them.\n"
146 if [ $TESTDEPS -eq 0 ]
148 printf "\n*** Test deps not installed. Rerun with --install-test-deps to have them.\n"