]> granicus.if.org Git - ejabberd/commitdiff
Improve --enable-system-deps
authorPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 30 Oct 2017 12:55:10 +0000 (13:55 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 30 Oct 2017 12:55:10 +0000 (13:55 +0100)
Makefile.in
rebar.config.script

index 3d9388df71077f8a633e2e0fc53a12380e1ee101..86d4ca6d12d565cb7ea96d5133cc5e134be2727f 100644 (file)
@@ -93,6 +93,7 @@ deps: deps/.got
 deps/.got:
        rm -rf deps/.got
        rm -rf deps/.built
+       mkdir deps
        $(REBAR) get-deps && :> deps/.got
 
 deps/.built: deps/.got
index 219514a2f1a9a13ed394386d145a3ff21d594ceb..85f918fffd1b94ce5ee085e4b833ef61330d2eac 100644 (file)
@@ -229,13 +229,22 @@ TestConfig = case file:read_file_info(TestConfigFile) of
                     ""
             end,
 
-ResolveDepPath = case IsRebar3 of
-                    true ->
+ResolveDepPath = case {SystemDeps, IsRebar3} of
+                    {true, _} ->
                         fun("deps/" ++ Rest) ->
                                 Slash = string:str(Rest, "/"),
-                                Dir = "_build/default/lib/" ++
-                                    string:sub_string(Rest, 1, Slash - 1),
-                                Dir ++ string:sub_string(Rest, Slash);
+                                code:lib_dir(
+                                  string:sub_string(Rest, 1, Slash -1)) ++
+                                    string:sub_string(Rest, Slash);
+                           (Path) ->
+                                Path
+                        end;
+                    {_, true} ->
+                        fun("deps/" ++ Rest) ->
+                                Slash = string:str(Rest, "/"),
+                                "_build/default/lib/" ++
+                                    string:sub_string(Rest, 1, Slash - 1) ++
+                                    string:sub_string(Rest, Slash);
                            (Path) ->
                                 Path
                         end;
@@ -326,7 +335,7 @@ Rules = [
          AppendList([{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl.git", "master"}}]), []},
         {[post_hooks], [cover_enabled], os:getenv("TRAVIS") == "true",
          AppendList2(TravisPostHooks), [], false},
-        {[overrides], [post_hook_configure], true,
+        {[overrides], [post_hook_configure], SystemDeps == false,
          AppendList2(GenDepsConfigure), [], []},
         {[ct_extra_params], [eunit_compile_opts], true,
          AppendStr2(CtParams), "", []},