diff --git a/scripts/installer.sh b/scripts/installer.sh index 1edc4d8..34fc60a 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -40,12 +40,39 @@ G_LINUX32=2 G_LINUX64=3 G_WIN32=4 G_WIN64=5 -#G_MAC32=7 -#G_MAC64=8 +G_MAC32=6 +G_MAC64=7 #G_ANDROID=9 #G_IOS=10 -G_HAS_IIGS=0 + +function buildMacOSXSDK() { + local XCODE= + local OSX="${G_PARENT}/sdks/macOS" + + G_IS_INSTALLED[$G_MAC32]=1 + G_IS_INSTALLED[$G_MAC64]=1 + configWrite + configRead + + if [[ ! -e "${OSX}/SDK" ]]; then + tFileBrowser XCODE "Please locate your 'XCode 10.1' XIP" .xip .. + if [[ -z ${XCODE} || "${XCODE}" == "" ]]; then + return 0 + fi + fi + + if [[ ! -d osxcross ]]; then + purple "Building macOS SDK - This takes FOREVER!" + git clone https://github.com/tpoechtrager/osxcross.git + pushd osxcross &> /dev/null + ./tools/gen_sdk_package_pbzx.sh "${XCODE}" + mv MacOSX10.* tarballs/. + UNATTENDED=1 ./build.sh + mv target "${OSX}" + popd &> /dev/null + fi +} function buildPCDeps() { @@ -210,6 +237,10 @@ function configWrite() { P=\${JOEY}/sdks/vbcc/bin:${P} echo "export VBCC=\"\${JOEY}/sdks/vbcc\"" >> "${O}" fi + if [[ ${G_IS_INSTALLED[$G_MAC32]} == 1 || ${G_IS_INSTALLED[$G_MAC64]} == 1 ]]; then + P=\${JOEY}/sdks/macOS/bin:${P} + echo "export MACOSX_DEPLOYMENT_TARGET=10.6" >> "${O}" + fi echo "export PATH=\"${P}\"" >> "${O}" chmod +x "${O}" } @@ -519,6 +550,28 @@ function installLinux64() { } +function installmacOS32() { + buildMacOSXSDK + buildPCDeps \ + "$(pwd)/../dist/macOS/x64" \ + "$(pwd)/deps/installed/macOS/x64" \ + "o64-clang" \ + "" \ + "" +} + + +function installmacOS32() { + buildMacOSXSDK + buildPCDeps \ + "$(pwd)/../dist/macOS/i386" \ + "$(pwd)/deps/installed/macOS/i386" \ + "o32-clang" \ + "" \ + "" +} + + function installWin32() { buildPCDeps \ "$(pwd)/../dist/windows/i386" \ @@ -667,8 +720,8 @@ function mainMenu() { "Linux64" "Win32" "Win64" -# "macOS32" -# "macOS64" + "macOS32" + "macOS64" # "Android" # "iOS" ) @@ -680,8 +733,8 @@ function mainMenu() { "Linux 64" "Windows 32" "Windows 64" -# "macOS 32" -# "macOS 64" + "macOS 32" + "macOS 64" # "Android 32" # "iOS 64" ) @@ -693,8 +746,8 @@ function mainMenu() { "linux/x64/libjoeylib.a" "windows/i386/libjoeylib.a" "windows/x64/libjoeylib.a" -# "macOS32" -# "macOS64" + "macOS/i386/libjoeylib.a" + "macOS/x64/libjoeylib.a" # "Android" # "iOS" ) @@ -712,8 +765,8 @@ function mainMenu() { 0 0 0 -# 0 -# 0 + 0 + 0 # 0 # 0 ) @@ -789,7 +842,7 @@ function start() { uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio \ libpulse-dev{,:i386} libasound2-dev{,:i386} \ libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev \ - php-cli msitools hatari lhasa bison xcftools + php-cli msitools hatari lhasa bison xcftools libfuse-dev liblzma-dev libbz2-dev if [[ "${MISSING}" != "" ]]; then if (whiptail --title "${G_TITLE}" --yesno "Some required packages are missing.\n\nInstall them now?" 9 40); then