From 908793fa270ba1033f89bb7dc670be2bcc840c88 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 15 Apr 2019 11:56:45 +0100 Subject: [PATCH] Simplify build instructions for macOS (#83) --- .travis.yml | 2 +- Brewfile | 5 +++++ Brewfile-32bit.rb | 3 +++ README.md | 25 +++++++------------------ xcode-build.sh => macos-build.sh | 3 ++- 5 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 Brewfile create mode 100644 Brewfile-32bit.rb rename xcode-build.sh => macos-build.sh (99%) diff --git a/.travis.yml b/.travis.yml index ea66aa2da..fc6b8ca88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: - env: ARCH=--build-all-x64 script: - - bash ./xcode-build.sh $ARCH + - bash ./macos-build.sh $ARCH deploy: provider: releases diff --git a/Brewfile b/Brewfile new file mode 100644 index 000000000..0e0a1ee93 --- /dev/null +++ b/Brewfile @@ -0,0 +1,5 @@ +brew "cmake" +brew "sdl2_mixer" +brew "sdl2_ttf" +brew "libsodium" +brew "pkg-config" diff --git a/Brewfile-32bit.rb b/Brewfile-32bit.rb new file mode 100644 index 000000000..17f2d6ef7 --- /dev/null +++ b/Brewfile-32bit.rb @@ -0,0 +1,3 @@ +brew "automake" +brew "autoconf" +brew "libtool" diff --git a/README.md b/README.md index 3b3a7594a..d84ff06d7 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,9 @@ Note: Be sure that your to select the command line Xcode if you have more then o ``` $ sudo xcode-select --switch /Applications/Xcode.app ``` -Install the build tools using [Homebrew](https://brew.sh/): -``` -brew install automake autoconf libtool -``` -Also, verify that you don't have FreeType and HarfBuzz installed from Homebrew, which will cause build errors for SDL2_ttf: +Verify that you don't have FreeType and HarfBuzz installed from +[Homebrew](https://brew.sh/), which will cause build errors for SDL2_ttf: ``` brew info freetype @@ -67,15 +64,9 @@ brew uninstall --ignore-dependencies harfbuzz You can install FreeType and HarfBuzz from Homebrew again after devilutionX builds successfully. -Get SDL2, SDL2_mixer, SDL2_ttf and Libsodium: -``` -./xcode-build.sh --get-libs -``` -### Compiling +Now you can run the build script: ``` -./xcode-build.sh --build-libs -./xcode-build.sh --build-project -./xcode-build.sh --package +./macos-build.sh --build-all-x86 ```
Windows via MinGW @@ -125,12 +116,10 @@ make -j$(nproc)
macOS -Install the dependencies using [Homebrew](https://brew.sh/): -``` -brew install cmake sdl2_mixer sdl2_ttf libsodium pkg-config -``` -### Compiling +Make sure you have [Homebrew](https://brew.sh/) installed, then run: + ``` +brew bundle mkdir build cd build cmake .. diff --git a/xcode-build.sh b/macos-build.sh similarity index 99% rename from xcode-build.sh rename to macos-build.sh index 665e1767a..4c5719ff0 100755 --- a/xcode-build.sh +++ b/macos-build.sh @@ -110,6 +110,7 @@ function set_working_dir() { } function build_all_x86 (){ + brew bundle --file=Brewfile-32bit.rb set_working_dir get_libs decompress_libs @@ -124,7 +125,7 @@ function build_all_x86 (){ } function build_all_x64 (){ - brew install sdl2 sdl2_mixer sdl2_ttf libsodium + brew bundle mkdir build cd build cmake ..