Atari ST toolchain installer theoretically working.

This commit is contained in:
Scott Duensing 2019-07-23 21:17:22 -05:00
parent 18c53676a3
commit d588561b0c
5 changed files with 275 additions and 115 deletions

View file

@ -1,10 +1,10 @@
TEMPLATE = app
CONFIG += console CONFIG += console
CONFIG -= \ CONFIG -= \
app_bundle \ app_bundle \
qt qt
JOEY = /home/scott/joey
JOEY_INCLUDES = \ JOEY_INCLUDES = \
$$JOEY/dist $$JOEY/dist

View file

@ -41,3 +41,6 @@ SDL_LIBS = \
LIBS += \ LIBS += \
$$SDL_LIBS $$SDL_LIBS
DISTFILES += \
joey.pri

View file

@ -41,6 +41,8 @@
#define segment(x) #define segment(x)
typedef short jint16; typedef short jint16;
typedef unsigned short juint16; typedef unsigned short juint16;
typedef int jint32;
typedef unsigned int juint32;
#elif _WIN32 #elif _WIN32
@ -48,9 +50,10 @@ typedef unsigned short juint16;
#define JOEY_PC #define JOEY_PC
#define JOEY_LITLE_ENDIAN #define JOEY_LITLE_ENDIAN
#define JOEY_PATH_SEPARATOR '\\' #define JOEY_PATH_SEPARATOR '\\'
#define segment(x)
typedef short jint16; typedef short jint16;
typedef unsigned short juint16; typedef unsigned short juint16;
typedef int jint32;
typedef unsigned int juint32;
#elif __APPLE__ #elif __APPLE__
@ -58,9 +61,10 @@ typedef unsigned short juint16;
#define JOEY_PC #define JOEY_PC
#define JOEY_LITLE_ENDIAN #define JOEY_LITLE_ENDIAN
#define JOEY_PATH_SEPARATOR '/' #define JOEY_PATH_SEPARATOR '/'
#define segment(x)
typedef short jint16; typedef short jint16;
typedef unsigned short juint16; typedef unsigned short juint16;
typedef int jint32;
typedef unsigned int juint32;
#elif __ORCAC__ #elif __ORCAC__
@ -70,6 +74,8 @@ typedef unsigned short juint16;
#define __attribute__(x) #define __attribute__(x)
typedef int jint16; typedef int jint16;
typedef unsigned int juint16; typedef unsigned int juint16;
typedef long jint32;
typedef unsigned long juint32;
#ifndef JOEY_MAIN #ifndef JOEY_MAIN
#pragma noroot #pragma noroot
#endif #endif
@ -84,9 +90,10 @@ typedef unsigned int juint16;
#define JOEY_BIG_ENDIAN #define JOEY_BIG_ENDIAN
#define JOEY_PATH_SEPARATOR '/' #define JOEY_PATH_SEPARATOR '/'
#define __attribute__(x) #define __attribute__(x)
#define segment(x)
typedef int jint16; typedef int jint16;
typedef unsigned int juint16; typedef unsigned int juint16;
typedef long jint32;
typedef unsigned long juint32;
#else #else
@ -94,9 +101,10 @@ typedef unsigned int juint16;
#define JOEY_BIG_ENDIAN #define JOEY_BIG_ENDIAN
#define JOEY_PATH_SEPARATOR '/' #define JOEY_PATH_SEPARATOR '/'
#define __attribute__(x) #define __attribute__(x)
#define segment(x)
typedef int jint16; typedef int jint16;
typedef unsigned int juint16; typedef unsigned int juint16;
typedef long jint32;
typedef unsigned long juint32;
#endif #endif

View file

@ -27,8 +27,6 @@
#define JOEY_MAIN #define JOEY_MAIN
#include "joey.h" #include "joey.h"
#ifdef JOEY_IIGS #ifdef JOEY_IIGS
segment "testapp"; segment "testapp";
#endif #endif

View file

