diff --git a/Makefile b/Makefile index 47363d6..b1de7fe 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,29 @@ DEV_ROCKS=busted luacov luacov-coveralls luacheck ldoc BUSTED_ARGS ?= -v -o gtest CASSANDRA ?= 3.10 +PROD_ROCKFILE = $(shell ls lua-cassandra-*.rockspec | grep -v dev) +DEV_ROCKFILE = $(shell ls lua-cassandra-*.rockspec | grep dev) +FLAGS ?= .PHONY: install dev busted prove test clean coverage lint doc install: - @luarocks make + @luarocks make $(PROD_ROCKFILE) -dev: install +install-dev: + @luarocks $(FLAGS) make $(DEV_ROCKFILE) OPENSSL_DIR=$(OPENSSL_DIR) + +dev: @for rock in $(DEV_ROCKS) ; do \ if ! luarocks list | grep $$rock > /dev/null ; then \ echo $$rock not found, installing via luarocks... ; \ - luarocks install $$rock ; \ + luarocks install $(FLAGS) $$rock ; \ else \ echo $$rock already installed, skipping ; \ fi \ done; -busted: +busted: install-dev @busted $(BUSTED_ARGS) prove: @@ -31,7 +37,7 @@ clean: @rm -f luacov.* @util/clean_ccm.sh -coverage: clean +coverage: clean install-dev @busted $(BUSTED_ARGS) --coverage @util/prove_ccm.sh $(CASSANDRA) @TEST_COVERAGE_ENABLED=true TEST_NGINX_TIMEOUT=30 prove diff --git a/README.md b/README.md index 0cb5868..7cef97e 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,26 @@ The documentation is generated with $ make doc ``` +#### macOS notes + +## Openssl headers + +Newer versions of macOS don't include the openssl headers by purpose. You'll need to install +them via `brew install openssl` or manually. + +Homebrew openssl headers however don't get symlinked in /usr/local, so you need to tell +luarocks where to find them via `OPENSSL_DIR`. + +``` +OPENSSL_DIR=/usr/local/opt/openssl/ FLAGS='--local' make busted +``` + +## Install rocks locally + +To install the development dependencies locally instead of in `/usr/local`, set +`FLAGS='--local'`. This will use the tree in the user's home directory. +You might also need to run `eval $(luarocks path --bin)` to add them to your path. + [Back to TOC](#table-of-contents) [Luarocks]: https://luarocks.org diff --git a/lua-cassandra-1.2.3-0.rockspec b/lua-cassandra-1.2.3-0.rockspec index 447d00d..df31dbd 100644 --- a/lua-cassandra-1.2.3-0.rockspec +++ b/lua-cassandra-1.2.3-0.rockspec @@ -10,7 +10,9 @@ description = { license = "MIT" } dependencies = { - "luabitop" + "luabitop", + "luasec", + "luasocket" } build = { type = "builtin", diff --git a/lua-cassandra-dev-0.rockspec b/lua-cassandra-dev-0.rockspec index 7dd921a..25e64ed 100644 --- a/lua-cassandra-dev-0.rockspec +++ b/lua-cassandra-dev-0.rockspec @@ -9,7 +9,9 @@ description = { license = "MIT" } dependencies = { - "luabitop" + "luabitop", + "luasec", + "luasocket" } build = { type = "builtin",