Skip to content

Commit

Permalink
secp256k1: add 0.2.0 bottle.
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgit committed Jan 17, 2023
1 parent ce7e91c commit 6785dd3
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Formula/secp256k1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
class Secp256k1 < Formula
desc "Optimized C library for EC operations on curve secp256k1"
homepage "https://github.com/bitcoin-core/secp256k1"
url "https://github.com/bitcoin-core/secp256k1/archive/refs/tags/v0.2.0.tar.gz"
sha256 "6cb0fd596e6b1a671f96e9ed7e65a047960def73de024e7b39f45a78ab4fc8df"
license "MIT"

bottle do
root_url "https://github.com/gromgit/homebrew-core-mojave/releases/download/secp256k1"
sha256 cellar: :any, mojave: "821b26fb610770b0ffec28cf51866976a215cc76f82064159d4a629d9c332845"
end

depends_on "autoconf" => [:build]
depends_on "automake" => [:build]
depends_on "libtool" => [:build]

def install
system "./autogen.sh"
system "./configure", *std_configure_args, "--disable-silent-rules"
system "make"
system "make", "install"
end

test do
(testpath/"test.c").write <<~EOS
#include <secp256k1.h>
int main() {
secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
secp256k1_context_destroy(ctx);
return 0;
}
EOS
system ENV.cc, "test.c",
"-L#{lib}", "-lsecp256k1",
"-o", "test"
system "./test"
end
end

0 comments on commit 6785dd3

Please sign in to comment.