Skip to content

Instantly share code, notes, and snippets.

@dahlia
Forked from shazow/secp256k1.rb
Last active October 24, 2018 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dahlia/439e1a7e5a770556a12b25aea797eda7 to your computer and use it in GitHub Desktop.
Save dahlia/439e1a7e5a770556a12b25aea797eda7 to your computer and use it in GitHub Desktop.
Homebrew recipe for secp256k; originated from https://gist.github.com/shazow/c71c652409015479a7e6, but added some more build options; run to install: brew install --with-module-recovery --with-module-ecdh --without-benchmark https://gist.github.com/dahlia/439e1a7e5a770556a12b25aea797eda7/raw/secp256k1.rb
class Secp256k1 < Formula
desc "Optimized C library for EC operations on curve secp256k1"
homepage "https://github.com/bitcoin/secp256k1"
url "https://github.com/bitcoin/secp256k1.git"
option "with-module-recovery", "enable ECDSA pubkey recovery module"
option "with-module-ecdh",
"enable ECDH shared secret computation (experimental)"
option "without-benchmark", "do not compile benchmark"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--disable-silent-rules
--enable-shared
--enable-static
]
args << "--enable-module-recovery" if build.with? "module-recovery"
args << "--enable-experimental" << "--enable-module-ecdh" if build.with? "module-ecdh"
args << "--enable-benchmark=no" if build.without? "benchmark"
system "./autogen.sh"
system "./configure", *args
system "make", "install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment