Skip to content

Commit

Permalink
rebar3 support for bcrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
joedevivo committed Jul 24, 2015
1 parent 7515e80 commit 085eb59
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
15 changes: 12 additions & 3 deletions rebar.config
Expand Up @@ -4,14 +4,23 @@
%% {so_specs, %% {so_specs,
%% [{"priv/bcrypt_nif.so", %% [{"priv/bcrypt_nif.so",
%% ["c_src/*.c"]}]}. %% ["c_src/*.c"]}]}.
{port_env, {port_env, [
[{"DRV_LDFLAGS","-shared $ERL_LDFLAGS -lpthread"}, {"DRV_LDFLAGS","-shared $ERL_LDFLAGS -lpthread"},
{"darwin", "DRV_LDFLAGS", "-bundle -flat_namespace -undefined suppress $ERL_LDFLAGS -lpthread"}, {"darwin", "DRV_LDFLAGS", "-bundle -flat_namespace -undefined suppress $ERL_LDFLAGS -lpthread"},
{"solaris", "ERL_CFLAGS", "-lnsl $ERL_CFLAGS"}, {"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"]}]}. {port_specs, [{"priv/bcrypt_nif.so", ["c_src/*.c"]}]}.


{post_hooks, {post_hooks,
[{clean, "make -C c_src clean"}, [{clean, "make -C c_src clean"},
{compile, "make -C c_src"}]}. {compile, "make -C c_src"}]}.

{plugins, [pc]}.
{provider_hooks, [
{pre, [
{compile, {pc, compile}},
{clean, {pc, clean}}
]}
]}.
7 changes: 7 additions & 0 deletions rebar.config.script
@@ -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.
1 change: 1 addition & 0 deletions rebar.lock
@@ -0,0 +1 @@
[].

0 comments on commit 085eb59

Please sign in to comment.