From 6f46c413ace5d2e7d6dc89018912f843175e716e Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sun, 26 Feb 2017 01:33:15 +0100 Subject: [PATCH] openssl@1.1: drop universal --- Formula/openssl@1.1.rb | 74 ++++-------------------------------------- 1 file changed, 7 insertions(+), 67 deletions(-) diff --git a/Formula/openssl@1.1.rb b/Formula/openssl@1.1.rb index 3cb132bc58e1f..3199848db1eab 100644 --- a/Formula/openssl@1.1.rb +++ b/Formula/openssl@1.1.rb @@ -14,7 +14,6 @@ class OpensslAT11 < Formula keg_only :versioned_formula - option :universal option "without-test", "Skip build-time tests (not recommended)" # Only needs 5.10 to run, but needs >5.13.4 to run the testsuite. @@ -26,13 +25,6 @@ class OpensslAT11 < Formula depends_on :perl => "5.10" end - def arch_args - { - :x86_64 => %w[darwin64-x86_64-cc enable-ec_nistp_64_gcc_128], - :i386 => %w[darwin-i386-cc], - } - end - # SSLv2 died with 1.1.0, so no-ssl2 no longer required. # SSLv3 & zlib are off by default with 1.1.0 but this may not # be obvious to everyone, so explicitly state it for now to @@ -57,69 +49,17 @@ def install ENV["PERL"] = Formula["perl"].opt_bin/"perl" end - if build.universal? - ENV.permit_arch_flags - archs = Hardware::CPU.universal_archs - elsif MacOS.prefer_64_bit? - archs = [Hardware::CPU.arch_64_bit] + if MacOS.prefer_64_bit? + arch_args = %w[darwin64-x86_64-cc enable-ec_nistp_64_gcc_128] else - archs = [Hardware::CPU.arch_32_bit] - end - - dirs = [] - - archs.each do |arch| - if build.universal? - dir = "build-#{arch}" - dirs << dir - mkdir dir - mkdir "#{dir}/engines" - end - - ENV.deparallelize - system "perl", "./Configure", *(configure_args + arch_args[arch]) - system "make", "clean" if build.universal? - system "make" - system "make", "test" if build.with?("test") - - next unless build.universal? - cp "include/openssl/opensslconf.h", dir - cp Dir["*.?.?.dylib", "*.a", "apps/openssl"], dir - cp Dir["engines/**/*.dylib"], "#{dir}/engines" + arch_args = %w[darwin-i386-cc] end + ENV.deparallelize + system "perl", "./Configure", *(configure_args + arch_args) + system "make" + system "make", "test" if build.with?("test") system "make", "install", "MANDIR=#{man}", "MANSUFFIX=ssl" - - if build.universal? - %w[libcrypto libssl].each do |libname| - system "lipo", "-create", "#{dirs.first}/#{libname}.1.1.dylib", - "#{dirs.last}/#{libname}.1.1.dylib", - "-output", "#{lib}/#{libname}.1.1.dylib" - system "lipo", "-create", "#{dirs.first}/#{libname}.a", - "#{dirs.last}/#{libname}.a", - "-output", "#{lib}/#{libname}.a" - end - - Dir.glob("#{dirs.first}/engines/*.dylib") do |engine| - libname = File.basename(engine) - system "lipo", "-create", "#{dirs.first}/engines/#{libname}", - "#{dirs.last}/engines/#{libname}", - "-output", "#{lib}/engines-1.1/#{libname}" - end - - system "lipo", "-create", "#{dirs.first}/openssl", - "#{dirs.last}/openssl", - "-output", "#{bin}/openssl" - - confs = archs.map do |arch| - <<-EOS.undent - #ifdef __#{arch}__ - #{(buildpath/"build-#{arch}/opensslconf.h").read} - #endif - EOS - end - (include/"openssl/opensslconf.h").atomic_write confs.join("\n") - end end def openssldir