diff --git a/.travis.yml b/.travis.yml index 1afa8d0c70df1..4a620558ba140 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,7 +111,7 @@ jobs: directories: - $HOME/.ccache - - env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1 + - env: CLANG=clang++ NATIVE=osx OSX_MIN=10.13 TILES=1 SOUND=1 BREWGETTEXT=1 name: "Xcode 10.1 Make build with Tiles and sound (macOS)" os: osx osx_image: xcode10.1 diff --git a/Makefile b/Makefile index 63b08fa89fa27..75e08e6a57537 100644 --- a/Makefile +++ b/Makefile @@ -451,6 +451,11 @@ ifeq ($(NATIVE), osx) LDFLAGS += -L$(LIBSDIR)/gettext/lib CXXFLAGS += -I$(LIBSDIR)/gettext/include endif + ifeq ($(BREWGETTEXT), 1) + # recent versions of brew will not allow you to link + LDFLAGS += -L/usr/local/opt/gettext/lib + CXXFLAGS += -I/usr/local/opt/gettext/include + endif ifeq ($(MACPORTS), 1) ifneq ($(TILES), 1) CXXFLAGS += -I$(shell ncursesw6-config --includedir) diff --git a/build-scripts/requirements.sh b/build-scripts/requirements.sh index 3e9d88ee64f0b..c45be056bd724 100644 --- a/build-scripts/requirements.sh +++ b/build-scripts/requirements.sh @@ -74,7 +74,6 @@ fi if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gettext ncurses ccache - brew link --force gettext ncurses fi if [[ "$NATIVE" == "android" ]]; then diff --git a/doc/COMPILING/COMPILING.md b/doc/COMPILING/COMPILING.md index 6d785a93d1b72..6ab70af98c38c 100644 --- a/doc/COMPILING/COMPILING.md +++ b/doc/COMPILING/COMPILING.md @@ -449,11 +449,6 @@ ncurses (with wide character support enabled) and gettext are needed if you want For Homebrew: brew install gettext ncurses - brew link --force gettext ncurses - -Then, after compiling, be sure to unlink these libraries to prevent conflicts with the OS X shared libraries: - - brew unlink gettext ncurses For MacPorts: @@ -493,6 +488,7 @@ The Cataclysm source is compiled using `make`. * `SOUND=1` - if you want sound; this requires `TILES=1` and the additional dependencies mentioned above. * `FRAMEWORK=1` (tiles only) link to SDL libraries under the OS X Frameworks folders; omit to use SDL shared libraries from Homebrew or Macports. * `LOCALIZE=0` disable localization (to get around possible `gettext` errors if it is not setup correctly); omit to use `gettext`. +* `BREWGETTEXT=1` set this if you don't set LOCALIZE=0 and have installed `gettext` from homebrew--homebrew will refuse to link gettext in recent versions. * `LANGUAGES="[lang_id_2][...]"` compile localization files for specified languages. e.g. `LANGUAGES="zh_CN zh_TW"`. You can also use `LANGUAGES=all` to compile all localization files. * `RELEASE=1` build an optimized release version; omit for debug build. * `CLANG=1` build with [Clang](http://clang.llvm.org/), the compiler that's included with the latest Command Line Tools for Xcode; omit to build using gcc/g++.