From a200fc91e47b87967c6ea631474108d286374726 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 6 Jan 2019 18:16:08 +0000 Subject: [PATCH 1/3] cctools-headers: delete. --- Formula/cctools-headers.rb | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 Formula/cctools-headers.rb diff --git a/Formula/cctools-headers.rb b/Formula/cctools-headers.rb deleted file mode 100644 index e3b7affff7350..0000000000000 --- a/Formula/cctools-headers.rb +++ /dev/null @@ -1,35 +0,0 @@ -# The system versions are too old to build ld64 -class CctoolsHeaders < Formula - desc "cctools headers via Apple" - homepage "https://opensource.apple.com/" - url "https://opensource.apple.com/tarballs/cctools/cctools-855.tar.gz" - sha256 "751748ddf32c8ea84c175f32792721fa44424dad6acbf163f84f41e9617dbc58" - - bottle do - cellar :any_skip_relocation - sha256 "aad0aa77b9dfdfa2b0f45a83f67cdd21f819f08890e744f686088950c5fc0ea5" => :mojave - sha256 "867d6edac7d3c9e0ebdec8cb97e4ec8e2e32a1cb894cc2f5d73e282e1fc1ed03" => :high_sierra - sha256 "b30ece09a0ea68969de159ea1004f8bf7b764e0d1930acb199331c915494c8a7" => :sierra - sha256 "ca835a4d93f50715875bc1ab323630f788e64a0573ac994a7e5d60c9b064268d" => :el_capitan - sha256 "a8ada963317cade3c7ed5df84fdcd3251a8b31a0bb4835a78ae4375ee0624b4e" => :yosemite - sha256 "ac7f685067262f3b1c4f843cab7ed4c83fc58a63bb57a8c5416428db0d6c7ddd" => :mavericks - end - - keg_only :provided_by_macos - - resource "headers" do - url "https://opensource.apple.com/tarballs/xnu/xnu-2422.90.20.tar.gz" - sha256 "7bf3c6bc2f10b99e57b996631a7747b79d1e1684df719196db1e5c98a5585c23" - end - - def install - # only supports DSTROOT, not PREFIX - inreplace "include/Makefile", "/usr/include", "/include" - system "make", "installhdrs", "DSTROOT=#{prefix}", "RC_ProjectSourceVersion=#{version}" - # installs some headers we don't need to DSTROOT/usr/local/include - (prefix/"usr").rmtree - - # ld64 requires an updated mach/machine.h to build - resource("headers").stage { (include/"mach").install "osfmk/mach/machine.h" } - end -end From 59b17437bfc94a6a444ae00e2b45ecbe7417bacb Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 6 Jan 2019 18:16:09 +0000 Subject: [PATCH 2/3] cctools: delete. --- Formula/cctools.rb | 148 --------------------------------------------- 1 file changed, 148 deletions(-) delete mode 100644 Formula/cctools.rb diff --git a/Formula/cctools.rb b/Formula/cctools.rb deleted file mode 100644 index c1df85d3208b6..0000000000000 --- a/Formula/cctools.rb +++ /dev/null @@ -1,148 +0,0 @@ -class Cctools < Formula - desc "Binary and cross-compilation tools for Apple" - homepage "https://opensource.apple.com/" - - if MacOS.version >= :snow_leopard - url "https://opensource.apple.com/tarballs/cctools/cctools-855.tar.gz" - sha256 "751748ddf32c8ea84c175f32792721fa44424dad6acbf163f84f41e9617dbc58" - else - # 806 (from Xcode 4.1) is the latest version that supports Tiger or PowerPC - url "https://opensource.apple.com/tarballs/cctools/cctools-806.tar.gz" - sha256 "6116c06920112c634f6df2fa8b2f171ee3b90ff2176137da5856336695a6a676" - end - - bottle do - cellar :any_skip_relocation - sha256 "beeea379ed8afea75236ad267e8ab83fc9c4cc44cae96b75497afc49d6dcc1af" => :mojave - sha256 "884da525162c316ea2375417148d696f3db9c0995d54b9caf089c634f46c8424" => :high_sierra - sha256 "d1cdbb626ef536c6e25884eafe2bdfb8e2c4d4011e4e37eea9c69b834c55cfe4" => :sierra - sha256 "398333f85c3944de889172ca9d3aa5ffd709403ca2225316f130be817f09873a" => :el_capitan - sha256 "a76a710f5f164feace5ad107eb40bf5e6a25e916f7334e69ee197a8e3d02b90c" => :yosemite - sha256 "3b0c895c6f0832ef9509720ebc15478e188ea6396ba41729273eb64d7b2f7ec2" => :mavericks - sha256 "f9f74d98119d2efd5530f8d98eb7838a77be35576880ecec73fe9d535aa2afb0" => :mountain_lion - end - - keg_only :provided_by_macos, "this package duplicates tools shipped by Xcode" - - depends_on :ld64 - - cxxstdlib_check :skip - - if MacOS.version >= :snow_leopard - # These patches apply to cctools 855, for newer OSes - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/cctools-829-lto.patch" - sha256 "8ed90e0eef2a3afc810b375f9d3873d1376e16b17f603466508793647939a868" - end - - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/PR-37520.patch" - sha256 "921cba3546389809500449b08f4275cfd639295ace28661c4f06174b455bf3d4" - end - - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/cctools-839-static-dis_info.patch" - sha256 "f49162b5c5d2753cf19923ff09e90949f01379f8de5604e86c59f67441a1214c" - end - - # Fix building libtool with LTO disabled - patch do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/libtool-no-lto.diff" - sha256 "3b687f2b9388ac6c4acac2b7ba28d9fd07f2a16e7d2dad09aa2255d98ec1632b" - end - - # strnlen patch only needed on Snow Leopard - if MacOS.version == :snow_leopard - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/snowleopard-strnlen.patch" - sha256 "b118f94411ad194596102f230abafa2f20262343ab36f2a578c6bdc1ae83ae12" - end - end - else - depends_on "cctools-headers" => :build - - # This set of patches only applies to cctools 806, for older OSes - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/cctools-806-lto.patch" - sha256 "a92f38f0c34749b0988d4bfec77dec3ce3fc27d50a2cf9f3aaffa4277386470c" - end - - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/PR-9087924.patch" - sha256 "6020933a25196660c2eb09d06f2cc4c2b5d67158fd2d99c221a17b63111ff391" - end - - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/PR-9830754.patch" - sha256 "092e2762328477227f9589adf14c14945ebe6f266567deef16754ccc2ecb352d" - end - - # Despite the patch name this is needed on 806 too - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/cctools-822-no-lto.patch" - sha256 "535fe18d8842b03d23b0be057905f4f685d63b9c6436227b623b7aecd8e6ea83" - end - - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/PR-11136237.patch" - sha256 "a19685c8870bdf270ed0fb8240985d87556be07eef14920ea782e2f5ec076759" - end - - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/db27850/cctools/PR-12475288.patch" - sha256 "2883e782094e05cbe5bc5a9f672aa775bc23ca0c77d2ecaa931be8b39e3525cb" - end - end - - def install - ENV.deparallelize # see https://github.com/mistydemeo/tigerbrew/issues/102 - - args = %W[ - RC_ProjectSourceVersion=#{version} - USE_DEPENDENCY_FILE=NO - BUILD_DYLIBS=NO - CC=#{ENV.cc} - CXX=#{ENV.cxx} - LTO= - RC_CFLAGS=#{ENV.cflags} - TRIE= - RC_OS="macos" - DSTROOT=#{prefix} - ] - - # Fixes build with gcc-4.2: https://trac.macports.org/ticket/43745 - args << "SDK=-std=gnu99" - - args << "RC_ARCHS=i386 x86_64" - - system "make", "install_tools", *args - - # cctools installs into a /-style prefix in the supplied DSTROOT, - # so need to move the files into the standard paths. - # Also merge the /usr and /usr/local trees. - man.install Dir["#{prefix}/usr/local/man/*"] - prefix.install Dir["#{prefix}/usr/local/*"] - bin.install Dir["#{prefix}/usr/bin/*"] - (include/"mach-o").install Dir["#{prefix}/usr/include/mach-o/*"] - man1.install Dir["#{prefix}/usr/share/man/man1/*"] - man3.install Dir["#{prefix}/usr/share/man/man3/*"] - man5.install Dir["#{prefix}/usr/share/man/man5/*"] - - # These install locations changed between 806 and 855 - if MacOS.version >= :snow_leopard - (libexec/"as").install Dir["#{prefix}/usr/libexec/as/*"] - else - (libexec/"gcc/darwin").install Dir["#{prefix}/usr/libexec/gcc/darwin/*"] - share.install Dir["#{prefix}/usr/share/gprof.*"] - end - end - - def caveats; <<~EOS - cctools's version of ld was not built. - EOS - end - - test do - assert_match "/usr/lib/libSystem.B.dylib", shell_output("#{bin}/otool -L #{bin}/install_name_tool") - end -end From 3b42af5b9f096592b60ea2b98be2b1cfd185687c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 6 Jan 2019 18:16:09 +0000 Subject: [PATCH 3/3] ld64: delete. --- Formula/ld64.rb | 73 ------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 Formula/ld64.rb diff --git a/Formula/ld64.rb b/Formula/ld64.rb deleted file mode 100644 index d2ab16974a962..0000000000000 --- a/Formula/ld64.rb +++ /dev/null @@ -1,73 +0,0 @@ -class Ld64 < Formula - desc "Updated version of the ld shipped by Apple" - homepage "https://opensource.apple.com/" - # Latest is 134.9, but it no longer supports building for PPC. - # 127.2 won't build on Tiger, at least without some patching. - # Leopard users: if you like, add a 127.2 option or fix the build - # on Tiger. - url "https://opensource.apple.com/tarballs/ld64/ld64-97.17.tar.gz" - sha256 "02bd46af0809eaa415d096d7d41c3e8e7d80f7d8d181840866fb87f036b4e089" - - bottle do - sha256 "8a0d5cdd74392a9c3b35b5ac46825e3bab03480ec6af828280322916862eb872" => :snow_leopard - sha256 "e8da7e6c25c4966420cb0aaf2b2b144f769b8e974365e102c7afa9b3bda70488" => :leopard - end - - keg_only :provided_by_macos, - "ld64 is an updated version of the ld shipped by Apple" - - # Tiger either includes old versions of these headers, - # or doesn't ship them at all - depends_on "cctools-headers" => :build - depends_on "dyld-headers" => :build - depends_on "libunwind-headers" => :build - depends_on :maximum_macos => :snow_leopard - depends_on "openssl" - - resource "makefile" do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/3b073fca/ld64/Makefile-97" - sha256 "48e3475bd73f9501d17b7d334d3bf319f5664f2d5ab9d13378e37c2519ae2a3a" - end - - # Fixes logic on PPC branch islands - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/3b073fca/ld64/ld64-97-ppc-branch-island.patch" - sha256 "a6bbf25c6e4fa348eee3d4756ad65f42ba42b78922dc0f75669023cdf9c25d72" - end - - # Remove LTO support - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/3b073fca/ld64/ld64-97-no-LTO.patch" - sha256 "2596cc25118981cbc31e82ddcb70508057f1946c46c3d6d6845ab7bd01ff1433" - end - - # Fix version number - patch :p0 do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/3b073fca/ld64/ld64-version.patch" - sha256 "3753b6877641648017eab2bb391361840fe887a2b3eb2e5ef689272a28c374fc" - end - - def install - buildpath.install resource("makefile") - mv "Makefile-97", "Makefile" - inreplace "src/ld/Options.cpp", "@@VERSION@@", version - - args = %W[ - CC=#{ENV.cc} - CXX=#{ENV.cxx} - OTHER_CPPFLAGS=#{ENV.cppflags} - OTHER_LDFLAGS=#{ENV.ldflags} - ] - - args << 'RC_SUPPORTED_ARCHS="armv6 armv7 i386 x86_64"' if MacOS.version >= :lion - - # Macports makefile hardcodes optimization - inreplace "Makefile" do |s| - s.change_make_var! "CFLAGS", ENV.cflags - s.change_make_var! "CXXFLAGS", ENV.cxxflags - end - - system "make", *args - system "make", "install", "PREFIX=#{prefix}" - end -end