rebar.config.script 1005 B

1234567891011121314151617181920212223242526272829303132
  1. %% -*- mode: erlang -*-
  2. IsCentos6 = fun() ->
  3. case file:read_file("/etc/centos-release") of
  4. {ok, <<"CentOS release 6", _/binary >>} ->
  5. true;
  6. _ ->
  7. false
  8. end
  9. end,
  10. IsWin32 = fun() ->
  11. win32 =:= element(1, os:type())
  12. end,
  13. IsQuicSupp = fun() ->
  14. not (IsCentos6() orelse IsWin32() orelse
  15. false =/= os:getenv("BUILD_WITHOUT_QUIC")
  16. )
  17. end,
  18. Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
  19. Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.9"}}},
  20. ExtraDeps = fun(C) ->
  21. {deps, Deps0} = lists:keyfind(deps, 1, C),
  22. Deps = Deps0 ++ [Bcrypt || not IsWin32()] ++
  23. [ Quicer || IsQuicSupp()],
  24. lists:keystore(deps, 1, C, {deps, Deps})
  25. end,
  26. ExtraDeps(CONFIG).