@ -26,17 +26,20 @@
# Global variables # Global variables
# #
G_TITLE="JoeyLib Installer" G_TITLE="JoeyLib Installer"
G_WORK=installerWork
G_PARENT= G_PARENT=
G_SCRIPT=
G_UID=$(id -ru) G_UID=$(id -ru)
G_GID=$(id -rg) G_GID=$(id -rg)
G_IS_INSTALLED=() G_IS_INSTALLED=()
G_VBCC_CURRENT="2017-08-14"
G_IIGS=0 G_IIGS=0
#G_AMIGA=1 #G_AMIGA=1
#G_ATARIST=2 G_ATARIST=1
G_LINUX32=1 G_LINUX32=2
G_LINUX64=2 G_LINUX64=3
G_WIN32=3 G_WIN32=4
G_WIN64=4 G_WIN64=5
#G_MAC32=7 #G_MAC32=7
#G_MAC64=8 #G_MAC64=8
#G_ANDROID=9 #G_ANDROID=9
@ -56,9 +59,6 @@ function buildPCDeps() {
local SRC="${G_PARENT}/joeylib/joeylib/src" local SRC="${G_PARENT}/joeylib/joeylib/src"
local G_CFLAGS="-Wall -D_REENTRANT_ -I${SRC} -I${PREFIX}/include -c" local G_CFLAGS="-Wall -D_REENTRANT_ -I${SRC} -I${PREFIX}/include -c"
echo ""
tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!"
mkdir -p ${PREFIX} mkdir -p ${PREFIX}
pushd deps &> /dev/null pushd deps &> /dev/null
@ -67,9 +67,7 @@ function buildPCDeps() {
export CXX="${CXX_EXPORT}" export CXX="${CXX_EXPORT}"
# SDL2 # SDL2
echo "" purple "Building SDL2"
tBoldBox tPURPLE "Building SDL2"
echo ""
if [[ ! -d SDL ]]; then if [[ ! -d SDL ]]; then
hg clone http://hg.libsdl.org/SDL hg clone http://hg.libsdl.org/SDL
fi fi
@ -89,9 +87,7 @@ function buildPCDeps() {
fi fi
# libModPlug # libModPlug
echo "" purple "Building libModPlug"
tBoldBox tPURPLE "Building libModPlug"
echo ""
if [[ ! -d libmodplug ]]; then if [[ ! -d libmodplug ]]; then
git clone https://github.com/Konstanty/libmodplug.git git clone https://github.com/Konstanty/libmodplug.git
pushd libmodplug &> /dev/null pushd libmodplug &> /dev/null
@ -118,9 +114,7 @@ function buildPCDeps() {
fi fi
# SDL_mixer # SDL_mixer
echo "" purple "Building SDL_mixer"
tBoldBox tPURPLE "Building SDL_mixer"
echo ""
if [[ ! -d SDL_mixer ]]; then if [[ ! -d SDL_mixer ]]; then
hg clone http://hg.libsdl.org/SDL_mixer hg clone http://hg.libsdl.org/SDL_mixer
fi fi
@ -157,9 +151,7 @@ function buildPCDeps() {
export CXX="${CXX_OLD}" export CXX="${CXX_OLD}"
# JoeyLib # JoeyLib
echo "" purple "Building JoeyLib"
tBoldBox tPURPLE "Building JoeyLib"
echo ""
if [[ -d "${DIST}" ]]; then if [[ -d "${DIST}" ]]; then
rm -rf "${DIST}" rm -rf "${DIST}"
fi fi
@ -198,22 +190,84 @@ function configRead() {
function configWrite() { function configWrite() {
local O=${G_PARENT}/joeyDev.sh local O=${G_PARENT}/joeyDev.sh
local P=\${JOEYPATH}
echo "#!/bin/bash" > "${O}" echo "#!/bin/bash" > "${O}"
# Remember the initial path so we can run this more than once
echo "if [[ -z \$JOEYPATH || \"\${JOEYPATH}\" == \"\" ]]; then" >> "${O}" echo "if [[ -z \$JOEYPATH || \"\${JOEYPATH}\" == \"\" ]]; then" >> "${O}"
echo -e "\texport JOEYPATH=\"\${PATH}\"" >> "${O}" echo -e "\texport JOEYPATH=\"\${PATH}\"" >> "${O}"
echo "fi" >> "${O}" echo "fi" >> "${O}"
echo "export PATH=\"\${JOEYPATH}\"" >> "${O}"
echo "export JOEY=\"${G_PARENT}\"" >> "${O}" echo "export JOEY=\"${G_PARENT}\"" >> "${O}"
if [[ ${G_IS_INSTALLED[$G_IIGS]} == 1 ]]; then if [[ ${G_IS_INSTALLED[$G_IIGS]} == 1 ]]; then
# IIgs Runtime & ORCA Compilers # IIgs Runtime & ORCA Compilers
P=\${JOEY}/sdks/IIgs:${P}
echo "export GOLDEN_GATE=\"\${JOEY}/sdks/IIgs/ORCA\"" >> "${O}" echo "export GOLDEN_GATE=\"\${JOEY}/sdks/IIgs/ORCA\"" >> "${O}"
echo "export PATH=\"\${JOEY}/sdks/IIgs:\${PATH}\"" >> "${O}"
echo "mountORCA.sh" >> "${O}" echo "mountORCA.sh" >> "${O}"
fi fi
if [[ ${G_IS_INSTALLED[$G_ATARIST]} == 1 ]]; then
# All VBCC targets get these
P=\${JOEY}/sdks/vbcc/bin:${P}
echo "export VBCC=\"\${JOEY}/sdks/vbcc\"" >> "${O}"
fi
echo "export PATH=\"${P}\"" >> "${O}"
chmod +x "${O}" chmod +x "${O}"
} }
function doSudo() {
local ARGS="$@"
local ASK="${G_PARENT}/${G_WORK}/askPass.sh"
cat <<- ASKPASS > "${ASK}"
#!/bin/bash
"${G_PARENT}/${G_SCRIPT}" ASKPASS
ASKPASS
chmod +x "${ASK}"
if [[ "${ARGS}x" == "x" ]]; then
SUDO_ASKPASS="${ASK}" sudo -A -v
else
SUDO_ASKPASS="${ASK}" sudo -A "${ARGS}"
fi
}
function doSudoAskPass() {
local RET=
local PASSWORD=
set +e
PASSWORD=$(
whiptail --passwordbox "\n${G_TITLE} needs superuser access.\n\nPlease enter your password:" 12 60 --title "Need Root" 3>&1 1>&2 2>&3
)
RET=$?
set -e
if [[ ${RET} -ne 0 ]]; then
echo "Cannot continue without superuser access." 1>&2
exit 1
fi
printf "${PASSWORD}\n"
exit 0
}
function download() {
local URL=$1
local FILE=$2
if [[ -z ${FILE} ]]; then
FILE=${URL##*/}
fi
if [[ -e "${FILE}" ]]; then
rm -f "${FILE}"
fi
wget -O "${FILE}" ${URL}
}
function fetchGitHubRelease() { function fetchGitHubRelease() {
local __RESULT=$1 local __RESULT=$1
local DEVELOPER=$2 local DEVELOPER=$2
@ -224,11 +278,7 @@ function fetchGitHubRelease() {
| cut -d : -f 2,3 \ | cut -d : -f 2,3 \
| tr -d \" \ | tr -d \" \
| head -n 1) | head -n 1)
local FILE=${URL##*/} download ${URL}
if [[ -e "${FILE}" ]]; then
rm "${FILE}"
fi
wget ${URL}
eval $__RESULT=\${FILE} eval $__RESULT=\${FILE}
} }
@ -251,9 +301,7 @@ function installIIgs() {
chmod 777 "${IIGS}/ORCA" chmod 777 "${IIGS}/ORCA"
if [[ ! -e "${IIGS}/hfsDrive.img" ]]; then if [[ ! -e "${IIGS}/hfsDrive.img" ]]; then
echo "" purple "Creating HFS Volume"
tBoldBox tPURPLE "Creating HFS Volume"
echo ""
O=${IIGS}/mountORCA.sh O=${IIGS}/mountORCA.sh
echo "#!/bin/bash" > "${O}" echo "#!/bin/bash" > "${O}"
echo "IIGS=${IIGS}" >> "${O}" echo "IIGS=${IIGS}" >> "${O}"
@ -280,7 +328,7 @@ function installIIgs() {
fi fi
"${IIGS}/mountORCA.sh" "${IIGS}/mountORCA.sh"
sudo chown ${G_UID}:${G_GID} "${IIGS}/ORCA/." doSudo chown ${G_UID}:${G_GID} "${IIGS}/ORCA/."
if [[ ! -e "${IIGS}/ORCA/Languages/cc" ]]; then if [[ ! -e "${IIGS}/ORCA/Languages/cc" ]]; then
tFileBrowser ORCA "Please locate your 'OPUS ][ The Software' ISO" .iso .. tFileBrowser ORCA "Please locate your 'OPUS ][ The Software' ISO" .iso ..
@ -289,17 +337,12 @@ function installIIgs() {
fi fi
fi fi
echo ""
tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!"
if [[ ! -d GoldenGate ]]; then if [[ ! -d GoldenGate ]]; then
tFileBrowser GGATE "Please locate your 'Golden Gate' MSI" .msi .. tFileBrowser GGATE "Please locate your 'Golden Gate' MSI" .msi ..
if [[ -z ${GGATE} || "${GGATE}" == "" ]]; then if [[ -z ${GGATE} || "${GGATE}" == "" ]]; then
return 0 return 0
fi fi
echo "" purple "Building GoldenGate"
tBoldBox tPURPLE "Building GoldenGate"
echo ""
git clone git@gitlab.com:GoldenGate/GoldenGate.git git clone git@gitlab.com:GoldenGate/GoldenGate.git
if [ ! -d GoldenGate ]; then if [ ! -d GoldenGate ]; then
tBoldBox tRED "Unable to clone the GoldenGate repository!" tBoldBox tRED "Unable to clone the GoldenGate repository!"
@ -328,15 +371,11 @@ function installIIgs() {
fi fi
if [[ ! -e "${IIGS}/ORCA/Languages/cc" ]]; then if [[ ! -e "${IIGS}/ORCA/Languages/cc" ]]; then
echo "" purple "Installing ORCA/C"
tBoldBox tPURPLE "Installing ORCA/C"
echo ""
isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORKS isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORKS
"${IIGS}/opus-extractor" -v BYTEWORKS "${IIGS}/ORCA" "${IIGS}/opus-extractor" -v BYTEWORKS "${IIGS}/ORCA"
echo "" purple "Upgrading ORCA/C"
tBoldBox tPURPLE "Upgrading ORCA/C"
echo ""
fetchGitHubRelease RESULT byteworksinc ORCA-C 2mg fetchGitHubRelease RESULT byteworksinc ORCA-C 2mg
"${IIGS}/opus-extractor" -v -s / ${RESULT} "${IIGS}/ORCA" "${IIGS}/opus-extractor" -v -s / ${RESULT} "${IIGS}/ORCA"
@ -369,9 +408,7 @@ function installIIgs() {
fi fi
if [[ ! -d gsplus ]]; then if [[ ! -d gsplus ]]; then
echo "" purple "Building GSplus"
tBoldBox tPURPLE "Building GSplus"
echo ""
git clone https://github.com/digarok/gsplus.git git clone https://github.com/digarok/gsplus.git
mkdir gsplus/build mkdir gsplus/build
pushd gsplus/build &> /dev/null pushd gsplus/build &> /dev/null
@ -389,33 +426,21 @@ function installIIgs() {
fi fi
if [[ ! -f "${IIGS}/gsplus/ROM.03" ]]; then if [[ ! -f "${IIGS}/gsplus/ROM.03" ]]; then
echo "" purple "Installing IIgs ROM"
tBoldBox tPURPLE "Installing IIgs ROM" download http://www.whatisthe2gs.apple2.org.za/files/rom3.zip
echo ""
if [[ -e rom3.zip ]]; then
rm -f rom3.zip
fi
wget http://www.whatisthe2gs.apple2.org.za/files/rom3.zip
unzip rom3.zip unzip rom3.zip
mv -f APPLE2GS.ROM2 "${IIGS}/gsplus/ROM.03" mv -f APPLE2GS.ROM2 "${IIGS}/gsplus/ROM.03"
fi fi
if [[ ! -f "${IIGS}/gsplus/System601.po" ]]; then if [[ ! -f "${IIGS}/gsplus/System601.po" ]]; then
echo "" purple "Installing GS/OS"
tBoldBox tPURPLE "Installing GS/OS" download http://www.whatisthe2gs.apple2.org.za/files/harddrive_image.zip
echo ""
if [[ -e harddrive_image.zip ]]; then
rm -f harddrive_image.zip
fi
wget http://www.whatisthe2gs.apple2.org.za/files/harddrive_image.zip
unzip harddrive_image.zip unzip harddrive_image.zip
mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po" mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po"
fi fi
if [[ ! -d cadius ]]; then if [[ ! -d cadius ]]; then
echo "" purple "Building Cadius"
tBoldBox tPURPLE "Building Cadius"
echo ""
git clone https://github.com/mach-kernel/cadius.git git clone https://github.com/mach-kernel/cadius.git
pushd cadius &> /dev/null pushd cadius &> /dev/null
make make
@ -429,13 +454,8 @@ function installIIgs() {
fi fi
if [[ ! -e "${IIGS}/ntconverter/ntconverter.php" ]]; then if [[ ! -e "${IIGS}/ntconverter/ntconverter.php" ]]; then
echo "" purple "Installing NinjaTracker Converter"
tBoldBox tPURPLE "Installing NinjaTracker Converter" download https://www.ninjaforce.com/downloads/ntconverter.zip
echo ""
if [[ -e ntconverter.zip ]]; then
rm -f ntconverter.zip
fi
wget https://www.ninjaforce.com/downloads/ntconverter.zip
unzip ntconverter.zip unzip ntconverter.zip
mkdir -p "${IIGS}/ntconverter" mkdir -p "${IIGS}/ntconverter"
cp -f ntconverter.php "${IIGS}/ntconverter/." cp -f ntconverter.php "${IIGS}/ntconverter/."
@ -444,20 +464,13 @@ function installIIgs() {
mkdir -p "${JOEY}/dist/IIgs" mkdir -p "${JOEY}/dist/IIgs"
if [[ ! -e "${JOEY}/dist/IIgs/Tool221#ba0000" ]]; then if [[ ! -e "${JOEY}/dist/IIgs/Tool221#ba0000" ]]; then
echo "" purple "Installing Tool221"
tBoldBox tPURPLE "Installing Tool221" download https://www.brutaldeluxe.fr/products/apple2gs/tool221/ninjatracker_tool221_v2.1.2mg
echo ""
if [[ -e ninjatracker_tool221_v2.1.2mg ]]; then
rm -f ninjatracker_tool221_v2.1.2mg
fi
wget https://www.brutaldeluxe.fr/products/apple2gs/tool221/ninjatracker_tool221_v2.1.2mg
"${IIGS}/cadius/cadius" extractfile ninjatracker_tool221_v2.1.2mg NT.TOOL221.V2.1/SYSTEM/TOOLS/TOOL221 . "${IIGS}/cadius/cadius" extractfile ninjatracker_tool221_v2.1.2mg NT.TOOL221.V2.1/SYSTEM/TOOLS/TOOL221 .
cp -f TOOL221#BA0000 "${JOEY}/dist/IIgs/Tool221#ba0000" cp -f TOOL221#BA0000 "${JOEY}/dist/IIgs/Tool221#ba0000"
fi fi
echo "" purple "Building JoeyLib"
tBoldBox tPURPLE "Building JoeyLib"
echo ""
O=${IIGS}/ORCA/out/joey O=${IIGS}/ORCA/out/joey
if [[ -d "${O}" ]]; then if [[ -d "${O}" ]]; then
rm -rf "${O}" rm -rf "${O}"
@ -524,11 +537,130 @@ function installWin64() {
} }
function installST() {
local ST="${G_PARENT}/sdks/st"
G_IS_INSTALLED[$G_ATARIST]=1
configWrite
configRead
mkdir -p "${ST}"
if [[ ! -e "${ST}/tos104us.img" ]]; then
purple "Installing TOS & Language Disk"
download http://www.avtandil.narod.ru/tos/tos104us.zip
unzip tos104us.zip
mv tos104us.img "${ST}/."
fi
if [[ ! -e "${ST}/ST_language_disk_ca026062-004.ST" ]]; then
purple "Installing Language Disk"
download http://www.atarimania.com/pgedump.awp?id=28777 1040languagedisk.zip
unzip 1040languagedisk.zip
mv ST_language_disk_ca026062-004.ST "${ST}/."
fi
if [[ ! -e "${ST}/hatari.cfg" ]]; then
purple "Configuring Hatari"
cat <<-CONFIG > "${ST}/hatari.cfg"
[Screen]
bResizable = TRUE
[Joystick1]
nJoystickMode = 1
nJoyId = 0
[Sound]
szYMCaptureFileName = "${ST}/hatari.wav"
[Memory]
szMemoryCaptureFileName = "${ST}/hatari.sav"
szAutoSaveFileName = "${ST}/auto.sav"
[Floppy]
szDiskAFileName = "${ST}/ST_language_disk_ca026062-004.ST"
szDiskImageDirectory = "${ST}"
[HardDisk]
szHardDiskDirectory = "${ST}"
szHardDiskImage = "${ST}"
szIdeMasterHardDiskImage = "${ST}"
szIdeSlaveHardDiskImage = "${ST}"
[ROM]
szTosImageFileName = "${ST}/tos104us.img"
bPatchTos = TRUE
[Printer]
szPrintToFileName = "${ST}/hatari.prn"
[System]
bPatchTimerD = TRUE
bFastBoot = TRUE
[Video]
AviRecordFile = "${ST}/hatari.avi"
CONFIG
fi
installVbcc
if [[ ! -e "${G_PARENT}/sdks/vbcc/targets/m68k-atari" ]]; then
purple "Configuring VBCC"
download http://server.owl.de/~frank/vbcc/${G_VBCC_CURRENT}/vbcc_target_m68k-atari.lha
lha xf vbcc_target_m68k-atari.lha
mkdir -p "${G_PARENT}/sdks/vbcc/targets"
cp -rf vbcc_target_m68k-atari/targets/m68k-atari "${G_PARENT}/sdks/vbcc/targets/."
fi
#hatari -c ${JOEY}/sdks/st/hatari.cfg
}
function installVbcc() {
local VBCC="${G_PARENT}/sdks/vbcc"
if [[ ! -e "${VBCC}/config" ]]; then
purple "Installing VBCC"
download http://sun.hasenbraten.de/vasm/release/vasm.tar.gz
download http://sun.hasenbraten.de/vlink/release/vlink.tar.gz
download http://www.ibaug.de/vbcc/vbcc.tar.gz
download http://server.owl.de/~frank/vbcc/${G_VBCC_CURRENT}/vbcc_unix_config.tar
tar xzf vasm.tar.gz
tar xzf vlink.tar.gz
tar xzf vbcc.tar.gz
tar xf vbcc_unix_config.tar
pushd vasm &> /dev/null
make CPU=m68k SYNTAX=mot
popd &> /dev/null
pushd vlink &> /dev/null
mkdir -p objects
make
popd &> /dev/null
pushd vbcc &> /dev/null
mkdir -p bin
yes "" | make TARGET=m68k
yes "" | make TARGET=m68ks
popd &> /dev/null
mkdir -p "${VBCC}/bin"
cp vasm/{vasmm68k_mot,vobjdump} "${VBCC}/bin/."
cp vlink/vlink "${VBCC}/bin/."
cp vbcc/bin/* "${VBCC}/bin/."
mv config "${VBCC}/."
fi
}
function mainMenu() { function mainMenu() {
local ITEMS=( local ITEMS=(
"IIgs" "IIgs"
# "Amiga" # "Amiga"
# "ST" "ST"
"Linux32" "Linux32"
"Linux64" "Linux64"
"Win32" "Win32"
@ -541,7 +673,7 @@ function mainMenu() {
local DESC=( local DESC=(
"Apple IIgs 16" "Apple IIgs 16"
# "Commodore Amiga 16" # "Commodore Amiga 16"
# "Atari ST 16" "Atari ST 16"
"Linux 32" "Linux 32"
"Linux 64" "Linux 64"
"Windows 32" "Windows 32"
@ -554,7 +686,7 @@ function mainMenu() {
local CHECK=( local CHECK=(
"IIgs/joeylib#b20000" "IIgs/joeylib#b20000"
# "Amiga" # "Amiga"
# "ST" "ST/libjoeylib.a"
"linux/i386/libjoeylib.a" "linux/i386/libjoeylib.a"
"linux/x64/libjoeylib.a" "linux/x64/libjoeylib.a"
"windows/i386/libjoeylib.a" "windows/i386/libjoeylib.a"
@ -573,7 +705,7 @@ function mainMenu() {
G_IS_INSTALLED=( G_IS_INSTALLED=(
0 0
# 0 # 0
# 0 0
0 0
0 0
0 0
@ -603,39 +735,48 @@ function mainMenu() {
set e- set e-
) )
if [[ "${CHOICE}" != "" ]]; then if [[ "${CHOICE}" != "" ]]; then
sudo -v doSudo
CHOICE="install${CHOICE}" CHOICE="install${CHOICE}"
echo ""
tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!"
${CHOICE} ${CHOICE}
fi fi
done done
} }
function purple() {
local TEXT=$1
echo ""
tBoldBox tPURPLE "${TEXT}"
echo ""
}
# --- START # --- START
function start() { function start() {
sudo -v
mkdir -p installerWork # This has to exist before doSudo is called
mkdir -p "${G_WORK}"
doSudo
# Do we have Towel yet? # Do we have Towel yet?
if [[ ! -f installerWork/towel/towel.sh ]]; then if [[ ! -f "${G_WORK}/towel/towel.sh" ]]; then
# Do we have GIT? # Do we have GIT?
if [[ "$(which git || true)" == "" ]]; then if [[ "$(which git || true)" == "" ]]; then
echo "Installing git..." echo "Installing git..."
sudo apt-get -y install git &> /dev/null doSudo apt-get -y install git &> /dev/null
fi fi
echo "Downloading towel.sh support library..." echo "Downloading towel.sh support library..."
git clone https://skunkworks.kangaroopunch.com/skunkworks/towel.git installerWork/towel &> /dev/null git clone https://skunkworks.kangaroopunch.com/skunkworks/towel.git "${G_WORK}/towel" &> /dev/null
fi fi
# Load Towel # Load Towel
source installerWork/towel/towel.sh source "${G_WORK}/towel/towel.sh"
# Remember where we live.
G_PARENT=$(pwd)
# Don't change directories until Towel is loaded. # Don't change directories until Towel is loaded.
pushd installerWork &> /dev/null pushd "${G_WORK}" &> /dev/null
# See if all the packages we need are installed # See if all the packages we need are installed
echo "" echo ""
@ -646,7 +787,7 @@ function start() {
uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio \ uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio \
libpulse-dev{,:i386} libasound2-dev{,:i386} \ libpulse-dev{,:i386} libasound2-dev{,:i386} \
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev \ libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev \
php-cli msitools php-cli msitools hatari lhasa bison
if [[ "${MISSING}" != "" ]]; then if [[ "${MISSING}" != "" ]]; then
if (whiptail --title "${G_TITLE}" --yesno "Some required packages are missing.\n\nInstall them now?" 9 40); then if (whiptail --title "${G_TITLE}" --yesno "Some required packages are missing.\n\nInstall them now?" 9 40); then
@ -657,7 +798,7 @@ function start() {
for PACKAGE in ${MISSING}; do for PACKAGE in ${MISSING}; do
PERCENT=$(( 100*(++COUNT)/TOTAL )) PERCENT=$(( 100*(++COUNT)/TOTAL ))
echo ${PERCENT} echo ${PERCENT}
sudo apt-get -y install ${PACKAGE} &> /dev/null doSudo apt-get -y install ${PACKAGE} &> /dev/null
done done
} | whiptail --title "${G_TITLE}" --gauge "\nInstalling packages..." 7 50 0 } | whiptail --title "${G_TITLE}" --gauge "\nInstalling packages..." 7 50 0
else else
@ -689,5 +830,15 @@ function start() {
popd &> /dev/null popd &> /dev/null
} }
# Remember where we live.
G_PARENT=$(pwd)
G_SCRIPT=$(basename -- "$0")
# Is SUDO after us?
if [[ "$1" == "ASKPASS" ]]; then
doSudoAskPass
fi
# At the very end so we can stream this script from a web server. # At the very end so we can stream this script from a web server.
start start