From aab25c1ec6d0b1ea3cc222f284abc60d817c0930 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 31 Dec 2013 14:31:45 -0600 Subject: tcpreplay: backport strlcpy fixes Fixes #24572. Closes #25404. --- Library/Formula/tcpreplay.rb | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Formula/tcpreplay.rb b/Library/Formula/tcpreplay.rb index de3bf7ffd..1f253c840 100644 --- a/Library/Formula/tcpreplay.rb +++ b/Library/Formula/tcpreplay.rb @@ -5,10 +5,28 @@ class Tcpreplay < Formula url 'http://downloads.sourceforge.net/project/tcpreplay/tcpreplay/3.4.4/tcpreplay-3.4.4.tar.gz' sha1 '9e4cca81cfbfb919f8759e1a27ce1b3b963ff3b8' - # Hard-code use of dylib instead of so - def patches; DATA; end + def patches + [ + # Hard-code use of dylib instead of so + DATA, + # Use system strlcpy; fixed upstream + "https://github.com/synfinatic/tcpreplay/commit/6f45329ba7e6300f07f253032e6feb8a650bea23.patch", + "https://github.com/synfinatic/tcpreplay/commit/0983f589a21bbd0d248e9b408bdf5aeacb61ce19.patch", + ] + end def install + # Don't attempt to compile strlcpy; fixed upstream + inreplace "lib/Makefile.in" do |s| + s.remove_make_var! "libstrl_a_SOURCES" + s.remove_make_var! "noinst_LIBRARIES" + end + + inreplace "src/common/Makefile.in" do |s| + s.gsub! "libcommon_a_LIBADD = ../../lib/libstrl.a", "" + s.gsub! "libcommon_a_DEPENDENCIES = ../../lib/libstrl.a", "" + end + system "./configure", "--disable-dependency-tracking", "--disable-debug", "--prefix=#{prefix}", "--enable-dynamic-link" -- cgit v1.2.3