2012-03-14 03:17:34 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Bsdmake < Formula
|
|
|
|
homepage 'http://opensource.apple.com/'
|
|
|
|
url 'http://opensource.apple.com/tarballs/bsdmake/bsdmake-24.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '9ce3c3fc01e0eb47d82827b1eb227eb371fefd5c'
|
2012-03-14 03:17:34 +00:00
|
|
|
|
2012-07-11 01:25:16 +00:00
|
|
|
if MacOS::Xcode.provides_autotools? or File.file? "/usr/bin/bsdmake"
|
2012-03-14 03:17:34 +00:00
|
|
|
keg_only "Recent versions of OS X no longer provide this tool."
|
|
|
|
end
|
|
|
|
|
|
|
|
def patches
|
|
|
|
# MacPorts patches to make bsdmake play nice with our prefix system
|
2013-10-24 23:59:51 +00:00
|
|
|
# Also a MacPorts patch to circumvent setrlimit error
|
2012-03-14 03:17:34 +00:00
|
|
|
{ :p0 => %W[
|
|
|
|
https://trac.macports.org/export/90868/trunk/dports/devel/bsdmake/files/patch-Makefile.diff
|
|
|
|
https://trac.macports.org/export/90611/trunk/dports/devel/bsdmake/files/patch-mk.diff
|
|
|
|
https://trac.macports.org/export/90611/trunk/dports/devel/bsdmake/files/patch-pathnames.diff
|
2013-10-24 23:59:51 +00:00
|
|
|
https://trac.macports.org/export/105220/trunk/dports/devel/bsdmake/files/patch-setrlimit.diff
|
2012-03-14 03:17:34 +00:00
|
|
|
]}
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
# Replace @PREFIX@ inserted by MacPorts patches
|
|
|
|
# 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
|
2012-09-06 23:06:55 +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],
|
|
|
|
'@PREFIX@', prefix
|
|
|
|
|
|
|
|
inreplace 'mk/bsd.own.mk' do |s|
|
|
|
|
s.gsub! '@INSTALL_USER@', `id -un`.chomp
|
|
|
|
s.gsub! '@INSTALL_GROUP@', `id -gn`.chomp
|
|
|
|
end
|
|
|
|
|
|
|
|
# See GNUMakefile
|
|
|
|
ENV.append 'CFLAGS', '-D__FBSDID=__RCSID'
|
|
|
|
ENV.append 'CFLAGS', '-mdynamic-no-pic'
|
|
|
|
|
|
|
|
system "make", "-f", "Makefile.dist"
|
|
|
|
bin.install 'pmake' => 'bsdmake'
|
|
|
|
man1.install 'make.1' => 'bsdmake.1'
|
|
|
|
(share/'mk/bsdmake').install Dir['mk/*']
|
|
|
|
end
|
|
|
|
end
|