diff --git a/joeylib/build.sh b/joeylib/build.sh index 58b9153..1ed0881 100755 --- a/joeylib/build.sh +++ b/joeylib/build.sh @@ -2,7 +2,7 @@ # # JoeyLib -# Copyright (C) 2018-2019 Scott Duensing +# Copyright (C) 2018-2021 Scott Duensing # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages @@ -183,7 +183,7 @@ TEST=$2 if [[ "${ARCH}x" == "x" ]]; then echo "$0 [arch | \"all\"]" - echo '(Where "arch" is amiga, iigs, linux32, linux64, macos32, macos64, st, windows32, or windows64.)' + echo '(Where "arch" is amiga, iigs, linux32, linux64, macosx32, macosx64, macosa64, st, windows32, or windows64.)' exit 0 fi @@ -225,7 +225,22 @@ if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "linux32x" ]]; then doPCBuild fi -if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macos32x" ]]; then +if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macosa64x" ]]; then + export MACOSX_DEPLOYMENT_TARGET="${MACOSX_APPLE_DEPLOYMENT_TARGET}" + export MACOSX_DARWIN="${MACOSX_APPLE_DARWIN}" + export PATH="${JOEYPATH}:${MACOSX_APPLE_PATH}" + CC="oa64-clang" + CFLAGS="" + LDFLAGS="" + DIST="${JOEY}/dist/macOS/a64" + INSTALLED="${DEPS}/macOS/a64" + doPCBuild +fi + +if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macosx32x" ]]; then + export MACOSX_DEPLOYMENT_TARGET="${MACOSX_INTEL_DEPLOYMENT_TARGET}" + export MACOSX_DARWIN="${MACOSX_INTEL_DARWIN}" + export PATH="${JOEYPATH}:${MACOSX_INTEL_PATH}" CC="o32-clang" CFLAGS="" LDFLAGS="" @@ -234,7 +249,10 @@ if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macos32x" ]]; then doPCBuild fi -if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macos64x" ]]; then +if [[ "${ARCH}x" == "allx" || "${ARCH}x" == "macosx64x" ]]; then + export MACOSX_DEPLOYMENT_TARGET="${MACOSX_INTEL_DEPLOYMENT_TARGET}" + export MACOSX_DARWIN="${MACOSX_INTEL_DARWIN}" + export PATH="${JOEYPATH}:${MACOSX_INTEL_PATH}" CC="o64-clang" CFLAGS="" LDFLAGS="" diff --git a/scripts/build-PC.helper.sh b/scripts/build-PC.helper.sh index d7944b2..5a3354e 100644 --- a/scripts/build-PC.helper.sh +++ b/scripts/build-PC.helper.sh @@ -101,7 +101,21 @@ function buildWindows64() { } -function buildmacOS32() { +function buildmacOSA64() { + export MACOSX_DEPLOYMENT_TARGET="${MACOSX_APPLE_DEPLOYMENT_TARGET}" + export MACOSX_DARWIN="${MACOSX_APPLE_DARWIN}" + export PATH="${JOEYPATH}:${MACOSX_APPLE_PATH}" + CC="oa64-clang" + CFLAGS="" + LDFLAGS="" + doPCBuild macos a64 '' +} + + +function buildmacOSX32() { + export MACOSX_DEPLOYMENT_TARGET="${MACOSX_INTEL_DEPLOYMENT_TARGET}" + export MACOSX_DARWIN="${MACOSX_INTEL_DARWIN}" + export PATH="${JOEYPATH}:${MACOSX_INTEL_PATH}" CC="o32-clang" CFLAGS="" LDFLAGS="" @@ -109,7 +123,10 @@ function buildmacOS32() { } -function buildmacOS64() { +function buildmacOSX64() { + export MACOSX_DEPLOYMENT_TARGET="${MACOSX_INTEL_DEPLOYMENT_TARGET}" + export MACOSX_DARWIN="${MACOSX_INTEL_DARWIN}" + export PATH="${JOEYPATH}:${MACOSX_INTEL_PATH}" CC="o64-clang" CFLAGS="" LDFLAGS="" diff --git a/scripts/installer.sh b/scripts/installer.sh index 466e604..d6b79ce 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -32,17 +32,24 @@ G_SCRIPT= G_UID=$(id -ru) G_GID=$(id -rg) G_IS_INSTALLED=() +G_ITEMS=() +G_DESC=() +G_CHECK=() G_AUTOMATED= G_PASSWORD= G_ORCA_FILE= G_GOLDEN_GATE_FILE= +G_GOLDEN_GATE_USER= +G_GOLDEN_GATE_PASS= +G_GOLDEN_GATE_PUBLIC= +G_GOLDEN_GATE_PRIVATE= G_MAC_INTEL_MIN=10.6 G_MAC_INTEL_DARWIN=17 G_MAC_INTEL_XIP="$(pwd)/Xcode_9.4.1.xip" G_MAC_APPLE_MIN=10.9 G_MAC_APPLE_DARWIN=20.4 G_MAC_APPLE_XIP="$(pwd)/Xcode_12.5.1.xip" -#***TODO*** This list is dumb. It and more should be in an array. The rest is in the mainMenu code. + G_IIGS=0 #G_AMIGA=1 #G_ATARIST=2 @@ -56,6 +63,63 @@ G_MACA64=7 #G_ANDROID=9 #G_IOS=10 +G_ITEMS=( + "IIgs" +# "Amiga" +# "ST" + "Linux32" + "Linux64" + "Win32" + "Win64" + "macOSX32" + "macOSX64" + "macOSA64" +# "Android" +# "iOS" +) +G_DESC=( + "Apple IIgs 16" +# "Commodore Amiga 16" +# "Atari ST 16" + "Linux 32" + "Linux 64" + "Windows 32" + "Windows 64" + "macOS Intel 32" + "macOS Intel 64" + "macOS Apple 64" +# "Android 32" +# "iOS 64" +) +G_CHECK=( + "IIgs/joey.a#b10000" +# "amiga/libjoeylib.a" +# "st/libjoeylib.a" + "linux/i386/libjoeylib.a" + "linux/x64/libjoeylib.a" + "windows/i386/libjoeylib.a" + "windows/x64/libjoeylib.a" + "macOS/i386/libjoeylib.a" + "macOS/x64/libjoeylib.a" + "macOS/a64/libjoeylib.a" +# "Android" +# "iOS" +) +G_IS_INSTALLED=( + 0 +# 0 +# 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 +# 0 +# 0 +) + function buildMacOSXSDK() { local ARCH=$1 @@ -335,6 +399,19 @@ function buildSDL12() { } +function checkInstalled() { + local TOTAL=${#G_ITEMS[*]} + local X= + for (( X=0; X<=$(( ${TOTAL}-1 )); X++ )); do + if [[ -e "${G_PARENT}/dist/${G_CHECK[$X]}" ]]; then + G_IS_INSTALLED[$X]=1 + else + G_IS_INSTALLED[$X]=0 + fi + done +} + + function clearDepsBuild() { if [[ -d $(pwd)/build ]]; then rm -rf $(pwd)/build @@ -354,6 +431,7 @@ function configWrite() { local O=${G_PARENT}/joeyDev.sh local P=\${JOEYPATH} local SDKLIST="[" + echo "#!/bin/bash" > "${O}" # Remember the initial path so we can run this more than once echo "if [[ -z \$JOEYPATH || \"\${JOEYPATH}\" == \"\" ]]; then" >> "${O}" @@ -364,36 +442,34 @@ function configWrite() { SDKLIST="${SDKLIST} IIGS" # IIgs Runtime & ORCA Compilers P=\${JOEY}/sdks/IIgs:${P} - echo "export GOLDEN_GATE=\"\${JOEY}/sdks/IIgs/ORCA\"" >> "${O}" - echo "if [[ -e \"\${JOEY}/sdks/IIgs/mountORCA.sh\" ]]; then" >> "${O}" - echo -e "\t\"\${JOEY}/sdks/IIgs/mountORCA.sh\"" >> "${O}" - echo "fi" >> "${O}" - fi - if [[ ${G_IS_INSTALLED[$G_AMIGA]} == 1 ]]; then - SDKLIST="${SDKLIST} AMIGA" - P=\${JOEY}/sdks/amiga/bin:${P} - fi - if [[ ${G_IS_INSTALLED[$G_ATARIST]} == 1 ]]; then - SDKLIST="${SDKLIST} ST" - P=\${JOEY}/sdks/st/bin:${P} - fi - if [[ ${G_IS_INSTALLED[$G_MACX32]} == 1 || ${G_IS_INSTALLED[$G_MACX64]} == 1 ]]; then - if [[ ${G_IS_INSTALLED[$G_MACX32]} == 1 ]]; then - SDKLIST="${SDKLIST} MACOSX32" - fi - if [[ ${G_IS_INSTALLED[$G_MACX64]} == 1 ]]; then - SDKLIST="${SDKLIST} MACOSX64" - fi - echo "export MACOSX_INTEL_PATH=\"\${JOEY}/sdks/macOS/intel/bin\"" >> "${O}" - echo "export MACOSX_INTEL_DEPLOYMENT_TARGET=${G_MAC_INTEL_MIN}" >> "${O}" - echo "export MACOSX_INTEL_DARWIN=${G_MAC_INTEL_DARWIN}" >> "${O}" fi + echo "export GOLDEN_GATE=\"\${JOEY}/sdks/IIgs/ORCA\"" >> "${O}" + echo "if [[ -e \"\${JOEY}/sdks/IIgs/mountORCA.sh\" ]]; then" >> "${O}" + echo -e "\t\"\${JOEY}/sdks/IIgs/mountORCA.sh\"" >> "${O}" + echo "fi" >> "${O}" + #if [[ ${G_IS_INSTALLED[$G_AMIGA]} == 1 ]]; then + # SDKLIST="${SDKLIST} AMIGA" + # P=\${JOEY}/sdks/amiga/bin:${P} + #fi + #if [[ ${G_IS_INSTALLED[$G_ATARIST]} == 1 ]]; then + # SDKLIST="${SDKLIST} ST" + # P=\${JOEY}/sdks/st/bin:${P} + #fi if [[ ${G_IS_INSTALLED[$G_MACA64]} == 1 ]]; then SDKLIST="${SDKLIST} MACOSA64" - echo "export MACOSX_APPLE_PATH=\"\${JOEY}/sdks/macOS/apple/bin\"" >> "${O}" - echo "export MACOSX_APPLE_DEPLOYMENT_TARGET=${G_MAC_APPLE_MIN}" >> "${O}" - echo "export MACOSX_APPLE_DARWIN=${G_MAC_APPLE_DARWIN}" >> "${O}" fi + if [[ ${G_IS_INSTALLED[$G_MACX32]} == 1 ]]; then + SDKLIST="${SDKLIST} MACOSX32" + fi + if [[ ${G_IS_INSTALLED[$G_MACX64]} == 1 ]]; then + SDKLIST="${SDKLIST} MACOSX64" + fi + echo "export MACOSX_INTEL_PATH=\"\${JOEY}/sdks/macOS/intel/bin\"" >> "${O}" + echo "export MACOSX_INTEL_DEPLOYMENT_TARGET=${G_MAC_INTEL_MIN}" >> "${O}" + echo "export MACOSX_INTEL_DARWIN=${G_MAC_INTEL_DARWIN}" >> "${O}" + echo "export MACOSX_APPLE_PATH=\"\${JOEY}/sdks/macOS/apple/bin\"" >> "${O}" + echo "export MACOSX_APPLE_DEPLOYMENT_TARGET=${G_MAC_APPLE_MIN}" >> "${O}" + echo "export MACOSX_APPLE_DARWIN=${G_MAC_APPLE_DARWIN}" >> "${O}" echo "export PATH=\"${P}\"" >> "${O}" if [[ ${G_IS_INSTALLED[$G_WIN32]} == 1 ]]; then SDKLIST="${SDKLIST} WIN32" @@ -487,6 +563,7 @@ function fetchGitHubRelease() { | cut -d : -f 2,3 \ | tr -d \" \ | head -n 1) + local FILE=${URL##*/} download ${URL} eval $__RESULT=\${FILE} } @@ -507,7 +584,7 @@ function installAmiga() { #***TODO*** SDL & Friends purple "Building JoeyLib" - "${G_PARENT}/joeylib/joeylib/build.sh" amiga &> /dev/null + (source "${G_PARENT}/joeyDev.sh" && "${G_PARENT}/joeylib/joeylib/build.sh" amiga) &> /dev/null #***TODO*** Needs emulator @@ -523,12 +600,27 @@ function installIIgs() { local ORCA= local GGATE= local IIGS="${G_PARENT}/sdks/IIgs" + local RET= if [[ ! -z ${G_AUTOMATED} ]]; then GGATE=${G_GOLDEN_GATE_FILE} if [[ ! -e "${GGATE}" ]]; then return 0 fi + if [[ ! -e "${G_GOLDEN_GATE_PUBLIC}" || ! -e "${G_GOLDEN_GATE_PRIVATE}" ]]; then + return 0 + fi + mkdir -p ~/.ssh + cp -f "${G_GOLDEN_GATE_PUBLIC}" ~/.ssh/id_rsa.pub + cp -f "${G_GOLDEN_GATE_PRIVATE}" ~/.ssh/id_rsa + touch ${HOME}/.ssh/authorized_keys + touch ${HOME}/.ssh/config + chmod go-w ${HOME} + chmod 700 ${HOME}/.ssh + chmod 600 ${HOME}/.ssh/*id_rsa + chmod 644 ${HOME}/.ssh/*.pub + chmod 644 ${HOME}/.ssh/authorized_keys + chmod 644 ${HOME}/.ssh/config fi if [[ -e "${IIGS}/unmountORCA.sh" ]]; then @@ -544,9 +636,10 @@ function installIIgs() { echo "IIGS=${IIGS}" >> "${O}" echo "if ! mount | grep \${IIGS}/ORCA | grep -q jfs; then" >> "${O}" echo -e "\tfsck.jfs -a \${IIGS}/jfsDrive.img" >> "${O}" - echo -e "\tIIGSDISK=\$(sudo losetup --partscan --find --show \${IIGS}/jfsDrive.img)" >> "${O}" - echo -e "\tsudo mount \${IIGSDISK} \${IIGS}/ORCA" >> "${O}" - echo -e "\techo LOOP=\${IIGSDISK} > \${IIGS}/lastMount.cfg" >> "${O}" + #echo -e "\tIIGSDISK=\$(sudo losetup --partscan --find --show \${IIGS}/jfsDrive.img)" >> "${O}" + #echo -e "\tsudo mount -t jfs \${IIGSDISK} \${IIGS}/ORCA" >> "${O}" + echo -e "\tsudo mount -t jfs \${IIGS}/jfsDrive.img \${IIGS}/ORCA" >> "${O}" + #echo -e "\techo LOOP=\${IIGSDISK} > \${IIGS}/lastMount.cfg" >> "${O}" echo -e "\techo MOUNT=\${IIGS}/ORCA >> \${IIGS}/lastMount.cfg" >> "${O}" echo "fi" >> "${O}" chmod +x "${O}" @@ -556,17 +649,23 @@ function installIIgs() { echo "if [[ -e \${IIGS}/lastMount.cfg ]]; then" >> "${O}" echo -e "\tsource \${IIGS}/lastMount.cfg" >> "${O}" echo -e "\tsudo umount \${MOUNT}" >> "${O}" - echo -e "\tsudo losetup -d \${LOOP}" >> "${O}" - echo -e "\tsudo rm \${IIGS}/lastMount.cfg" >> "${O}" + #echo -e "\tsudo losetup -d \${LOOP}" >> "${O}" + echo -e "\trm \${IIGS}/lastMount.cfg" >> "${O}" echo "fi" >> "${O}" chmod +x "${O}" fallocate -l 32M "${IIGS}/jfsDrive.img" mkfs.jfs -O -q -L IIgs "${IIGS}/jfsDrive.img" + # mkntfs -q -F -L IIgs jfsDrive.img + # sudo mount -t ntfs-3g jfsDrive.img ORCA/ fi "${IIGS}/mountORCA.sh" doSudo chown ${G_UID}:${G_GID} "${IIGS}/ORCA/." + G_IS_INSTALLED[$G_IIGS]=1 + configWrite + configRead + if [[ ! -e "${IIGS}/ORCA/Languages/cc" ]]; then if [[ ! -z ${G_AUTOMATED} ]]; then ORCA=${G_ORCA_FILE} @@ -587,9 +686,31 @@ function installIIgs() { if [[ -z ${GGATE} || "${GGATE}" == "" ]]; then return 0 fi + set +e + G_GOLDEN_GATE_USER=$( + whiptail --inputbox "\nGolden Gate needs GitLab access.\n\nPlease enter your username:" 12 60 --title "GitLab Account" 3>&1 1>&2 2>&3 + ) + RET=$? + set -e + if [[ ${RET} -ne 0 ]]; then + echo "Cannot continue without GitLab access." 1>&2 + exit 1 + fi + set +e + G_GOLDEN_GATE_PASS=$( + whiptail --passwordbox "\nGolden Gate needs GitLab access.\n\nPlease enter your password:" 12 60 --title "GitLab Account" 3>&1 1>&2 2>&3 + ) + RET=$? + set -e + if [[ ${RET} -ne 0 ]]; then + echo "Cannot continue without GitLab access." 1>&2 + exit 1 + fi fi purple "Building GoldenGate" - git clone git@gitlab.com:GoldenGate/GoldenGate.git + ssh-keygen -F gitlab.com || ssh-keyscan gitlab.com > ~/.ssh/known_hosts 2> /dev/null + git config --global credential.helper cache + git clone https://${G_GOLDEN_GATE_USER}:${G_GOLDEN_GATE_PASS}@gitlab.com/GoldenGate/GoldenGate.git if [ ! -d GoldenGate ]; then tBoldBox tRED "Unable to clone the GoldenGate repository!" echo "Must be a paying member of the GoldenGate project!" @@ -654,41 +775,43 @@ function installIIgs() { popd &> /dev/null fi - if [[ ! -d gsplus ]]; then - purple "Building GSplus" - git clone https://github.com/digarok/gsplus.git - mkdir gsplus/build - pushd gsplus/build &> /dev/null - cmake .. - make - if [[ ! -e bin/GSplus ]]; then - tBoldBox tRED "Failed to build GSplus." - exit 1 + if [[ -z ${AUTOMATED} ]]; then + if [[ ! -d gsplus ]]; then + purple "Building GSplus" + git clone https://github.com/digarok/gsplus.git + mkdir gsplus/build + pushd gsplus/build &> /dev/null + cmake .. + make + if [[ ! -e bin/GSplus ]]; then + tBoldBox tRED "Failed to build GSplus." + exit 1 + fi + mkdir -p "${IIGS}/gsplus" + cp -f bin/{GSplus,partls,to_pro} "${IIGS}/gsplus/." + popd &> /dev/null + echo -e "s7d1 = System601.po\n\ng_limit_speed = 0\n" > "${IIGS}/gsplus/config.txt" + echo -e "s7d1 = System601.po\ns7d2 = /tmp/IIgs/import.po\n" > "${IIGS}/gsplus/IIgsTest.cfg" fi - mkdir -p "${IIGS}/gsplus" - cp -f bin/{GSplus,partls,to_pro} "${IIGS}/gsplus/." - popd &> /dev/null - echo -e "s7d1 = System601.po\n\ng_limit_speed = 0\n" > "${IIGS}/gsplus/config.txt" - echo -e "s7d1 = System601.po\ns7d2 = /tmp/IIgs/import.po\n" > "${IIGS}/gsplus/IIgsTest.cfg" - fi - if [[ ! -f "${IIGS}/gsplus/ROM.03" ]]; then - purple "Installing IIgs ROM" - download http://www.whatisthe2gs.apple2.org.za/files/rom3.zip - unzip rom3.zip - mv -f APPLE2GS.ROM2 "${IIGS}/gsplus/ROM.03" - fi + if [[ ! -f "${IIGS}/gsplus/ROM.03" ]]; then + purple "Installing IIgs ROM" + download http://www.whatisthe2gs.apple2.org.za/files/rom3.zip + unzip rom3.zip + mv -f APPLE2GS.ROM2 "${IIGS}/gsplus/ROM.03" + fi - if [[ ! -f "${IIGS}/gsplus/System601.po" ]]; then - purple "Installing GS/OS" - download http://www.whatisthe2gs.apple2.org.za/files/harddrive_image.zip - unzip harddrive_image.zip - mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po" + if [[ ! -f "${IIGS}/gsplus/System601.po" ]]; then + purple "Installing GS/OS" + download http://www.whatisthe2gs.apple2.org.za/files/harddrive_image.zip + unzip harddrive_image.zip + mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po" + fi fi if [[ ! -d cadius ]]; then purple "Building Cadius" - git clone https://github.com/sicklittlemonkey/cadius.git + git clone https://github.com/mach-kernel/cadius.git pushd cadius &> /dev/null make if [[ ! -e bin/release/cadius ]]; then @@ -702,28 +825,31 @@ function installIIgs() { if [[ ! -e "${IIGS}/ntpconverter/ntpconverter.php" ]]; then purple "Installing NinjaTrackerPlus Converter" - download http://www.ninjaforce.com/downloads/ntpsources.zip - unzip ntpsources.zip + download http://www.ninjaforce.com/downloads/ntconverter.zip + unzip ntconverter.zip mkdir -p "${IIGS}/ntpconverter" - cp -f ntpconverter.php "${IIGS}/ntpconverter/." - cp -f ntpconverter_lib.php "${IIGS}/ntpconverter/." + cp -f ntconverter.php "${IIGS}/ntpconverter/ntpconverter.php" fi if [[ ! -e "${IIGS}/Tool222#ba0000" ]]; then purple "Installing NinjaTrackerPlus Tool222" - download http://www.ninjaforce.com/downloads/ninjatrackerplus_tool222_v1.1.2mg - "${IIGS}/cadius/cadius" extractfile ninjatrackerplus_tool222_v1.1.2mg NTP.TOOL222V1.1/SYSTEM/TOOLS/TOOL222 . + download http://www.ninjaforce.com/downloads/ninjatrackerplus_tool222_v1.2.2mg + "${IIGS}/cadius/cadius" extractfile ninjatrackerplus_tool222_v1.2.2mg NTP.TOOL222V1.2/SYSTEM/TOOLS/TOOL222 . cp -f Tool222#BA0000 "${IIGS}/Tool222#ba0000" fi - G_IS_INSTALLED[$G_IIGS]=1 - configWrite - configRead + if [[ ! -e "${IIGS}/Tool035#ba0000" ]]; then + purple "Installing MidiSynth Tool035" + download https://www.whatisthe2gs.apple2.org.za/files/System601/2Image/System_6_01.zip + unzip System_6_01.zip + "${IIGS}/cadius/cadius" extractfile "System 6.0.1/Disk 6 of 7 synthLAB.2mg" synthLAB/TOOL035 . + cp -f Tool035#BA0000 "${IIGS}/Tool035#ba0000" + fi mkdir -p "${JOEY}/dist/IIgs" purple "Building JoeyLib" - "${G_PARENT}/joeylib/joeylib/build.sh" iigs &> /dev/null + (source "${G_PARENT}/joeyDev.sh" && "${G_PARENT}/joeylib/joeylib/build.sh" iigs) &> /dev/null "${IIGS}/unmountORCA.sh" @@ -768,7 +894,7 @@ function installmacOSA64() { "arm64-apple-darwin${G_MAC_APPLE_DARWIN}" \ "oa64-clang" \ "" \ - "${JOEY}/sdks/macOS/apple/lib" \ + "${JOEY}/sdks/macOS/a64/lib:${JOEY}/sdks/macOS/apple/lib" \ "${JOEY}/sdks/macOS/apple/bin" G_IS_INSTALLED[$G_MACA64]=1 configWrite @@ -787,7 +913,7 @@ function installmacOSX32() { "i386-apple-darwin${G_MAC_INTEL_DARWIN}" \ "o32-clang" \ "" \ - "${JOEY}/sdks/macOS/intel/lib" \ + "${JOEY}/sdks/macOS/i386/lib:${JOEY}/sdks/macOS/intel/lib" \ "${JOEY}/sdks/macOS/intel/bin" G_IS_INSTALLED[$G_MACX32]=1 configWrite @@ -806,7 +932,7 @@ function installmacOSX64() { "x86_64-apple-darwin${G_MAC_INTEL_DARWIN}" \ "o64-clang" \ "" \ - "${JOEY}/sdks/macOS/intel/lib" \ + "${JOEY}/sdks/macOS/x64/lib:${JOEY}/sdks/macOS/intel/lib" \ "${JOEY}/sdks/macOS/intel/bin" G_IS_INSTALLED[$G_MACX64]=1 configWrite @@ -898,7 +1024,7 @@ function installST() { configRead purple "Building JoeyLib" - "${G_PARENT}/joeylib/joeylib/build.sh" st &> /dev/null + (source "${G_PARENT}/joeyDev.sh" && "${G_PARENT}/joeylib/joeylib/build.sh" st) &> /dev/null } @@ -927,72 +1053,17 @@ function installWin64() { function mainMenu() { - local ITEMS=( - "IIgs" -# "Amiga" -# "ST" - "Linux32" - "Linux64" - "Win32" - "Win64" - "macOSX32" - "macOSX64" - "macOSA64" -# "Android" -# "iOS" - ) - local DESC=( - "Apple IIgs 16" -# "Commodore Amiga 16" -# "Atari ST 16" - "Linux 32" - "Linux 64" - "Windows 32" - "Windows 64" - "macOS Intel 32" - "macOS Intel 64" - "macOS Apple 64" -# "Android 32" -# "iOS 64" - ) - local CHECK=( - "IIgs/joeylib#b20000" -# "amiga/libjoeylib.a" -# "st/libjoeylib.a" - "linux/i386/libjoeylib.a" - "linux/x64/libjoeylib.a" - "windows/i386/libjoeylib.a" - "windows/x64/libjoeylib.a" - "macOS/i386/libjoeylib.a" - "macOS/x64/libjoeylib.a" - "macOS/a64/libjoeylib.a" -# "Android" -# "iOS" - ) - local TOTAL=${#ITEMS[*]} + local TOTAL=${#G_ITEMS[*]} local MENU=() local X= local WHAT= local CHOICE="x" - G_IS_INSTALLED=( - 0 -# 0 -# 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 -# 0 -# 0 - ) + checkInstalled if [[ ! -z ${G_AUTOMATED} ]]; then for (( X=0; X<=$(( ${TOTAL}-1 )); X++ )); do - CHOICE="install${ITEMS[$X]}" + CHOICE="install${G_ITEMS[$X]}" echo "" tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!" ${CHOICE} @@ -1001,15 +1072,13 @@ function mainMenu() { while [[ "${CHOICE}" != "" ]]; do MENU=() for (( X=0; X<=$(( ${TOTAL}-1 )); X++ )); do - MENU+=( "${ITEMS[$X]}" ) - if [[ -e "${G_PARENT}/dist/${CHECK[$X]}" ]]; then + MENU+=( "${G_ITEMS[$X]}" ) + if [[ ${G_IS_INSTALLED[$X]} == 1 ]]; then WHAT="Rebuild" - G_IS_INSTALLED[$X]=1 else WHAT="Install" - G_IS_INSTALLED[$X]=0 fi - MENU+=( "${WHAT} ${DESC[$X]} Bit JoeyLib Library" ) + MENU+=( "${WHAT} ${G_DESC[$X]} Bit JoeyLib Library" ) done CHOICE=$( set e+ @@ -1171,6 +1240,8 @@ function start() { fi mainMenu + + checkInstalled configWrite clear @@ -1200,6 +1271,10 @@ if [[ "$1" == "AUTOMATED" ]]; then G_PASSWORD="$2" G_ORCA_FILE="$3" G_GOLDEN_GATE_FILE="$4" + G_GOLDEN_GATE_USER="$5" + G_GOLDEN_GATE_PASS="$6" + G_GOLDEN_GATE_PUBLIC="$7" + G_GOLDEN_GATE_PRIVATE="$8" fi # Don't run as root.