Project

General

Profile

Feature #828 ยป 0016-meson-installer_build.sh-Improve-env-var-quotation.patch

Marko Lindqvist, 09/06/2024 09:19 PM

View differences:

platforms/windows/installer_cross/meson-installer_build.sh
DLLSPATH="$1"
GUI="$2"
case "$GUI" in
case "${GUI}" in
gtk3.22)
GUINAME="GTK3.22"
MPGUI="gtk3"
......
ruledit)
;;
*)
echo "Unknown gui type \"$GUI\"" >&2
echo "Unknown gui type \"${GUI}\"" >&2
exit 1 ;;
esac
if test "$CLIENT" = "" ; then
CLIENT="$GUI"
if test "${CLIENT}" = "" ; then
CLIENT="${GUI}"
fi
if ! test -d "$DLLSPATH" ; then
echo "Dllstack directory \"$DLLSPATH\" not found!" >&2
if ! test -d "${DLLSPATH}" ; then
echo "Dllstack directory \"${DLLSPATH}\" not found!" >&2
exit 1
fi
if ! ./meson-winbuild.sh "$DLLSPATH" "$GUI" ; then
if ! ./meson-winbuild.sh "${DLLSPATH}" "${GUI}" ; then
exit 1
fi
SETUP=$(grep "CrosserSetup=" $DLLSPATH/crosser.txt | sed -e 's/CrosserSetup="//' -e 's/"//')
SETUP=$(grep "CrosserSetup=" "${DLLSPATH}/crosser.txt" | sed -e 's/CrosserSetup="//' -e 's/"//')
SRC_ROOT="$(cd ../../.. || exit 1 ; pwd)"
......
exit 1
fi
if test "$GUI" = "ruledit" &&
if test "${GUI}" = "ruledit" &&
! ( cd "meson/build/${SETUP}-${GUI}" && ninja langstat_ruledit.txt ) ; then
echo "langstat_ruledit.txt creation failed!" >&2
exit 1
......
INSTDIR="meson/install/freeciv-${VERREV}-${SETUP}-${GUI}"
if ! mv $INSTDIR/bin/* $INSTDIR/ ||
! mv $INSTDIR/share/freeciv $INSTDIR/data ||
! mv $INSTDIR/share/doc $INSTDIR/ ||
! mkdir -p $INSTDIR/doc/freeciv/installer ||
if ! mv "${INSTDIR}/bin/"* "${INSTDIR}/" ||
! mv "${INSTDIR}/share/freeciv" "${INSTDIR}/data" ||
! mv "${INSTDIR}/share/doc" "${INSTDIR}/" ||
! mkdir -p "${INSTDIR}/doc/freeciv/installer" ||
! cat licenses/header.txt "${SRC_ROOT}/COPYING" \
> "${INSTDIR}/doc/freeciv/installer/COPYING.installer" ||
! rm -Rf $INSTDIR/lib ||
! cp Freeciv.url $INSTDIR/
! rm -Rf "${INSTDIR}/lib" ||
! cp Freeciv.url "${INSTDIR}/"
then
echo "Rearranging install directory failed!" >&2
exit 1
fi
if ! add_common_env "$DLLSPATH" "$INSTDIR" ; then
if ! add_common_env "${DLLSPATH}" "${INSTDIR}" ; then
echo "Copying common environment failed!" >&2
exit 1
fi
NSI_DIR="meson/nsi"
if ! mkdir -p "$NSI_DIR" ; then
echo "Creating \"$NSI_DIR\" directory failed" >&2
if ! mkdir -p "${NSI_DIR}" ; then
echo "Creating \"${NSI_DIR}\" directory failed" >&2
exit 1
fi
if test "$GUI" = "ruledit" ; then
if test "${GUI}" = "ruledit" ; then
if ! cp freeciv-ruledit.cmd "${INSTDIR}/"
then
echo "Adding cmd-file failed!" >&2
......
exit 1
fi
else
if ! cp freeciv-server.cmd freeciv-${CLIENT}.cmd freeciv-mp-${FCMP}.cmd $INSTDIR/
if ! cp freeciv-server.cmd "freeciv-${CLIENT}.cmd" "freeciv-mp-${FCMP}.cmd" "${INSTDIR}/"
then
echo "Adding cmd-files failed!" >&2
exit 1
fi
if ! add_sdl2_mixer_env "$DLLSPATH" "$INSTDIR" ; then
if ! add_sdl2_mixer_env "${DLLSPATH}" "${INSTDIR}" ; then
echo "Copying SDL2_mixer environment failed!" >&2
exit 1
fi
case $GUI in
gtk3.22)
if ! add_gtk3_env "$DLLSPATH" "$INSTDIR" ; then
if ! add_gtk3_env "${DLLSPATH}" "${INSTDIR}" ; then
echo "Copying gtk3 environment failed!" >&2
exit 1
fi
;;
gtk4|gtk4x)
if ! add_gtk4_env "$DLLSPATH" "$INSTDIR" ; then
if ! add_gtk4_env "${DLLSPATH}" "${INSTDIR}" ; then
echo "Copying gtk4 environment failed!" >&2
exit 1
fi
;;
sdl2)
# For gtk4 modpack installer
if ! add_gtk4_env "$DLLSPATH" "$INSTDIR" ; then
if ! add_gtk4_env "${DLLSPATH}" "${INSTDIR}" ; then
echo "Copying gtk4 environment failed!" >&2
exit 1
fi
if ! add_sdl2_env "$DLLSPATH" "$INSTDIR" ; then
if ! add_sdl2_env "${DLLSPATH}" "${INSTDIR}" ; then
echo "Copying sdl2 environment failed!" >&2
exit 1
fi
......
NSI_FILE="${NSI_DIR}/client-${SETUP}-${VERREV}-${GUI}.nsi"
if test "$GUI" = "sdl2" ; then
if test "${GUI}" = "sdl2" ; then
if ! ./create-freeciv-sdl2-nsi.sh \
"$INSTDIR" "meson/output" "$VERREV" "$SETUP" "$UNINSTALLER" \
> "$NSI_FILE"
"${INSTDIR}" "meson/output" "${VERREV}" "${SETUP}" "${UNINSTALLER}" \
> "${NSI_FILE}"
then
exit 1
fi
else
if ! ./create-freeciv-gtk-qt-nsi.sh \
"$INSTDIR" "meson/output" "$VERREV" "$GUI" "$GUINAME" \
"$SETUP" "$MPGUI" "$EXE_ID" "$UNINSTALLER" \
> "$NSI_FILE"
"${INSTDIR}" "meson/output" "${VERREV}" "${GUI}" "${GUINAME}" \
"${SETUP}" "${MPGUI}" "${EXE_ID}" "${UNINSTALLER}" \
> "${NSI_FILE}"
then
exit 1
fi
......
exit 1
fi
if ! makensis -NOCD "$NSI_FILE"
if ! makensis -NOCD "${NSI_FILE}"
then
echo "Creating installer failed!" >&2
exit 1
    (1-1/1)