ruby Homebrew的tsunami-udp

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby Homebrew的tsunami-udp相关的知识,希望对你有一定的参考价值。

require "formula"

class TsunamiUdp < Formula
  homepage "http://tsunami-udp.sourceforge.net/"
  url "http://superb-dca2.dl.sourceforge.net/project/tsunami-udp/tsunami-udp/tsunami-v1.1-cvsbuild42/tsunami-v1.1-cvsbuild42.tar.gz"
  sha1 "e16ae011ad2e953e493c916da4b51a4cdc3425e2"

  depends_on "autoconf" => :build
  depends_on "automake" => :build

  def install
  # clang doesn't support inline
    inreplace "client/command.c",
      "inline int got_block(ttp_session_t* session, u_int32_t blocknr)",
      "int got_block(ttp_session_t* session, u_int32_t blocknr)"

    inreplace "include/tsunami-client.h",
      "inline int     got_block             (ttp_session_t* session, u_int32_t blocknr);",
      "int     got_block             (ttp_session_t* session, u_int32_t blocknr);"

    system "autoreconf", "-fvi"
    system "./configure", "--prefix=#{prefix}", "CC=#{ENV.cc}"
    system "make"

    bin.install "client/tsunami",
                "server/tsunamid",
                "rtclient/rttsunami",
                "rtserver/rttsunamid"

    include.install "include/md5.h",
                    "include/tsunami.h"

    system "ranlib", "common/libtsunami_common.a"
    lib.install "common/libtsunami_common.a"

    prefix.install "USAGE.txt"
  end

  def caveats; <<-EOS.undent
    Usage reference: /usr/local/opt/tsunami-udp/USAGE.txt
    EOS
  end
end

以上是关于ruby Homebrew的tsunami-udp的主要内容,如果未能解决你的问题,请参考以下文章

ruby HomeBrew修复

ruby Homebrew中的zlog

ruby nyancat_homebrew_formula

ruby pycdc_homebrew_formula

ruby J2OBJC FORMULA(HOMEBREW)

ruby libsvm for homebrew with python bindings