Skip to content

Commit 1aaa839

Browse files
committed
Mac: Use brew installed sqlite instead of the system one (#434)
Link to issue #414
1 parent d4a4c69 commit 1aaa839

File tree

4 files changed

+20
-25
lines changed

4 files changed

+20
-25
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ matrix:
2020
fast_finish: true
2121
allow_failures:
2222
- rust: nightly
23-
- os: osx
2423
include:
2524
- sudo: required
2625
os: linux

README.md

+9-21
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ $ git clone git@github.com:<username>/foxbox.git
8383
$ cd foxbox
8484
```
8585

86+
### Extra steps for Mac OS X
87+
88+
Foxbox requires some up-to-date libraries (like OpenSSL). In order to make sure you have the correct packages and bindings, we recommend you to install brew and to run:
89+
90+
``` bash
91+
brew install openssl libupnp sqlite
92+
source tools/mac-os-x-setup.source.sh
93+
```
94+
8695
## Build time options
8796
### Disable authentication
8897
You may want to disable endpoints authentication to ease your development process. You can do that by removing `authentication` from the `default` feature in the `Cargo.toml` file.
@@ -220,24 +229,3 @@ For an extensive write-up about cross compiling Rust programs see:
220229
### Mac OS X
221230

222231
Cross compiling on Mac hasn't been documented. A PR is welcomed. :wink:
223-
224-
225-
## Notes for Mac OS X with Brew
226-
227-
You'll need some dependencies installed to build.
228-
229-
``` bash
230-
$ brew install openssl libupnp sqlite
231-
```
232-
233-
This is required to build/link the openssl crate and foxbox using homebrew's openssl:
234-
235-
``` bash
236-
$ export DEP_OPENSSL_INCLUDE=/usr/local/opt/openssl/include/
237-
$ export OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib
238-
$ export EXTRA_LDFLAGS=-L/usr/local/opt/openssl/lib
239-
```
240-
241-
Previous versions of these instructions described setting ```OPENSSL_INCLUDE_DIR```.
242-
Make sure it is unset. In fact, an obsolete value may have been cached by cargo
243-
which is fixed by ```cargo clean```.

tools/mac-os-x-setup.source.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This script must be sourced. Please run `source tools/mac-os-x-setup.sh`
2+
3+
# openssl and sqlite libraries are already installed on OS X base system. That's
4+
# why we need to explicitely specify the directories that brew installed.
5+
# TODO: Remove sqlite once pkg_config is able to not bubble up a system path
6+
# For more information, see https://github.com/fxbox/foxbox/issues/414
7+
export DEP_OPENSSL_INCLUDE="$(brew --prefix openssl)/include"
8+
export OPENSSL_LIB_DIR="$(brew --prefix openssl)/lib"
9+
export SQLITE3_LIB_DIR="$(brew --prefix sqlite)/lib"

tools/travis-osx.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ set -e
44

55
CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
66

7-
export OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib
8-
export EXTRA_LDFLAGS=-L/usr/local/opt/openssl/lib
97

108
install_dependencies() {
119
brew update
12-
brew install libupnp openssl sqlite
10+
brew install openssl libupnp sqlite
11+
source "$CURRENT_PATH/mac-os-x-setup.source.sh"
1312
}
1413

1514
build() {

0 commit comments

Comments
 (0)