Browse files

Add pre-built "piqi" executable as dependency

  • Loading branch information...
1 parent f349fa1 commit 2c09b8112d3125a6558965b40e0a496310725f27 @alavrik committed Mar 12, 2013
View
4 .gitignore
@@ -1,5 +1,9 @@
/ebin
/.eunit
+/deps
+
+# created by get-deps
+/priv/piqi-binary
# vim
*.swp
View
1 Makefile
@@ -23,6 +23,7 @@ clean:
distclean: clean
+ $(REBAR) delete-deps
rm -rf ebin deps
View
1 examples/addressbook/deps/piqi_binary
View
1 examples/custom-types/deps/piqi_binary
View
1 examples/untyped-json-xml/deps/piqi_binary
View
12 rebar.config
@@ -4,6 +4,12 @@
{sub_dirs, ["piqic-erlang"]}.
+{deps, [
+ % "piqi" binary executables pre-built for various platforms
+ {piqi_binary, "", {git, "git://github.com/alavrik/piqi-binary.git", {tag, "v0.6.1"}}, [raw]}
+]}.
+
+
% tolerate edoc quirks by #ifndef-ing several adjacent -spec
{edoc_opts, [{preprocess, true}, {macros, [{'EDOC', 1}]}]}.
@@ -14,7 +20,11 @@
{post_hooks, [
- {clean, "make -C src -f Makefile.piqi clean"}
+ {clean, "make -C src -f Makefile.piqi clean"},
+
+ {'get-deps', "rm -rf priv/piqi-binary"},
+ {'get-deps', "cp -a \"$REBAR_DEPS_DIR/piqi_binary\" priv/piqi-binary"},
+ {'delete-deps', "rm -rf priv/piqi-binary"}
]}.
View
5 src/Makefile
@@ -1,7 +1,6 @@
-# TODO: uncomment this once the the new (fixed) version of piqi is released
-#PIQI = ../priv/bin-"`uname -s`-`uname -m`"/piqi
-PIQI = piqi
+#PIQI = piqi
+PIQI = ../priv/piqi-binary/"`uname -s`-`uname -m`"/piqi
#PIQIC = ../piqic-erlang/piqic-erlang
PIQIC = ERL_FLAGS="-pa ../piqic-erlang/ebin" ../priv/bin/piqic-erlang
View
4 src/piqi.erl
@@ -46,9 +46,9 @@ find_piqi() ->
PiqiDir ->
KernelName = os:cmd("uname -s") -- "\n",
Machine = os:cmd("uname -m") -- "\n",
- BinDir = lists:concat(["bin-", KernelName, "-", Machine]),
+ Arch = lists:concat([KernelName, "-", Machine]),
% path to "piqi" executable within "piqi" application directory
- FullName = filename:join([PiqiDir, "priv", BinDir, "piqi"]),
+ FullName = filename:join([PiqiDir, "priv", "piqi-binary", Arch, "piqi"]),
case filelib:is_regular(FullName) of
true ->
FullName;
View
4 src/piqic_erlang.erl
@@ -210,9 +210,9 @@ get_cwd(_NewCwd) ->
find_piqi_executable() ->
KernelName = os:cmd("uname -s") -- "\n",
Machine = os:cmd("uname -m") -- "\n",
- BinDir = lists:concat(["bin-", KernelName, "-", Machine]),
+ Arch = lists:concat([KernelName, "-", Machine]),
% path to "piqi" executable within "piqi" application directory
- AppPath = filename:join(["priv", BinDir, "piqi"]),
+ AppPath = filename:join(["priv", "piqi-binary", Arch, "piqi"]),
try
case os:getenv("REBAR_DEPS_DIR") of
false ->

0 comments on commit 2c09b81

Please sign in to comment.