Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build system and continuous integration (Windows, macOS, Linux) #14

Merged
merged 102 commits into from
Jul 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
57c58ce
Add prebuild script for Ubuntu
kevinlul Jun 16, 2019
637e3a0
Add -y flag to nlohmann-json
kevinlul Jun 18, 2019
a567339
Add basic Linux Travis CI build script
kevinlul Jun 18, 2019
4b1326e
Update Travis with Bionic repositories
kevinlul Jun 18, 2019
07e1d79
Hopefully update build scripts to work on Xenial
kevinlul Jun 18, 2019
e117d85
Update Travis with debug/release build matrix, remove support for Cla…
kevinlul Jun 18, 2019
57acd86
Update prebuild script with proper flags
kevinlul Jun 18, 2019
b2b593a
Fix gframe/game.cpp to compile on GCC 5.4 (use C++ float modf, not do…
kevinlul Jun 18, 2019
2bcf715
Forgot to take out [ci skip]
kevinlul Jun 18, 2019
7a02ae0
Polish prebuild scripts, move to build-support/
kevinlul Jun 18, 2019
470067a
Add deploy script
kevinlul Jun 18, 2019
9d72cd5
Update Travis to use the new build scripts and use the apt addon
kevinlul Jun 18, 2019
f8e2c16
Forgot to change the build script name in Travis
kevinlul Jun 18, 2019
20c585f
Typo in install-ubuntu-src, forgot to cd to install nlohmann-json
kevinlul Jun 18, 2019
f4d79fe
Fix typo in install-ubuntu-apt.sh
kevinlul Jun 19, 2019
103e7e5
Shallow clone dependencies to speed up the process
kevinlul Jun 19, 2019
ccdd493
Update travis to test DebugDLL and ReleaseDLL configurations
kevinlul Jun 19, 2019
8865fdd
Update gframe with correct Apple OpenGL headers
kevinlul Jun 17, 2019
67ac34a
Update premake files to account for library locations
kevinlul Jun 17, 2019
7781d02
System libraries needed for irrlicht
kevinlul Jun 19, 2019
23a0f83
Add script to download premake5 and irrKlang binaries into the workin…
kevinlul Jun 19, 2019
0086784
Install irrklang.dylib to /usr/local/lib for dylibbundler convenience
kevinlul Jun 19, 2019
d0ea291
Add macOS deploy script
kevinlul Jun 19, 2019
679e361
Update Travis to test macOS alongside Linux
kevinlul Jun 19, 2019
474dda6
Add macOS package-getter script
kevinlul Jun 20, 2019
f9ee0b0
Fix Travis build configuration
kevinlul Jun 20, 2019
24f2c71
Directly download the nlohmann-json header instead of running tests
kevinlul Jun 20, 2019
5e8aaed
Reduce number of build configurations, test caching fmt, nlohmann-json
kevinlul Jun 20, 2019
e1154b8
Fix typo in deploying single-header nlohmann-json
kevinlul Jun 20, 2019
f56a905
Install lua from source instead of homebrew
kevinlul Jun 20, 2019
323524d
Fix Travis caching and Lua installation on macOS
kevinlul Jun 20, 2019
45a7157
Fix deploy script for macOS to correctly link OpenSSL
kevinlul Jun 22, 2019
668d5ad
Fix premake to run app on fresh 10.14 environments
kevinlul Jun 23, 2019
577cfb8
Properly target macOS 10.9
kevinlul Jun 26, 2019
5ee9dac
Remove lua from brew install script [ci skip]
kevinlul Jul 1, 2019
8687678
Add install-windows-bin and deploy-windows like Ubuntu
kevinlul Jun 19, 2019
10967f7
Add patch for static linking irrlicht
kevinlul Jun 30, 2019
5eb4324
Build irrlicht from source, ignore its code files
kevinlul Jun 30, 2019
dbe1771
Add vcpkg install script
kevinlul Jun 30, 2019
f024d72
Configure premake5 to link vcpkg libs statically
kevinlul Jun 30, 2019
d4b772b
Add Travis for Windows, modify vcpkg to use Kevin's fork until it get…
kevinlul Jun 30, 2019
c620185
Fix msbuild path
kevinlul Jul 1, 2019
51f977d
Enable caching for vcpkg on Windows
kevinlul Jul 1, 2019
d7fac79
Hopefully fix msbuild command invocation
kevinlul Jul 1, 2019
ecf195f
Reduce cache size on Windows
kevinlul Jul 1, 2019
6b9f9fd
Fix linking behaviour for DebugDLL ocgcore [ci skip]
kevinlul Jul 1, 2019
d21d370
Test MSBuild fix
kevinlul Jul 1, 2019
b2b89d6
Add missing irrlicht dependencies from vcpkg
kevinlul Jul 3, 2019
05abf9e
Change Windows deploy script to work with both DLL and non-DLL configs
kevinlul Jul 3, 2019
bbe0512
Removed large unzips from log
kevinlul Jul 3, 2019
c561fad
Add all irrlicht patches from Koishi
kevinlul Jul 3, 2019
5c252f0
Correct MSBuild path?
kevinlul Jul 3, 2019
a54f9be
Adjust Travis to cache the entire vcpkg installed/
kevinlul Jul 3, 2019
4f26a01
Disable DirectX support on Travis for now
kevinlul Jul 3, 2019
ccaa059
Add irrlicht patches from Koishi plus additional patch for Mojave
kevinlul Jul 3, 2019
c09389f
Build patched irrlicht from source instead on macOS
kevinlul Jul 3, 2019
624bf8d
Change Windows cache directory
kevinlul Jul 3, 2019
505d660
Add gpatch to Travis on macOS
kevinlul Jul 3, 2019
a1c7892
Reorganize irrlicht-related prebuild
kevinlul Jul 3, 2019
1bef685
Fix irrlicht premake
kevinlul Jul 4, 2019
7578862
Abandon Travis Windows caching, load from Git repo
kevinlul Jul 4, 2019
a37bc8c
Fix compilation on 10.12/10.13, drop macosx-version-min support
kevinlul Jul 4, 2019
4ab9c9c
Merge corename fixes into prebuild-ubuntu
kevinlul Jul 4, 2019
d330ca9
Fix DLL build option on macOS
kevinlul Jul 4, 2019
949cd11
Update Linux deploy to include dll config, build DLL configs on Travis
kevinlul Jul 5, 2019
3a0e374
Add experimental GitHub pages deploy
kevinlul Jul 5, 2019
33027c5
Hardcode OpenSSL version
kevinlul Jul 5, 2019
5606193
Add DLL deploy on Windows
kevinlul Jul 5, 2019
fd404ae
Add Travis deploy script for Windows
kevinlul Jul 5, 2019
39535cb
Deploy Windows in after_success on Travis, deploy all macOS configura…
kevinlul Jul 5, 2019
3e4eb99
Cache irrlicht and lua-c++ on macOS
kevinlul Jul 5, 2019
e0595ef
Merge premake change: building independent core
kevinlul Jul 7, 2019
be98f51
Update font to Open Sans
kevinlul Jul 7, 2019
932ca81
Update deploy scripts and Travis for new build configuration
kevinlul Jul 7, 2019
127a413
Fixed typo not deploying textures
kevinlul Jul 7, 2019
47aaa2c
Add premake option for default image URLs
kevinlul Jul 7, 2019
4974c0d
Merge branch 'master' of edo9300/ygopro into prebuild-ubuntu
kevinlul Jul 7, 2019
c6d5997
Relocate Windows icon/resource files to gframe
kevinlul Jul 7, 2019
d3ab1a2
Add macOS icon
kevinlul Jul 7, 2019
d791aca
Merge branch 'master' of https://github.com/edo9300/ygopro into prebu…
kevinlul Jul 8, 2019
d10b163
Use script deployment over after_success for Windows
kevinlul Jul 8, 2019
10b3ffd
Remove now-unused premakes
kevinlul Jul 9, 2019
574d026
Update font to Noto Sans JP
kevinlul Jul 11, 2019
606ba85
Merge branch 'master' of https://github.com/edo9300/ygopro into prebu…
kevinlul Jul 11, 2019
26ef111
TEMPORARILY switch ocgcore remote for Travis build
kevinlul Jul 11, 2019
6b6dbc8
Merge branch 'master' of https://github.com/edo9300/ygopro into prebu…
kevinlul Jul 12, 2019
ae21376
Update ocgcore submodule pointer
kevinlul Jul 12, 2019
c2e213c
Merge branch 'master' of https://github.com/edo9300/ygopro into prebu…
kevinlul Jul 15, 2019
bb9a702
Merge branch 'master' of https://github.com/edo9300/ygopro into prebu…
kevinlul Jul 15, 2019
81492d9
Remove irrlicht premake4, update ocgcore pointer
kevinlul Jul 18, 2019
410b6aa
Add El Capitan to build matrix
kevinlul Jul 18, 2019
ed19973
Merge master into prebuild-ubuntu
kevinlul Jul 18, 2019
0182f62
Build freetype 2.6.5 from source on all platforms to get expected TTF…
kevinlul Jul 19, 2019
03754e6
Unlink from system freetype and link to local freetype on all platforms
kevinlul Jul 19, 2019
3d39659
Merge branch 'master' of https://github.com/edo9300/ygopro into prebu…
kevinlul Jul 19, 2019
c3673fd
Add FreeType premake4 from YGOPro 233
mercury233 Jul 20, 2019
d47c66c
Download FreeType 2.6.5 source package on Windows
kevinlul Jul 20, 2019
24cf2b3
Build freetype from 2.6.5 source on Windows, use system on all other …
kevinlul Jul 20, 2019
d97648f
Merge branch 'master' of https://github.com/edo9300/ygopro into prebu…
kevinlul Jul 20, 2019
f1575cb
Add missing freetype files for Windows, fix include directories on ot…
kevinlul Jul 20, 2019
5ae5b7e
Remove unnecessary line to delete freetype from vcpkg [ci skip]
kevinlul Jul 20, 2019
1847bf9
Set ocgcore submodule back to the original
edo9300 Jul 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Thumbs.db
# Ignore autogenerated source files
Source/Core/Common/scmrev.h
# Ignore files output by build
/[Bb]uild*/
/[Bb]uild/
/[Bb]in/
/obj/
/irrKlang/
Expand Down Expand Up @@ -35,3 +35,12 @@ CMakeLists.txt.user
*.kdev4
# Ignore IDEA/Clion files/dirs
/.idea/

/deploy/
premake5
premake5.exe
/irrlicht/include/
/irrlicht/src/
/freetype/builds/
/freetype/include/
/freetype/src/
147 changes: 147 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
language: cpp
sudo: required
dist: xenial
git:
depth: 1
submodules: false
env:
global:
- BUILD_CONFIG=release
- MSBUILD_PATH="/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin"
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- p7zip-full
- libevent-dev
- libfreetype6-dev
- libirrlicht-dev
- liblua5.3-dev
- libsqlite3-dev
- libgl1-mesa-dev
- libglu-dev
- libgit2-dev
homebrew:
update: true
packages:
- dylibbundler
- gpatch
- p7zip
- libevent
- freetype
- sqlite
- curl
- libgit2
- fmt
- nlohmann-json
matrix:
include:
- name: "Windows 10"
os: windows
env: DEPLOY_BRANCH=travis-windows
cache: false
- name: "Mojave"
os: osx
osx_image: xcode10.2
env: DEPLOY_BRANCH=travis-mojave
- name: "High Sierra"
os: osx
osx_image: xcode9.4
env: DEPLOY_BRANCH=travis-high-sierra
- name: "Sierra"
os: osx
osx_image: xcode9.2
env: DEPLOY_BRANCH=travis-sierra
- name: "El Capitan"
os: osx
osx_image: xcode8
env: DEPLOY_BRANCH=travis-el-capitan
- name: "Xenial GCC9"
os: linux
compiler: gcc
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- DEPLOY_BRANCH=travis-linux
- name: "Xenial GCC5.4"
os: linux
compiler: gcc
env: BUILD_CONFIG=release
deploy: false
before_install:
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then ./build-support/install-windows-bin.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./build-support/install-ubuntu-bin.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./build-support/install-macOS-bin.sh; fi
install:
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
export VCPKG_ROOT=/c/vcpkg;
./build-support/install-windows-vcpkg-cache.sh;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ -f cache/lib/libfmt.a ]]; then
sudo cp -r cache/* /usr/local/ && rm -rf cache && echo "Loaded fmt and nlohmann-json from cache.";
else
./build-support/install-ubuntu-src.sh;
fi;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ -f cache/libIrrlicht.a ]]; then
sudo cp -r cache/irrlicht /usr/local/include &&
sudo cp cache/lua.h cache/luaconf.h cache/lualib.h cache/lauxlib.h cache/lua.hpp /usr/local/include &&
sudo cp cache/*.a /usr/local/lib &&
rm -rf cache && echo "Loaded irrlicht and lua-c++ from cache.";
else
./build-support/install-macOS-src.sh;
fi ;
fi
before_script:
- git submodule update --depth=1 --init --recursive; echo Ignoring script/ clone failures.
script:
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
./premake5 vs2017 --no-direct3d --pics=\"$PICS_URL\" --fields=\"$FIELDS_URL\";
"$MSBUILD_PATH/msbuild.exe" -m -p:Configuration=$BUILD_CONFIG ./build/ygo.sln;
else
./premake5 gmake2 --pics=\"$PICS_URL\" --fields=\"$FIELDS_URL\";
make -Cbuild config=$BUILD_CONFIG;
fi
before_deploy:
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then ./build-support/deploy-windows.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./build-support/deploy-ubuntu.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./build-support/deploy-macOS.sh; fi
deploy:
- provider: script
skip_cleanup: true
script: bash ./build-support/travis-windows-deploy.sh
on:
all_branches: true
condition: "$TRAVIS_OS_NAME == windows"
- provider: pages
skip_cleanup: true
local_dir: deploy
github_token: $DEPLOY_TOKEN
repo: $DEPLOY_REPO
target_branch: $DEPLOY_BRANCH
on:
all_branches: true
condition: "$TRAVIS_OS_NAME != windows"
before_cache:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
mkdir -p cache/include && mkdir -p cache/lib/cmake &&
cp -r /usr/local/lib/cmake/fmt cache/lib/cmake/fmt &&
cp -r /usr/local/lib/pkgconfig cache/lib/pkgconfig &&
cp /usr/local/lib/libfmt.a cache/lib/libfmt.a &&
cp -r /usr/local/include/fmt cache/include/fmt &&
cp -r /usr/local/include/nlohmann cache/include/nlohmann;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
mkdir -p cache &&
cp -r /usr/local/include/irrlicht cache/irrlicht &&
cp /usr/local/lib/libIrrlicht.a cache/libIrrlicht.a &&
cp /usr/local/include/lua.h /usr/local/include/luaconf.h /usr/local/include/lualib.h /usr/local/include/lauxlib.h /usr/local/include/lua.hpp cache &&
cp /usr/local/lib/liblua.a cache/liblua.a;
fi
cache:
directories:
- cache
31 changes: 31 additions & 0 deletions build-support/deploy-macOS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

function bundle {
mkdir -p deploy/$1.app/Contents/MacOS
# Binary seems to be incorrectly named with the current premake
cp bin/${BUILD_CONFIG:-release}/$1.app deploy/$1.app/Contents/MacOS/$1
dylibbundler -x deploy/$1.app/Contents/MacOS/$1 -b -d deploy/$1.app/Contents/Frameworks/ -p @executable_path/../Frameworks/ -cd
# OpenSSL isn't in /usr/local/lib because Apple has deprecated it.
# libssl for some reason doesn't link to the libcrypto symlink in /usr/local/opt/openssl/lib,
# but directly to the Cellar location, and this isn't caught by dylibbundler
# This line likely needs to be updated if libcrypto's version ever changes, but not openssl's version
install_name_tool -change /usr/local/Cellar/openssl/1.0.2s/lib/libcrypto.1.0.0.dylib @executable_path/../Frameworks/libcrypto.1.0.0.dylib deploy/$1.app/Contents/Frameworks/libssl.1.0.0.dylib
if [[ "$BUILD_CONFIG" -ne "debug" ]]; then
strip deploy/$1.app/Contents/MacOS/$1
fi
mkdir -p deploy/$1.app/Contents/Resources
cp gframe/ygopro.icns deploy/$1.app/Contents/Resources/edopro.icns
defaults write "$PWD/deploy/$1.app/Contents/Info.plist" "CFBundleIconFile" "edopro.icns"
defaults write "$PWD/deploy/$1.app/Contents/Info.plist" "CFBundleIdentifier" "io.github.edo9300.$1"
}

mkdir -p deploy
mkdir -p deploy/fonts
cp bin/${BUILD_CONFIG:-release}/*.dylib deploy/
bundle ygopro
bundle ygoprodll
cp *.conf deploy/
cp *.json deploy/
if [[ ! -d deploy/textures ]]; then cp -r textures deploy/; fi
curl --retry 5 --connect-timeout 30 --location --remote-header-name --output deploy/cards.cdb https://github.com/YgoproStaff/live2019/raw/master/cards.cdb
curl --retry 5 --connect-timeout 30 --location --remote-header-name --output deploy/fonts/NotoSansJP-Regular.otf https://github.com/googlefonts/noto-cjk/raw/master/NotoSansJP-Regular.otf
17 changes: 17 additions & 0 deletions build-support/deploy-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

mkdir -p deploy
mkdir -p deploy/fonts
cp bin/${BUILD_CONFIG:-release}/*.so deploy/
cp bin/${BUILD_CONFIG:-release}/ygopro deploy/
cp bin/${BUILD_CONFIG:-release}/ygoprodll deploy/
if [[ "$BUILD_CONFIG" -ne "debug" ]]; then
strip deploy/ygopro
strip deploy/ygoprodll
fi
cp irrKlang/bin/linux-gcc-64/libIrrKlang.so deploy/
cp *.conf deploy/
cp *.json deploy/
if [[ ! -d deploy/textures ]]; then cp -r textures deploy/; fi
curl --retry 5 --connect-timeout 30 --location --remote-header-name --output deploy/cards.cdb https://github.com/YgoproStaff/live2019/raw/master/cards.cdb
curl --retry 5 --connect-timeout 30 --location --remote-header-name --output deploy/fonts/NotoSansJP-Regular.otf https://github.com/googlefonts/noto-cjk/raw/master/NotoSansJP-Regular.otf
16 changes: 16 additions & 0 deletions build-support/deploy-windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

mkdir -p deploy
mkdir -p deploy/fonts
cp bin/${BUILD_CONFIG:-release}/*.dll deploy/
cp bin/${BUILD_CONFIG:-release}/*.exe deploy/
if [[ "${1:-32}" -eq "32" ]]; then
cp irrKlang/bin/win32-visualStudio/irrKlang.dll deploy/irrKlang.dll
elif [[ "$1" -eq "64" ]]; then
cp irrKlang/bin/winx64-visualStudio/irrKlang.dll deploy/irrKlang.dll
fi
cp *.conf deploy/
cp *.json deploy/
if [[ ! -d deploy/textures ]]; then cp -r textures deploy/; fi
curl --retry 5 --connect-timeout 30 --location --remote-header-name --output deploy/cards.cdb https://github.com/YgoproStaff/live2019/raw/master/cards.cdb
curl --retry 5 --connect-timeout 30 --location --remote-header-name --output deploy/fonts/NotoSansJP-Regular.otf https://github.com/googlefonts/noto-cjk/raw/master/NotoSansJP-Regular.otf
14 changes: 14 additions & 0 deletions build-support/install-macOS-bin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-macosx.tar.gz
rm -f premake5
tar xf premake-5.0.0-alpha14-macosx.tar.gz
rm premake-5.0.0-alpha14-macosx.tar.gz

curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name http://www.ambiera.at/downloads/irrKlang-64bit-1.6.0.zip
7z x irrKlang-64bit-1.6.0.zip
rm -rf irrKlang
mv irrKlang-64bit-1.6.0 irrKlang
rm irrKlang-64bit-1.6.0.zip
# For convenience with dylibbundler
cp -f irrKlang/bin/macosx-gcc/libirrklang.dylib /usr/local/lib
6 changes: 6 additions & 0 deletions build-support/install-macOS-brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

if [[ $(command -v brew) == "" ]]; then
/usr/bin/ruby -e "$(curl -fsSL https://github.com/raw/Homebrew/install/master/install)"
fi
brew install dylibbundler gpatch p7zip libevent fmt freetype sqlite curl libgit2 nlohmann-json
15 changes: 15 additions & 0 deletions build-support/install-macOS-sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

if [[ "$#" -lt 1 ]]; then
echo "Usage: ./install-macOS-sdk.sh [version] <...>"
echo " e.g. ./install-macOS-sdk.sh 10.9 10.12"
exit
fi

SDK_PATH=$(dirname `xcrun --sdk macosx --show-sdk-path`)
while [[ $# -gt 0 ]]; do
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX$1.sdk.tar.xz
sudo tar xf MacOSX$1.sdk.tar.xz -C $SDK_PATH
rm MacOSX$1.sdk.tar.xz
shift
done
20 changes: 20 additions & 0 deletions build-support/install-macOS-src.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

cp irrlicht/irrlicht-macOS.patch /tmp
cd /tmp
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://downloads.sourceforge.net/irrlicht/irrlicht-1.8.4.zip
7z x irrlicht-1.8.4.zip
cd irrlicht-1.8.4
/usr/local/opt/gpatch/bin/patch -p0 --binary -i ../irrlicht-macOS.patch
xcodebuild -project source/Irrlicht/MacOSX/MacOSX.xcodeproj -configuration Release -target libIrrlicht.a SYMROOT=build
sudo mkdir -p /usr/local/include/irrlicht
sudo cp -r include/*.h /usr/local/include/irrlicht
sudo cp source/Irrlicht/MacOSX/build/Release/libIrrlicht.a /usr/local/lib

# Installs lua for C++ to /usr/local from source because brew's version is wonky
cd /tmp
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.3.5.tar.gz
tar xf lua-5.3.5.tar.gz
cd lua-5.3.5
make macosx CC=g++
sudo make install
5 changes: 5 additions & 0 deletions build-support/install-ubuntu-apt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

# Dependencies retrievable from apt on xenial and bionic
# libfmt-dev and nlohmann-json3-dev are only retrievable from eoan
sudo apt-get install -y build-essential cmake curl p7zip-full libevent-dev libfreetype6-dev libirrlicht-dev liblua5.3-dev libsqlite3-dev libgl1-mesa-dev libglu-dev libgit2-dev libasound2
17 changes: 17 additions & 0 deletions build-support/install-ubuntu-bin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# Installs needed binaries to the working directory
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-linux.tar.gz
rm -f premake5
tar xf premake-5.0.0-alpha14-linux.tar.gz
rm premake-5.0.0-alpha14-linux.tar.gz

curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name http://www.ambiera.at/downloads/irrKlang-64bit-1.6.0.zip
7z x irrKlang-64bit-1.6.0.zip
rm -rf irrKlang
mv irrKlang-64bit-1.6.0 irrKlang
rm irrKlang-64bit-1.6.0.zip

mkdir -p bin
mkdir -p bin/debug
mkdir -p bin/release
12 changes: 12 additions & 0 deletions build-support/install-ubuntu-src.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# Installs needed dependencies to /usr/local from source
git clone --depth=1 --branch=master https://github.com/fmtlib/fmt.git /tmp/fmt
cd /tmp/fmt
cmake .
make
sudo make install

curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/raw/nlohmann/json/develop/single_include/nlohmann/json.hpp
sudo mkdir -p /usr/local/include/nlohmann
sudo mv json.hpp /usr/local/include/nlohmann
49 changes: 49 additions & 0 deletions build-support/install-windows-bin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash

# Installs needed binaries to the working directory
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-windows.zip
rm -f premake5.exe
unzip -uo premake-5.0.0-alpha14-windows.zip
rm premake-5.0.0-alpha14-windows.zip

# We are locked to FreeType 2.6.5 for now because of TTF interpreter behaviour in newer versions
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name http://downloads.sourceforge.net/freetype/freetype-2.6.5.tar.bz2
echo Extracting FreeType...
tar xf freetype-2.6.5.tar.bz2 > /dev/null
mv freetype-2.6.5/builds freetype
mv freetype-2.6.5/include freetype
mv freetype-2.6.5/src freetype
rm -rf freetype-2.6.5
rm freetype-2.6.5.tar.bz2

curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name http://www.ambiera.at/downloads/irrKlang-64bit-1.6.0.zip
echo Extracting irrKlang64...
unzip -uo irrKlang-64bit-1.6.0.zip > /dev/null
rm -rf irrKlang
mv irrKlang-64bit-1.6.0 irrKlang
rm irrKlang-64bit-1.6.0.zip

# We wrap irrKlang32's extract because its zip has a hidden macOS directory that we don't want
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.ambiera.at/downloads/irrKlang-32bit-1.6.0.zip
echo Extracting irrKlang32...
unzip -uo irrKlang-32bit-1.6.0.zip -d irrKlang-tmp > /dev/null
# Merge 32-bit binaries into folder
mv irrKlang-tmp/irrKlang-1.6.0/bin/win32-gcc irrKlang/bin/win32-gcc
mv irrKlang-tmp/irrKlang-1.6.0/bin/win32-visualStudio irrKlang/bin/win32-visualStudio
mv irrKlang-tmp/irrKlang-1.6.0/lib/Win32-gcc irrKlang/lib/Win32-gcc
mv irrKlang-tmp/irrKlang-1.6.0/lib/Win32-visualStudio irrKlang/lib/Win32-visualStudio
rm -rf irrKlang-tmp
rm irrKlang-32bit-1.6.0.zip

curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://downloads.sourceforge.net/irrlicht/irrlicht-1.8.4.zip
echo Extracting irrlicht... this may take some time.
unzip -uo irrlicht-1.8.4.zip > /dev/null
mv irrlicht-1.8.4/include irrlicht/include
# Technically, only code files need to be moved, and code files in lzma and aesGladman, but this is easier
mv irrlicht-1.8.4/source/Irrlicht irrlicht/src
rm -rf irrlicht-1.8.4
rm irrlicht-1.8.4.zip
# We will build against vcpkg-provided versions of these libs
rm -rf irrlicht/src/bzip2 irrlicht/src/jpeglib irrlicht/src/libpng irrlicht/src/zlib irrlicht/src/MacOSX
patch -p0 -i irrlicht/irrlicht-windows.patch
echo Patched irrlicht.
10 changes: 10 additions & 0 deletions build-support/install-windows-vcpkg-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

git clone --depth=1 https://github.com/Microsoft/vcpkg.git $VCPKG_ROOT
cd $VCPKG_ROOT
curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/kevinlul/edopro-vcpkg-cache/raw/master/installed.zip
unzip -uo installed.zip
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '.\bootstrap-vcpkg.bat'"
./vcpkg.exe integrate install
cd -
./build-support/install-windows-vcpkg.sh;
Loading