Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #11 from chef/jd/rebar3
rebar3 support for bcrypt
  • Loading branch information
joedevivo committed Jul 27, 2015
2 parents 7515e80 + 4a928c9 commit 5cbe6becbe926739adebc67c6827ac2a2b9e7bbd
Showing 3 changed files with 24 additions and 3 deletions.
@@ -4,14 +4,27 @@
%% {so_specs,
%% [{"priv/bcrypt_nif.so",
%% ["c_src/*.c"]}]}.
{port_env,
[{"DRV_LDFLAGS","-shared $ERL_LDFLAGS -lpthread"},
{port_env, [
{"DRV_LDFLAGS","-shared $ERL_LDFLAGS -lpthread"},
{"darwin", "DRV_LDFLAGS", "-bundle -flat_namespace -undefined suppress $ERL_LDFLAGS -lpthread"},
{"solaris", "ERL_CFLAGS", "-lnsl $ERL_CFLAGS"},
{"DRV_CFLAGS","-Ic_src -Wall -fPIC $ERL_CFLAGS"}]}.
{"DRV_CFLAGS","-Ic_src -Wall -fPIC $ERL_CFLAGS"}
]}.

{port_specs, [{"priv/bcrypt_nif.so", ["c_src/*.c"]}]}.

%% These post_hooks are for rebar2. rebar.config.script removes them if
%% rebar3 is detected
{post_hooks,
[{clean, "make -C c_src clean"},
{compile, "make -C c_src"}]}.

%% plugins and provider_hooks are for rebar3. rebar.config.script removes them
%% if rebar2 is detected
{plugins, [pc]}.
{provider_hooks, [
{pre, [
{compile, {pc, compile}},
{clean, {pc, clean}}
]}
]}.
@@ -0,0 +1,7 @@
case code:is_loaded(rebar3) of
false ->
C1 = proplists:delete(plugins, CONFIG),
proplists:delete(provider_hooks, C1);
{file, _} ->
proplists:delete(post_hooks, CONFIG)
end.
@@ -0,0 +1 @@
[].

0 comments on commit 5cbe6be

Please sign in to comment.