2014-05-19 02:28:38 +00:00
|
|
|
require "formula"
|
2012-03-14 03:17:34 +00:00
|
|
|
|
|
|
|
class Bsdmake < Formula
|
2014-05-19 02:28:38 +00:00
|
|
|
homepage "http://opensource.apple.com/"
|
|
|
|
url "http://opensource.apple.com/tarballs/bsdmake/bsdmake-24.tar.gz"
|
|
|
|
sha1 "9ce3c3fc01e0eb47d82827b1eb227eb371fefd5c"
|
2012-03-14 03:17:34 +00:00
|
|
|
|
2014-06-09 12:47:29 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "79030aa9845b6d38597687450fe2e816096ded78" => :mavericks
|
|
|
|
sha1 "ec9167226d71cb85d097b4a9c2770cf98a5465e1" => :mountain_lion
|
|
|
|
sha1 "517532eb240860be38ef6c6523aae550e2be5ca6" => :lion
|
|
|
|
end
|
|
|
|
|
2014-04-03 14:11:51 +00:00
|
|
|
keg_only :provided_until_xcode43
|
2012-03-14 03:17:34 +00:00
|
|
|
|
2014-03-14 14:43:37 +00:00
|
|
|
# MacPorts patches to make bsdmake play nice with our prefix system
|
|
|
|
# Also a MacPorts patch to circumvent setrlimit error
|
|
|
|
patch :p0 do
|
|
|
|
url "https://trac.macports.org/export/90868/trunk/dports/devel/bsdmake/files/patch-Makefile.diff"
|
|
|
|
sha1 "d09ea3742fd2cff97bf28510b585751b47ecd067"
|
|
|
|
end
|
|
|
|
|
|
|
|
patch :p0 do
|
|
|
|
url "https://trac.macports.org/export/90611/trunk/dports/devel/bsdmake/files/patch-mk.diff"
|
|
|
|
sha1 "cf3ea9a27e225bdb28573222acf7f0db533cf8b7"
|
|
|
|
end
|
|
|
|
|
|
|
|
patch :p0 do
|
|
|
|
url "https://trac.macports.org/export/90611/trunk/dports/devel/bsdmake/files/patch-pathnames.diff"
|
|
|
|
sha1 "0797e402973aeccae41a82f5a9e444739948edc8"
|
|
|
|
end
|
|
|
|
|
|
|
|
patch :p0 do
|
|
|
|
url "https://trac.macports.org/export/105220/trunk/dports/devel/bsdmake/files/patch-setrlimit.diff"
|
|
|
|
sha1 "c3fb48eb24e01aef2bba7e528442330c1af4a2ce"
|
2012-03-14 03:17:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
# Replace @PREFIX@ inserted by MacPorts patches
|
2014-05-19 02:28:38 +00:00
|
|
|
# Use "prefix" since this is sometimes a keg-only brew
|
2012-08-09 07:05:04 +00:00
|
|
|
# But first replace the X11 path if X11 is installed
|
2014-05-19 02:28:38 +00:00
|
|
|
inreplace "mk/sys.mk", "@PREFIX@", MacOS::X11.prefix || prefix
|
2012-03-14 03:17:34 +00:00
|
|
|
inreplace %W[mk/bsd.README
|
|
|
|
mk/bsd.cpu.mk
|
|
|
|
mk/bsd.doc.mk
|
|
|
|
mk/bsd.obj.mk
|
|
|
|
mk/bsd.own.mk
|
|
|
|
mk/bsd.port.mk
|
|
|
|
mk/bsd.port.subdir.mk
|
|
|
|
pathnames.h],
|
2014-05-19 02:28:38 +00:00
|
|
|
"@PREFIX@", prefix
|
2012-03-14 03:17:34 +00:00
|
|
|
|
2014-05-19 02:28:38 +00:00
|
|
|
inreplace "mk/bsd.own.mk" do |s|
|
|
|
|
s.gsub! "@INSTALL_USER@", `id -un`.chomp
|
|
|
|
s.gsub! "@INSTALL_GROUP@", `id -gn`.chomp
|
2012-03-14 03:17:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# See GNUMakefile
|
2014-05-19 02:28:38 +00:00
|
|
|
ENV.append "CFLAGS", "-D__FBSDID=__RCSID"
|
|
|
|
ENV.append "CFLAGS", "-mdynamic-no-pic"
|
2012-03-14 03:17:34 +00:00
|
|
|
|
|
|
|
system "make", "-f", "Makefile.dist"
|
2014-05-19 02:28:38 +00:00
|
|
|
bin.install "pmake" => "bsdmake"
|
|
|
|
man1.install "make.1" => "bsdmake.1"
|
|
|
|
(share/"mk/bsdmake").install Dir["mk/*"]
|
2012-03-14 03:17:34 +00:00
|
|
|
end
|
|
|
|
end
|