7 case "`./config.guess`" in
10 echo Setting CYGWIN system environment variable.
12 echo Removing extended ACLs so umask works as expected.
14 PACKAGES="$PACKAGES,autoconf,automake,cygwin-devel,gcc-core"
15 PACKAGES="$PACKAGES,make,openssl-devel,zlib-devel"
29 export DEBIAN_FRONTEND=noninteractive
31 #echo "Setting up for '$TARGETS'"
35 if [ -x "`which lsb_release 2>&1`" ]; then
39 # Ubuntu 22.04 defaults to private home dirs which prevent the
40 # agent-getpeerid test from running ssh-add as nobody. See
41 # https://github.com/actions/runner-images/issues/6106
42 if [ ! -z "$SUDO" ] && ! "$SUDO" -u nobody test -x ~; then
43 echo ~ is not executable by nobody, adding perms.
47 if [ "${TARGETS}" = "kitchensink" ]; then
48 TARGETS="krb5 libedit pam sk selinux"
51 for flag in $CONFIGFLAGS; do
53 --with-pam) TARGETS="${TARGETS} pam" ;;
54 --with-libedit) TARGETS="${TARGETS} libedit" ;;
58 for TARGET in $TARGETS; do
60 default|without-openssl|without-zlib|c89)
64 PACKAGES="$PACKAGES clang-12"
67 PACKAGES="$PACKAGES libcrypt-devel libfido2-devel libkrb5-devel"
72 compiler=$(echo $TARGET | sed 's/-Werror//')
73 PACKAGES="$PACKAGES $compiler"
76 PACKAGES="$PACKAGES libkrb5-dev"
79 PACKAGES="$PACKAGES heimdal-dev"
83 setup) PACKAGES="$PACKAGES libedit-devel" ;;
84 apt) PACKAGES="$PACKAGES libedit-dev" ;;
88 PACKAGES="$PACKAGES libpam0g-dev"
91 INSTALL_FIDO_PPA="yes"
92 PACKAGES="$PACKAGES libfido2-dev libu2f-host-dev libcbor-dev"
95 PACKAGES="$PACKAGES libselinux1-dev selinux-policy-dev"
98 INSTALL_HARDENED_MALLOC=yes
101 PACKAGES="$PACKAGES musl-tools"
104 PACKAGES="$PACKAGES libgoogle-perftools-dev"
107 INSTALL_OPENSSL=OpenSSL_1_1_1k
111 INSTALL_OPENSSL=$(echo ${TARGET} | cut -f2 -d-)
112 case ${INSTALL_OPENSSL} in
113 1.1.1_stable) INSTALL_OPENSSL="OpenSSL_1_1_1-stable" ;;
114 1.*) INSTALL_OPENSSL="OpenSSL_$(echo ${INSTALL_OPENSSL} | tr . _)" ;;
115 3.*) INSTALL_OPENSSL="openssl-${INSTALL_OPENSSL}" ;;
117 PACKAGES="${PACKAGES} putty-tools"
120 INSTALL_LIBRESSL=$(echo ${TARGET} | cut -f2 -d-)
121 case ${INSTALL_LIBRESSL} in
123 *) INSTALL_LIBRESSL="$(echo ${TARGET} | cut -f2 -d-)" ;;
125 PACKAGES="${PACKAGES} putty-tools"
128 PACKAGES="$PACKAGES valgrind"
130 *) echo "Invalid option '${TARGET}'"
136 if [ "yes" = "$INSTALL_FIDO_PPA" ]; then
138 sudo apt install -qy software-properties-common
139 sudo apt-add-repository -y ppa:yubico/stable
143 while [ ! -z "$PACKAGES" ] && [ "$tries" -gt "0" ]; do
147 if sudo apt install -qy $PACKAGES; then
152 if /cygdrive/c/setup.exe -q -P `echo "$PACKAGES" | tr ' ' ,`; then
157 if [ ! -z "$PACKAGES" ]; then
160 tries=$(($tries - 1))
162 if [ ! -z "$PACKAGES" ]; then
163 echo "Package installation failed."
167 if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then
169 git clone https://github.com/GrapheneOS/hardened_malloc.git &&
170 cd ${HOME}/hardened_malloc &&
171 make -j2 && sudo cp out/libhardened_malloc.so /usr/lib/)
174 if [ ! -z "${INSTALL_OPENSSL}" ]; then
176 git clone https://github.com/openssl/openssl.git &&
177 cd ${HOME}/openssl &&
178 git checkout ${INSTALL_OPENSSL} &&
179 ./config no-threads shared ${SSLCONFOPTS} \
180 --prefix=/opt/openssl &&
181 make && sudo make install_sw)
184 if [ ! -z "${INSTALL_LIBRESSL}" ]; then
185 if [ "${INSTALL_LIBRESSL}" = "master" ]; then
186 (mkdir -p ${HOME}/libressl && cd ${HOME}/libressl &&
187 git clone https://github.com/libressl-portable/portable.git &&
188 cd ${HOME}/libressl/portable &&
189 git checkout ${INSTALL_LIBRESSL} &&
190 sh update.sh && sh autogen.sh &&
191 ./configure --prefix=/opt/libressl &&
192 make -j2 && sudo make install)
194 LIBRESSL_URLBASE=https://cdn.openbsd.org/pub/OpenBSD/LibreSSL
196 wget ${LIBRESSL_URLBASE}/libressl-${INSTALL_LIBRESSL}.tar.gz &&
197 tar xfz libressl-${INSTALL_LIBRESSL}.tar.gz &&
198 cd libressl-${INSTALL_LIBRESSL} &&
199 ./configure --prefix=/opt/libressl && make -j2 && sudo make install)