This article is compiled and released by WeChaT: kaifa873, which is only for reference of project development requirements! telegram @ sleu88
def install
#ENV.deparallelize#if your formula fails when building in parallel
#Remove unrecognized options if warned by configure
system"./configure","--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
#system"cmake",".",*std_cmake_args
system"make","install"#if this fails,try separate make/make install steps
end
system后面是需要执行的安装命令,这个根据实际软件编译过程进行修改。
因为bytom是已经编译好的二进制软件包,所以实际的文件进行修改如下:
class Bytom<Formula
desc"Official Go implementation of the Bytom protocol"
homepage"https://bytom.io/"
url"https://github.com/Bytom/bytom/releases/download/v1.0.7/bytom-1.0.7-darwin_amd64.tgz"
version"1.0.7"
sha256"25dd62343157fe6eb7a983edb1455f457cfca07552f02e1f9142227bd961a4a5"
def install
system'mv bytomd-darwin_amd64 bytomd'
system'mv bytomcli-darwin_amd64 bytomcli'
bin.install"bytomd"
bin.install"bytomcli"
end
test do
#test dowill create,run in and delete a temporary directory.
#
#This test will fail and we won't accept that!For Homebrew/homebrew-core
#this will need to be a test that verifies the functionality of the
#software.Run the test withbrew test bytom.Options passed
#tobrew installsuch as--HEADalso need to be provided tobrew test.
#
#The installed folder is not in the path,so use the entire path to any
#executables being tested:system"#{bin}/program","do","something".
system"false"
end
end