Skip to content

Instantly share code, notes, and snippets.

@libotony
Last active May 13, 2019 02:39
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 libotony/9edb35c731ff02cc722a71ac7b7a1cf8 to your computer and use it in GitHub Desktop.
Save libotony/9edb35c731ff02cc722a71ac7b7a1cf8 to your computer and use it in GitHub Desktop.
Install Solidity@0.4.x on Mac by HomeBrew
  • Create a file solidity@4.rb
  • Run brew install ./solidity@4.rb

If you would like to find other versions of solidity, go to the homebrew-ethereum, find the version you need to install, replace the version and sha256in the file, then install.

#------------------------------------------------------------------------------
# solidity.rb
#
# Homebrew formula for solidity. Homebrew (http://brew.sh/) is
# the de-facto standard package manager for OS X, and this Ruby script
# contains the metadata used to map command-line user settings used
# with the 'brew' command onto build options.
#
# Our documentation for the solidity Homebrew setup is at:
#
# http://solidity.readthedocs.io/en/latest/installing-solidity.html
#
# (c) 2014-2017 solidity contributors.
#------------------------------------------------------------------------------
class SolidityAT4 < Formula
desc "The Solidity Contract-Oriented Programming Language"
homepage "http://solidity.readthedocs.org"
url "https://github.com/ethereum/solidity/releases/download/v0.4.24/solidity_0.4.24.tar.gz"
version "0.4.24"
sha256 "b6828266d9b108a035f44127a6107c9fbc516018b0fcf5de370196306cddb2a8"
depends_on "cmake" => :build
depends_on "boost@1.60" => "c++11"
# Note: due to a homebrew limitation, ccache will always be detected and cannot be turned off.
depends_on "ccache" => :build
depends_on "z3"
def install
system "cmake", ".", *std_cmake_args, "-DTESTS=OFF"
system "make", "install"
end
test do
system "#{bin}/solc", "--version"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment