Cleanup Bash scripts.

This makes them pass shellcheck. Except for a few unused
export warnings.

I also wonder if the majority of these files should be
in the root of the project, or should be moved to "build-scripts"
(or should still even exist).

a few minor changes

one more minor changes
This commit is contained in:
Robert de Rooy
2023-04-15 15:39:25 +02:00
parent f11408c5a4
commit 694cc766a4
49 changed files with 862 additions and 766 deletions

View File

@@ -5,17 +5,17 @@
# git clone https://github.com/joncampbell123/dosbox-x dosbox-x-sdl2
#
# Then run this script
arch=`uname -m`
name=`date +%F-%T | sed -e 's/:/-/g' | sed -e 's/-//g'`
name="dosbox-x-macosx-$arch-$name.zip"
arch=$(uname -m)
name=$(date +%F-%T | sed -e 's/:/-/g' | sed -e 's/-//g')
name="dosbox-x-macosx-${arch}-${name}.zip"
echo "Will pack to $name"
echo "Will pack to ${name}"
sleep 1
top=`pwd`
cd "$top" || exit 1
top=$(pwd)
cd "${top}" || exit 1
cd "$top/dosbox-x" || exit 1
cd "${top}/dosbox-x" || exit 1
git clean -dfx
git reset --hard
git checkout master
@@ -30,7 +30,7 @@ cp CHANGELOG CHANGELOG.txt || exit 1
cp COPYING COPYING.txt || exit 1
cp contrib/macos/readme.txt README.txt || exit 1
cd "$top/dosbox-x-sdl2" || exit 1
cd "${top}/dosbox-x-sdl2" || exit 1
git clean -dfx
git reset --hard
git checkout master
@@ -45,10 +45,9 @@ cp CHANGELOG CHANGELOG.txt || exit 1
cp COPYING COPYING.txt || exit 1
cp contrib/macos/readme.txt README.txt || exit 1
cd "$top" || exit 1
cd "${top}" || exit 1
echo "Packing up now..."
zip -r -9 "$name" dosbox-x/dosbox-x.app dosbox-x/CHANGELOG.txt dosbox-x/COPYING.txt dosbox-x/README.txt dosbox-x-sdl2/dosbox-x.app dosbox-x-sdl2/CHANGELOG.txt dosbox-x-sdl2/COPYING.txt dosbox-x-sdl2/README.txt || exit 1
exit 0

View File

@@ -1,4 +1,4 @@
#!/bin/sh
repodir=`cat /mingw/msys/1.0/pwd.txt`
cd $repodir
./$1
#!/bin/sh
repodir=$(cat /mingw/msys/1.0/pwd.txt)
cd "${repodir}" || exit
./"${1}"

View File

@@ -1,93 +1,93 @@
#!/usr/bin/env bash
#
# Setup:
# git clone https://github.com/joncampbell123/dosbox-x dosbox-x-mingw-hx-dos
#
# Then run this script
name=`date +%F-%T | sed -e 's/:/-/g' | sed -e 's/-//g'`
name="dosbox-x-mingw-hx-dos-$name.zip"
echo "Will pack to $name"
sleep 1
# CHECK: You must use MinGW, not MinGW32/MinGW64.
# The MinGW32/MinGW64 version has extra dependencies that require
# Windows XP or higher and KERNEL functions not provided by HX-DOS.
#
# The main MinGW version can target all the way down to Windows 95
# (as long as a working MSVCRT.DLL is installed) and the compiled
# binaries will work in HX-DOS.
# Check 1: Make sure this is the MinGW environment.
#
# MinGW and MinGW32 will have MSYSTEM=MINGW32
# MinGW64 will have MSYSTEM=MINGW64.
if [[ x"$MSYSTEM" != x"MINGW32" ]]; then
echo "MinGW (not MinGW 64-bit) shell environment required"
exit 1
fi
# Check 2: Make sure this is the MinGW environment, not MinGW32/MinGW64.
#
# MinGW32/MinGW64 will have MSYSTEM_CARCH=i686
# MinGW will not have any such variable
if [ -n "$MSYSTEM_CARCH" ]; then
echo "Please use the original MinGW build environment, not MinGW32/MinGW64"
exit 1
fi
# OK GO
top=`pwd`
cd "$top" || exit 1
hxdosdir="dosbox-x-mingw-hx-dos"
tooldir="$top/$hxdosdir/vs/tool"
cd "$top/$hxdosdir" || exit 1
git clean -dfx
git reset --hard
git checkout master
git clean -dfx
git reset --hard
git pull
git clean -dfx
git reset --hard
./build-mingw-hx-dos || exit 1
# The paths of copied files and HX DOS Extender files
copydir="build-scripts/mingw/dosbox-x-mingw-hx-dos"
hxdir="build-scripts/mingw/hxdos-bin"
strip src/dosbox-x.exe || exit 1
cp src/dosbox-x.exe dosbox-x.exe || exit 1
$hxdir/pestub.exe -n dosbox-x.exe
$tooldir/upx.exe --strip-relocs=0 --lzma -9 dosbox-x.exe
cp CHANGELOG CHANGELOG.txt || exit 1
cp COPYING COPYING.txt || exit 1
cp dosbox-x.reference.conf dosbox-x.ref || exit 1
cp dosbox-x.reference.full.conf dosbox-x.ref.full || exit 1
cp contrib/windows/installer/inpout32.dll INPOUT32.DLL || exit 1
cp contrib/fonts/FREECG98.BMP . || exit 1
cp contrib/fonts/wqy_1?pt.bdf . || exit 1
cp contrib/fonts/Nouveau_IBM.ttf . || exit 1
cp $hxdir/DPMILD32.EXE . || exit 1
cp $hxdir/HDPMI32.EXE . || exit 1
cp $hxdir/HXGUIHLP.INI . || exit 1
cp $hxdir/README.TXT . || exit 1
cp $hxdir/WATTCP.CFG . || exit 1
cp $hxdir/WINSPOOL.DRV . || exit 1
cp $hxdir/*.DLL . || exit 1
mkdir -p drivez || exit 1
cp contrib/windows/installer/drivez_readme.txt drivez/readme.txt || exit 1
mkdir -p language || exit 1
for i in `ls contrib/translations/` ; do cp contrib/translations/$i/*.lng language/; done
cd "$top/$hxdosdir" || exit 1
echo "Packing up now..."
$tooldir/zip.exe -r -9 ../"$name" {CHANGELOG.txt,COPYING.txt,dosbox-x.exe,dosbox-x.ref,dosbox-x.ref.full,FREECG98.BMP,wqy_1?pt.bdf,Nouveau_IBM.ttf,DPMILD32.EXE,HDPMI32.EXE,HXGUIHLP.INI,README.TXT,WATTCP.CFG,WINSPOOL.DRV,*.DLL,drivez/*,language/*} || exit 1
cd ..
exit 0
#!/usr/bin/env bash
#
# Setup:
# git clone https://github.com/joncampbell123/dosbox-x dosbox-x-mingw-hx-dos
#
# Then run this script
name=$(date +%F-%T | sed -e 's/:/-/g' | sed -e 's/-//g')
name="dosbox-x-mingw-hx-dos-${name}.zip"
echo "Will pack to ${name}"
sleep 1
# CHECK: You must use MinGW, not MinGW32/MinGW64.
# The MinGW32/MinGW64 version has extra dependencies that require
# Windows XP or higher and KERNEL functions not provided by HX-DOS.
#
# The main MinGW version can target all the way down to Windows 95
# (as long as a working MSVCRT.DLL is installed) and the compiled
# binaries will work in HX-DOS.
# Check 1: Make sure this is the MinGW environment.
#
# MinGW and MinGW32 will have MSYSTEM=MINGW32
# MinGW64 will have MSYSTEM=MINGW64.
if [[ x"${MSYSTEM}" != x"MINGW32" ]]; then
echo "MinGW (not MinGW 64-bit) shell environment required"
exit 1
fi
# Check 2: Make sure this is the MinGW environment, not MinGW32/MinGW64.
#
# MinGW32/MinGW64 will have MSYSTEM_CARCH=i686
# MinGW will not have any such variable
if [ -n "${MSYSTEM_CARCH}" ]; then
echo "Please use the original MinGW build environment, not MinGW32/MinGW64"
exit 1
fi
# OK GO
top=$(pwd)
cd "${top}" || exit 1
hxdosdir="dosbox-x-mingw-hx-dos"
tooldir="${top}/${hxdosdir}/vs/tool"
cd "${top}/${hxdosdir}" || exit 1
git clean -dfx
git reset --hard
git checkout master
git clean -dfx
git reset --hard
git pull
git clean -dfx
git reset --hard
./build-mingw-hx-dos || exit 1
# The paths of copied files and HX DOS Extender files
copydir="build-scripts/mingw/dosbox-x-mingw-hx-dos"
hxdir="build-scripts/mingw/hxdos-bin"
strip src/dosbox-x.exe || exit 1
cp src/dosbox-x.exe dosbox-x.exe || exit 1
"${hxdir}"/pestub.exe -n dosbox-x.exe
"${tooldir}"/upx.exe --strip-relocs=0 --lzma -9 dosbox-x.exe
cp CHANGELOG CHANGELOG.txt || exit 1
cp COPYING COPYING.txt || exit 1
cp dosbox-x.reference.conf dosbox-x.ref || exit 1
cp dosbox-x.reference.full.conf dosbox-x.ref.full || exit 1
cp contrib/windows/installer/inpout32.dll INPOUT32.DLL || exit 1
cp contrib/fonts/FREECG98.BMP . || exit 1
cp contrib/fonts/wqy_1?pt.bdf . || exit 1
cp contrib/fonts/Nouveau_IBM.ttf . || exit 1
cp ${hxdir}/DPMILD32.EXE . || exit 1
cp ${hxdir}/HDPMI32.EXE . || exit 1
cp ${hxdir}/HXGUIHLP.INI . || exit 1
cp ${hxdir}/README.TXT . || exit 1
cp ${hxdir}/WATTCP.CFG . || exit 1
cp ${hxdir}/WINSPOOL.DRV . || exit 1
cp ${hxdir}/*.DLL . || exit 1
mkdir -p drivez || exit 1
cp contrib/windows/installer/drivez_readme.txt drivez/readme.txt || exit 1
mkdir -p language || exit 1
find contrib/translations/ -type f -name '*.lng' -exec cp {} language/ \;
cd "${top}/${hxdosdir}" || exit 1
echo "Packing up now..."
"${tooldir}"/zip.exe -r -9 ../"${name}" {CHANGELOG.txt,COPYING.txt,dosbox-x.exe,dosbox-x.ref,dosbox-x.ref.full,FREECG98.BMP,wqy_1?pt.bdf,Nouveau_IBM.ttf,DPMILD32.EXE,HDPMI32.EXE,HXGUIHLP.INI,README.TXT,WATTCP.CFG,WINSPOOL.DRV,*.DLL,drivez/*,language/*} || exit 1
cd ..
exit 0

View File

@@ -1,85 +1,84 @@
#!/usr/bin/env bash
#
# Setup:
# git clone https://github.com/joncampbell123/dosbox-x dosbox-x-mingw
#
# Then run this script
# Check 1: Make sure this is the MinGW32 environment.
#
# MinGW and MinGW32 will have MSYSTEM=MINGW32
# MinGW64 will have MSYSTEM=MINGW64.
if [[ "$MSYSTEM" == "MINGW32" ]]; then
cputype=win32
elif [[ "$MSYSTEM" == "MINGW64" ]]; then
cputype=win64
else
echo "MinGW32/MINGW64 (not MinGW) shell environment required"
exit 1
fi
name=`date +%F-%T | sed -e 's/:/-/g' | sed -e 's/-//g'`
name="dosbox-x-mingw-$cputype-$name.zip"
echo "Will pack to $name"
sleep 1
# OK GO
top=`pwd`
cd "$top" || exit 1
build="$top/mingw-build"
rm -Rf "$build"
mkdir -p "$build" || exit 1
ziptool="$top/dosbox-x-mingw/vs/tool/zip.exe"
# do it
for what in mingw mingw-sdl2 mingw-lowend mingw-lowend-sdl2; do
buildtarget="$build/$what"
mkdir -p "$buildtarget" || exit 1
mkdir -p "$buildtarget/drivez" || exit 1
mkdir -p "$buildtarget/scripts" || exit 1
mkdir -p "$buildtarget/shaders" || exit 1
mkdir -p "$buildtarget/glshaders" || exit 1
mkdir -p "$buildtarget/languages" || exit 1
cd "$top/dosbox-x-mingw" || exit 1
git clean -dfx
git reset --hard
git checkout master
git clean -dfx
git reset --hard
git pull
git clean -dfx
git reset --hard
./build-$what || exit 1
strip src/dosbox-x.exe || exit 1
cp src/dosbox-x.exe "$buildtarget/dosbox-x.exe" || exit 1
cp CHANGELOG "$buildtarget/CHANGELOG.txt" || exit 1
cp dosbox-x.reference.conf "$buildtarget/dosbox-x.reference.conf" || exit 1
cp dosbox-x.reference.full.conf "$buildtarget/dosbox-x.reference.full.conf" || exit 1
if [[ "$MSYSTEM" == "MINGW32" ]]; then
cp contrib/windows/installer/inpout32.dll "$buildtarget/inpout32.dll" || exit 1
else
cp contrib/windows/installer/inpoutx64.dll "$buildtarget/inpoutx64.dll" || exit 1
fi
cp contrib/fonts/FREECG98.BMP "$buildtarget/FREECG98.BMP" || exit 1
cp contrib/fonts/wqy_1?pt.bdf "$buildtarget/" || exit 1
cp contrib/fonts/Nouveau_IBM.ttf "$buildtarget/Nouveau_IBM.ttf" || exit 1
cp contrib/fonts/SarasaGothicFixed.ttf "$buildtarget/SarasaGothicFixed.ttf" || exit 1
cp contrib/windows/installer/drivez_readme.txt "$buildtarget/drivez/readme.txt" || exit 1
cp contrib/windows/installer/windows_explorer_context_menu*.bat "$buildtarget/scripts/" || exit 1
cp contrib/windows/shaders/* "$buildtarget/shaders/" || exit 1
cp contrib/glshaders/* "$buildtarget/glshaders/" || exit 1
cp contrib/translations/*/*.lng "$buildtarget/languages/" || exit 1
done
cd "$top" || exit 1
echo "Packing up now..."
$ziptool -r -9 "$name" "mingw-build" || exit 1
exit 0
#!/usr/bin/env bash
#
# Setup:
# git clone https://github.com/joncampbell123/dosbox-x dosbox-x-mingw
#
# Then run this script
# Check 1: Make sure this is the MinGW32 environment.
#
# MinGW and MinGW32 will have MSYSTEM=MINGW32
# MinGW64 will have MSYSTEM=MINGW64.
if [[ "${MSYSTEM}" == "MINGW32" ]]; then
cputype=win32
elif [[ "${MSYSTEM}" == "MINGW64" ]]; then
cputype=win64
else
echo "MinGW32/MINGW64 (not MinGW) shell environment required"
exit 1
fi
name=$(date +%F-%T | sed -e 's/:/-/g' | sed -e 's/-//g')
name="dosbox-x-mingw-${cputype}-${name}.zip"
echo "Will pack to ${name}"
sleep 1
# OK GO
top=$(pwd)
cd "${top}" || exit 1
build="${top}/mingw-build"
rm -Rf "${build}"
mkdir -p "${build}" || exit 1
ziptool="${top}/dosbox-x-mingw/vs/tool/zip.exe"
# do it
for what in mingw mingw-sdl2 mingw-lowend mingw-lowend-sdl2; do
buildtarget="${build}/${what}"
mkdir -p "${buildtarget}" || exit 1
mkdir -p "${buildtarget}/drivez" || exit 1
mkdir -p "${buildtarget}/scripts" || exit 1
mkdir -p "${buildtarget}/shaders" || exit 1
mkdir -p "${buildtarget}/glshaders" || exit 1
mkdir -p "${buildtarget}/languages" || exit 1
cd "${top}/dosbox-x-mingw" || exit 1
git clean -dfx
git reset --hard
git checkout master
git clean -dfx
git reset --hard
git pull
git clean -dfx
git reset --hard
./build-${what} || exit 1
strip src/dosbox-x.exe || exit 1
cp src/dosbox-x.exe "$buildtarget/dosbox-x.exe" || exit 1
cp CHANGELOG "$buildtarget/CHANGELOG.txt" || exit 1
cp dosbox-x.reference.conf "$buildtarget/dosbox-x.reference.conf" || exit 1
cp dosbox-x.reference.full.conf "$buildtarget/dosbox-x.reference.full.conf" || exit 1
if [[ "${MSYSTEM}" == "MINGW32" ]]; then
cp contrib/windows/installer/inpout32.dll "${buildtarget}/inpout32.dll" || exit 1
else
cp contrib/windows/installer/inpoutx64.dll "${buildtarget}/inpoutx64.dll" || exit 1
fi
cp contrib/fonts/FREECG98.BMP "${buildtarget}/FREECG98.BMP" || exit 1
cp contrib/fonts/wqy_1?pt.bdf "${buildtarget}/" || exit 1
cp contrib/fonts/Nouveau_IBM.ttf "${buildtarget}/Nouveau_IBM.ttf" || exit 1
cp contrib/fonts/SarasaGothicFixed.ttf "${buildtarget}/SarasaGothicFixed.ttf" || exit 1
cp contrib/windows/installer/drivez_readme.txt "${buildtarget}/drivez/readme.txt" || exit 1
cp contrib/windows/installer/windows_explorer_context_menu*.bat "{$buildtarget}/scripts/" || exit 1
cp contrib/windows/shaders/* "${buildtarget}/shaders/" || exit 1
cp contrib/glshaders/* "${buildtarget}/glshaders/" || exit 1
cp contrib/translations/*/*.lng "${buildtarget}/languages/" || exit 1
done
cd "${top}" || exit 1
echo "Packing up now..."
$ziptool -r -9 "${name}" "mingw-build" || exit 1
exit 0