Skip to content

Commit

Permalink
Update secp256k1 to 0.4.1
Browse files Browse the repository at this point in the history
Doesn't include local source for macOS and iOS on flutter
  • Loading branch information
MatthewLM committed Jan 30, 2024
1 parent 3b8490e commit 85ab120
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
6 changes: 3 additions & 3 deletions coinlib/bin/build_linux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ RUN apt-get update -y \
# Could use secp256k1 already in code-base but this makes the dockerfile more
# independent and avoids complexity of copying everything into the correct
# context. It's not a large library to download.
# Use 0.3.1 release
# Use 0.4.1 release
RUN git clone https://github.com/bitcoin-core/secp256k1 \
&& cd secp256k1 \
&& git checkout 346a053d4c442e08191f075c3932d03140579d47
&& git checkout 1ad5185cd42c0636104129fcc9f6a4bf9c67cc40
WORKDIR /secp256k1
Expand All @@ -34,7 +34,7 @@ RUN make
# maintained.
RUN make install
RUN mkdir output
RUN cp /usr/local/lib/libsecp256k1.so.2.0.1 output/libsecp256k1.so
RUN cp /usr/local/lib/libsecp256k1.so.2.1.1 output/libsecp256k1.so
""";

void main() async {
Expand Down
6 changes: 3 additions & 3 deletions coinlib/bin/build_macos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ void main() async {
"Could not clone secp256k1 to temporary build directory",
);

// Checkout to 0.3.2 commit
// Checkout to 0.4.1 commit
exitOnCode(
await execWithStdio(
"git", ["checkout", "acf5c55ae6a94e5ca847e07def40427547876101"],
"git", ["checkout", "1ad5185cd42c0636104129fcc9f6a4bf9c67cc40"],
workingDir: libDir,
),
"Could not checkout to v0.3.2 commit",
"Could not checkout to v0.4.1 commit",
);

// Generate configure
Expand Down
4 changes: 2 additions & 2 deletions coinlib/bin/build_wasm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ RUN wget -nv https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-
RUN tar xvf $WASI_ARCHIVE
RUN rm $WASI_ARCHIVE
# Clone libsecp256k1 and use v0.3.1
# Clone libsecp256k1 and use v0.4.1
RUN git clone https://github.com/bitcoin-core/secp256k1 \
&& cd secp256k1 \
&& git checkout 346a053d4c442e08191f075c3932d03140579d47
&& git checkout 1ad5185cd42c0636104129fcc9f6a4bf9c67cc40
WORKDIR /secp256k1
# Build using wasi-sdk
Expand Down
3 changes: 2 additions & 1 deletion coinlib/bin/build_windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ void main() async {
Directory.current = Directory("$tmpDir/secp256k1");
await execWithStdio(
"git",
["checkout", "346a053d4c442e08191f075c3932d03140579d47"],
// Use version 0.4.1
["checkout", "1ad5185cd42c0636104129fcc9f6a4bf9c67cc40"],
);

// Build in tmpDir/secp256k1/build.
Expand Down
6 changes: 3 additions & 3 deletions coinlib/bin/build_windows_crosscompile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ FROM debian:bullseye
RUN apt-get update -y \
&& apt-get install -y autoconf libtool build-essential git cmake gcc-mingw-w64
# Clone libsecp256k1 0.3.1 release.
# Clone libsecp256k1 0.4.1 release.
RUN git clone https://github.com/bitcoin-core/secp256k1 \
&& cd secp256k1 \
&& git checkout 346a053d4c442e08191f075c3932d03140579d47 \
&& git checkout 1ad5185cd42c0636104129fcc9f6a4bf9c67cc40 \
&& mkdir build
WORKDIR /secp256k1/build
Expand All @@ -25,7 +25,7 @@ RUN make
# Build DLL and copy into output.
RUN make install
RUN mkdir output
RUN cp src/libsecp256k1.dll output/secp256k1.dll
RUN cp src/libsecp256k1-2.dll output/secp256k1.dll
""";

void main() async {
Expand Down
3 changes: 2 additions & 1 deletion coinlib/bin/build_wsl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ void main() async {
Directory.current = Directory("$tmpDir/secp256k1");
await execWithStdio(
"git",
["checkout", "346a053d4c442e08191f075c3932d03140579d47"],
// Use version 0.4.1
["checkout", "1ad5185cd42c0636104129fcc9f6a4bf9c67cc40"],
);

// Build in tmpDir/secp256k1/lib.
Expand Down
2 changes: 1 addition & 1 deletion coinlib/lib/src/secp256k1/secp256k1.wasm.g.dart

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion coinlib_flutter/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ExternalProject_Add(
secp256k1

GIT_REPOSITORY https://github.com/bitcoin-core/secp256k1
GIT_TAG acf5c55ae6a94e5ca847e07def40427547876101 # v0.3.2 with cmake system
GIT_TAG 1ad5185cd42c0636104129fcc9f6a4bf9c67cc40 # v0.4.1 with cmake system

PREFIX ${SECP256K1_PREFIX}

Expand Down

0 comments on commit 85ab120

Please sign in to comment.