Don't use git submodule

This commit is contained in:
Sean Hinde 2023-01-13 16:11:18 +01:00
parent bf0ab982e7
commit 68e9605c92
6 changed files with 26 additions and 13 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
/priv/ecrecover.so /priv/ecrecover.so
/c_src/ecrecover.d /c_src/ecrecover.d
/c_src/ecrecover.o /c_src/ecrecover.o
/c_src/secp256k1

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "c_src/secp256k1"]
path = c_src/secp256k1
url = https://github.com/bitcoin-core/secp256k1.git

12
Makefile Normal file
View File

@ -0,0 +1,12 @@
REBAR3 ?= $(shell test -e `which rebar3` 2>/dev/null && which rebar3 || echo "./rebar3")
all: compile
compile:
${REBAR3} compile
clean:
${REBAR3} clean
test: compile
${REBAR3} eunit

@ -1 +0,0 @@
Subproject commit cbe41ac138bc0773d60ab1942b7ad6fc5eccfc19

View File

@ -1,15 +1,7 @@
{deps, {deps,
[{sha3, {git, "https://github.com/aeternity/erlang-sha3", {ref, "b5f27a2"}}}]}. [{sha3, {git, "https://github.com/aeternity/erlang-sha3", {ref, "b5f27a2"}}}]}.
{pre_hooks, [ {compile, "git submodule update --init"} {pre_hooks, [ {compile, "./secp256k1.sh"} ]}.
, {"(linux|darwin)", compile, "sh -c \"cd c_src/secp256k1 && ./autogen.sh && ./configure --enable-module-recovery && make\""}
, {"win32", compile, "make -f Makefile.win32 win32_ecrecover"}
]}.
{post_hooks, [ {"(linux|darwin)", clean, "make -C \"c_src/secp256k1\" clean"}
, {"win32", clean, "make -f Makefile.win32 clean_win32_ecrecover"}
]}.
{plugins, [pc]}. {plugins, [pc]}.

12
secp256k1.sh Executable file
View File

@ -0,0 +1,12 @@
#! /bin/sh
[ -f c_src/secp256k1/.libs/libsecp256k1.a ] && exit 0
cd c_src
git clone https://github.com/bitcoin/secp256k1
cd secp256k1
git -c advice.detachedHead=false checkout cbe41ac138bc0773d60ab1942b7ad6fc5eccfc19
./autogen.sh
./configure --enable-module-recovery
make clean
make