2019-01-07 21:51:22 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2020-07-08 15:37:11 +02:00
|
|
|
podman=`which podman || true`
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2020-03-19 18:13:06 +01:00
|
|
|
if [ -z $podman ]; then
|
2020-07-08 15:37:11 +02:00
|
|
|
echo "podman needs to be in PATH for this script to work."
|
2019-01-08 02:01:50 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-08-26 15:39:52 +02:00
|
|
|
if [ -z "$1" -o -z "$2" ]; then
|
|
|
|
echo "Usage: $0 <godot branch> <base distro>"
|
2019-11-15 11:28:48 +01:00
|
|
|
echo
|
2022-08-26 15:39:52 +02:00
|
|
|
echo "Example: $0 3.x f35"
|
2020-03-19 18:13:06 +01:00
|
|
|
echo
|
|
|
|
echo "godot branch:"
|
2022-05-13 15:19:59 +02:00
|
|
|
echo " Informational, tracks the Godot branch these containers are intended for."
|
2020-04-06 08:44:57 +02:00
|
|
|
echo
|
2022-05-13 15:19:59 +02:00
|
|
|
echo "base distro:"
|
|
|
|
echo " Informational, tracks the base Linux distro these containers are based on."
|
2019-01-08 02:01:50 +01:00
|
|
|
echo
|
2022-08-26 15:39:52 +02:00
|
|
|
echo "The resulting image version will be <godot branch>-<base distro>."
|
2019-01-08 02:01:50 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-11-21 09:53:39 +01:00
|
|
|
godot_branch=$1
|
2022-05-13 15:19:59 +02:00
|
|
|
base_distro=$2
|
2022-08-26 15:39:52 +02:00
|
|
|
img_version=$godot_branch-$base_distro
|
2023-04-09 01:16:33 +02:00
|
|
|
files_root="$(cd dirname "$0"; pwd)/files"
|
2021-10-11 12:27:35 +02:00
|
|
|
build_msvc=0
|
2020-03-19 18:13:06 +01:00
|
|
|
|
|
|
|
# Confirm settings
|
|
|
|
echo "Docker image tag: ${img_version}"
|
2019-12-03 12:47:51 +01:00
|
|
|
echo
|
|
|
|
while true; do
|
2020-03-19 18:13:06 +01:00
|
|
|
read -p "Is this correct? [y/n] " yn
|
|
|
|
case $yn in
|
|
|
|
[Yy]* ) break;;
|
|
|
|
[Nn]* ) exit 1;;
|
|
|
|
* ) echo "Please answer yes or no.";;
|
|
|
|
esac
|
2019-12-03 12:47:51 +01:00
|
|
|
done
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2019-11-15 11:28:48 +01:00
|
|
|
mkdir -p logs
|
|
|
|
|
2021-02-15 01:26:43 +01:00
|
|
|
# You can add --no-cache as an option to podman_build below to rebuild all containers from scratch
|
2023-02-09 15:17:36 +01:00
|
|
|
export podman_build="$podman build --build-arg img_version=${img_version} -v ${files_root}:/root/files:z"
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2022-08-26 15:39:52 +02:00
|
|
|
$podman build -t godot-fedora:${img_version} -f Dockerfile.base . 2>&1 | tee logs/base.log
|
2019-12-02 13:30:41 +01:00
|
|
|
$podman_build -t godot-export:${img_version} -f Dockerfile.export . 2>&1 | tee logs/export.log
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2022-08-26 15:39:52 +02:00
|
|
|
$podman_build -t godot-linux:${img_version} -f Dockerfile.linux . 2>&1 | tee logs/linux.log
|
|
|
|
$podman_build -t godot-windows:${img_version} -f Dockerfile.windows . 2>&1 | tee logs/windows.log
|
2022-08-29 15:12:09 +02:00
|
|
|
$podman_build -t godot-web:${img_version} -f Dockerfile.web . 2>&1 | tee logs/web.log
|
2022-08-26 15:39:52 +02:00
|
|
|
$podman_build -t godot-android:${img_version} -f Dockerfile.android . 2>&1 | tee logs/android.log
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2022-11-03 12:34:10 +01:00
|
|
|
XCODE_SDK=14.1
|
|
|
|
OSX_SDK=13.0
|
|
|
|
IOS_SDK=16.1
|
2023-04-09 01:16:33 +02:00
|
|
|
if [ ! -e ${files_root}/MacOSX${OSX_SDK}.sdk.tar.xz ] || [ ! -e ${files_root}/iPhoneOS${IOS_SDK}.sdk.tar.xz ] || [ ! -e ${files_root}/iPhoneSimulator${IOS_SDK}.sdk.tar.xz ]; then
|
|
|
|
if [ ! -e ${files_root}/Xcode_${XCODE_SDK}.xip ]; then
|
2020-11-19 12:57:58 +01:00
|
|
|
echo "files/Xcode_${XCODE_SDK}.xip is required. It can be downloaded from https://developer.apple.com/download/more/ with a valid apple ID."
|
2019-01-07 21:51:22 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Building OSX and iOS SDK packages. This will take a while"
|
2022-08-26 15:39:52 +02:00
|
|
|
$podman_build -t godot-xcode-packer:${img_version} -f Dockerfile.xcode . 2>&1 | tee logs/xcode.log
|
2023-02-09 15:17:36 +01:00
|
|
|
$podman run -it --rm -v ${files_root}:/root/files:z -e XCODE_SDKV="${XCODE_SDK}" -e OSX_SDKV="${OSX_SDK}" -e IOS_SDKV="${IOS_SDK}" godot-xcode-packer:${img_version} 2>&1 | tee logs/xcode_packer.log
|
2019-01-07 21:51:22 +01:00
|
|
|
fi
|
|
|
|
|
2022-08-26 15:39:52 +02:00
|
|
|
$podman_build -t godot-osx:${img_version} -f Dockerfile.osx . 2>&1 | tee logs/osx.log
|
|
|
|
$podman_build -t godot-ios:${img_version} -f Dockerfile.ios . 2>&1 | tee logs/ios.log
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2021-10-11 12:27:35 +02:00
|
|
|
if [ "${build_msvc}" != "0" ]; then
|
2023-04-09 01:16:33 +02:00
|
|
|
if [ ! -e ${files_root}/msvc2017.tar ]; then
|
2021-10-11 12:27:35 +02:00
|
|
|
echo
|
|
|
|
echo "files/msvc2017.tar is missing. This file can be created on a Windows 7 or 10 machine by downloading the 'Visual Studio Tools' installer."
|
|
|
|
echo "here: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017"
|
|
|
|
echo "The required components can be installed by running"
|
|
|
|
echo "vs_buildtools.exe --add Microsoft.VisualStudio.Workload.UniversalBuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop --add Microsoft.VisualStudio.Component.Windows10SDK.16299.UWP.Native --passive"
|
|
|
|
echo "after that create a zipfile of C:/Program Files (x86)/Microsoft Visual Studio"
|
|
|
|
echo "tar -cf msvc2017.tar -C \"c:/Program Files (x86)/ Microsoft Visual Studio\""
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2022-08-26 15:39:52 +02:00
|
|
|
$podman_build -t godot-msvc:${img_version} -f Dockerfile.msvc . 2>&1 | tee logs/msvc.log
|
2021-10-11 12:27:35 +02:00
|
|
|
fi
|