Author SHA1 Message Date
Misty De Meo 8efe2d0f8b Import openssh from homebrew-core 2017-05-08 21:45:44 -07:00
77 changed files with 669 additions and 3863 deletions

No files matched your search

+1 -1
View File
@@ -157,7 +157,7 @@ class Cmd
"-fuse-linker-plugin"
# clang doesn't support these flags
args << arg unless tool =~ /^clang/
when "-Wno-deprecated-register", "-Wno-implicit-fallthrough"
when "-Wno-deprecated-register"
# older gccs don't support these flags
args << arg unless tool =~ /^g..-4.[02]/
when /^-W[alp],/, /^-Wno-/
+2 -2
View File
@@ -1,7 +1,7 @@
class Alpine < Formula
desc "News and email agent"
homepage "http://alpine.freeiz.com/alpine/"
url "http://alpine.freeiz.com/alpine/release/src/alpine-2.20.tar.xz"
homepage "http://patches.freeiz.com/alpine/"
url "http://patches.freeiz.com/alpine/release/src/alpine-2.20.tar.xz"
sha256 "ed639b6e5bb97e6b0645c85262ca6a784316195d461ce8d8411999bf80449227"
bottle do
+1 -2
View File
@@ -12,8 +12,7 @@ end
class AppleGcc42 < Formula
homepage 'http://r.research.att.com/tools/'
url 'https://ia902307.us.archive.org/31/items/tigerbrew/gcc-42-5553-darwin8-all.tar.gz'
mirror 'http://r.research.att.com/gcc-42-5553-darwin8-all.tar.gz'
url 'http://r.research.att.com/gcc-42-5553-darwin8-all.tar.gz'
version '4.2.1-5553'
sha1 '0e529a2e4723e016e3d086d6ca3215d700931503'
-30
View File
@@ -1,30 +0,0 @@
class CloogPpl015 < Formula
homepage "http://repo.or.cz/w/cloog-ppl.git"
url "ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-ppl-0.15.11.tar.gz"
mirror "http://gcc.cybermirror.org/infrastructure/cloog-ppl-0.15.11.tar.gz"
sha256 "7cd634d0b2b401b04096b545915ac67f883556e9a524e8e803a6bf6217a84d5f"
bottle do
cellar :any
sha256 "e80958bc126358051c2c40ba8b12aae5fa2e55a086dd103241f7469a6812df29" => :yosemite
sha256 "e18498773771e61e533c1521212ad4f2be43f62b5c00478c89fc52934850450f" => :mavericks
sha256 "ff20e10aa53c2650de8f008d8b6cd803ed1960e6d88282574c2217700ba0a81f" => :mountain_lion
end
keg_only "Conflicts with cloog in main repository."
depends_on "gmp4"
depends_on "ppl011"
def install
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--with-gmp=#{Formula["gmp4"].opt_prefix}"
--with-ppl=#{Formula["ppl011"].opt_prefix}"
]
system "./configure", *args
system "make", "install"
end
end
-52
View File
@@ -1,52 +0,0 @@
class Cloog018 < Formula
desc "Generate code for scanning Z-polyhedra"
homepage "http://www.cloog.org/"
# Track gcc infrastructure releases.
url "http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-0.18.0.tar.gz"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.0.tar.gz"
sha256 "1c4aa8dde7886be9cbe0f9069c334843b21028f61d344a2d685f88cb1dcf2228"
bottle do
cellar :any
revision 1
sha256 "95b8d981633d853151cae2efa07bcf6655e5af04dad88418087fc614de8f160d" => :el_capitan
sha256 "5befa09d6f42cebefe5085959a9d7267158bd9eb7a1d7d0a95c122c5377ccaa9" => :yosemite
sha256 "b64ee12cd97286090e012e25882119b82ce4dc9b8dbaacf7ac17f7570f327cfa" => :mavericks
end
keg_only "Conflicts with cloog in main repository."
depends_on "pkg-config" => :build
depends_on "gmp4"
depends_on "isl011"
def install
system "./configure", "--prefix=#{prefix}",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--with-gmp-prefix=#{Formula["gmp4"].opt_prefix}",
"--with-isl-prefix=#{Formula["isl011"].opt_prefix}"
system "make", "install"
end
test do
cloog_source = <<-EOS.undent
c
0 2
0
1
1
0 2
0 0 0
0
0
EOS
assert_match "Generated from /dev/stdin by CLooG",
pipe_output("#{bin}/cloog /dev/stdin", cloog_source)
end
end
+26 -28
View File
@@ -1,19 +1,23 @@
class Coreutils < Formula
desc "GNU File, Shell, and Text utilities"
homepage "https://www.gnu.org/software/coreutils"
url "https://ftp.gnu.org/gnu/coreutils/coreutils-8.30.tar.xz"
mirror "https://ftpmirror.gnu.org/coreutils/coreutils-8.30.tar.xz"
sha256 "e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057"
url "https://ftpmirror.gnu.org/coreutils/coreutils-8.25.tar.xz"
mirror "https://ftp.gnu.org/gnu/coreutils/coreutils-8.25.tar.xz"
sha256 "31e67c057a5b32a582f26408c789e11c2e8d676593324849dcf5779296cdce87"
bottle do
sha256 "45157fb067a46c953bdfcba90de688903b7b3c8fcb39afa1e0b2fef2819eedc5" => :mojave
sha256 "77b09dbe66f3d5098998da6babf953e01e828742b8a740a831cc3f3a1f713df7" => :high_sierra
sha256 "94844581b7e08ae2d1dc6c77acfd6e95021283cc8b7c1228fed32a423ae826cc" => :sierra
sha256 "a5145f88de2525d168ef998f8310d5c0abcead9efee9108fb61c30de91a4869c" => :el_capitan
sha256 "1714a4893ba37f9fb1a908e5bd79e45594034daa3ff08d8273713030498d5c1b" => :sierra
sha256 "3b278ce91252784e43d2f16fc813e72a7bd04e637627bf2916c9f847ef600d89" => :el_capitan
sha256 "dadb2d672a6b412d03b2470459d0ccb229bf7aa1c587b04809e7f19a439a640e" => :yosemite
sha256 "1b68974d496006908a2f538a6a7e35b3bee7eba2247afec4e1568b28d0d83c5c" => :mavericks
end
conflicts_with "ganglia", :because => "both install `gstat` binaries"
conflicts_with "idutils", :because => "both install `gid` and `gid.1`"
conflicts_with "aardvark_shell_utils", :because => "both install `realpath` binaries"
head do
url "https://git.savannah.gnu.org/git/coreutils.git"
url "git://git.sv.gnu.org/coreutils"
depends_on "autoconf" => :build
depends_on "automake" => :build
@@ -26,28 +30,18 @@ class Coreutils < Formula
depends_on "gmp" => :optional
conflicts_with "ganglia", :because => "both install `gstat` binaries"
conflicts_with "gegl", :because => "both install `gcut` binaries"
conflicts_with "idutils", :because => "both install `gid` and `gid.1`"
conflicts_with "aardvark_shell_utils", :because => "both install `realpath` binaries"
def install
# Work around unremovable, nested dirs bug that affects lots of
# GNU projects. See:
# https://github.com/Homebrew/homebrew/issues/45273
# https://github.com/Homebrew/homebrew/issues/44993
# This is thought to be an el_capitan bug:
# https://lists.gnu.org/archive/html/bug-tar/2015-10/msg00017.html
if MacOS.version == :el_capitan
# Work around unremovable, nested dirs bug that affects lots of
# GNU projects. See:
# https://github.com/Homebrew/homebrew/issues/45273
# https://github.com/Homebrew/homebrew/issues/44993
# This is thought to be an el_capitan bug:
# https://lists.gnu.org/archive/html/bug-tar/2015-10/msg00017.html
ENV["gl_cv_func_getcwd_abort_bug"] = "no"
# renameatx_np and RENAME_EXCL are available at compile time from Xcode 8
# (10.12 SDK), but the former is not available at runtime.
inreplace "lib/renameat2.c", "defined RENAME_EXCL", "defined UNDEFINED_GIBBERISH"
end
system "./bootstrap" if build.head?
args = %W[
--prefix=#{prefix}
--program-prefix=g
@@ -70,15 +64,20 @@ class Coreutils < Formula
man1.install_symlink "grealpath.1" => "realpath.1"
end
def caveats; <<~EOS
def caveats; <<-EOS.undent
All commands have been installed with the prefix 'g'.
If you really need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
PATH="#{opt_libexec}/gnubin:$PATH"
Additionally, you can access their man pages with normal names if you add
the "gnuman" directory to your MANPATH from your bashrc as well:
MANPATH="#{opt_libexec}/gnuman:$MANPATH"
EOS
EOS
end
def coreutils_filenames(dir)
@@ -93,7 +92,6 @@ class Coreutils < Formula
test do
(testpath/"test").write("test")
(testpath/"test.sha1").write("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 test")
system bin/"gsha1sum", "-c", "test.sha1"
system bin/"gln", "-f", "test", "test.sha1"
system "#{bin}/gsha1sum", "-c", "test.sha1"
end
end
-1
View File
@@ -2,7 +2,6 @@ class CurlCaBundle < Formula
homepage "http://curl.haxx.se/docs/caextract.html"
url "https://curl.haxx.se/ca/cacert-2017-01-18.pem",
:using => :nounzip
mirror "https://ia902307.us.archive.org/31/items/tigerbrew/cacert-2017-01-18.pem"
sha256 "e62a07e61e5870effa81b430e1900778943c228bd7da1259dd6a955ee2262b47"
version "2017-01-18"
-1
View File
@@ -2,7 +2,6 @@ class Curl < Formula
desc "Get a file from an HTTP, HTTPS or FTP server"
homepage "https://curl.haxx.se/"
url "https://curl.haxx.se/download/curl-7.50.3.tar.bz2"
mirror "http://mirror.sobukus.de/files/src/curl/curl-7.50.3.tar.bz2"
sha256 "7b7347d976661d02c84a1f4d6daf40dee377efdc45b9e2c77dedb8acf140d8ec"
bottle do
-9
View File
@@ -27,16 +27,7 @@ class Doxygen < Formula
depends_on "qt" if build.with? "doxywizard"
depends_on "llvm" => "with-clang" if build.with? "libclang"
# /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
fails_with :gcc if MacOS.version == :tiger
def install
# This flag was introduced after GCC 4.2.
# This is necessary on Tiger, since we don't have superenv yet.
if [:gcc, :gcc_4_0].include? ENV.compiler
inreplace "CMakeLists.txt", "-Wno-deprecated-register", ""
end
args = std_cmake_args
args << "-Dbuild_wizard=ON" if build.with? "doxywizard"
args << "-Duse_libclang=ON -DLLVM_CONFIG=#{Formula["llvm"].opt_bin}/llvm-config" if build.with? "libclang"
+2 -2
View File
@@ -1,8 +1,8 @@
class Dpkg < Formula
desc "Debian package management system"
homepage "https://wiki.debian.org/Teams/Dpkg"
url "https://mirrors.kernel.org/debian/pool/main/d/dpkg/dpkg_1.18.24.tar.xz"
mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/d/dpkg/dpkg_1.18.24.tar.xz"
url "https://mirrors.kernel.org/debian/pool/main/d/dpkg/dpkg_1.18.2.tar.xz"
mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/d/dpkg/dpkg_1.18.2.tar.xz"
sha256 "11484f2a73d027d696e720a60380db71978bb5c06cd88fe30c291e069ac457a4"
bottle do
+12 -29
View File
@@ -1,13 +1,13 @@
class Fish < Formula
desc "User-friendly command-line shell for UNIX-like operating systems"
homepage "http://fishshell.com"
url "https://github.com/fish-shell/fish-shell/releases/download/2.7.1/fish-2.7.1.tar.gz"
sha256 "e42bb19c7586356905a58578190be792df960fa81de35effb1ca5a5a981f0c5a"
url "http://fishshell.com/files/2.2.0/fish-2.2.0.tar.gz"
sha256 "a76339fd14ce2ec229283c53e805faac48c3e99d9e3ede9d82c0554acfc7b77a"
bottle do
sha256 "12616d6225eb804b40cdd12ecc8722252a9d28d0275af61f9afc59ef12a55f87" => :tiger_g3
sha256 "0339873032336e84bd169f49b4a9745bcb6ee4e21cfc3cf7a99b05423405498e" => :tiger_altivec
sha256 "6b02140be2753196951031ef7836d1297e752270c3cbda8915c6dae7dd948766" => :tiger_g5
sha256 "1a9a75647ab672132d4ea6b385a09461041f47a91a3719a82494467eaeceab97" => :tiger_altivec
sha256 "e0ba430b35df479e52c0d33b6900cbfe55bf2779e7ab22c3e226db05e53f9410" => :leopard_g3
sha256 "326cea656c8cadf59f2202293334c17d38dfb52ea21388f5fa2b44a6cd8cc46e" => :leopard_altivec
end
head do
@@ -19,42 +19,25 @@ class Fish < Formula
depends_on "libtool" => :build
end
needs :cxx11
depends_on "pcre2"
def install
system "autoreconf", "--no-recursive" if build.head?
# Necessary to get the standard signature of ttyname_r()
ENV.append_to_cflags "-D__DARWIN_UNIX03" if MacOS.version < :leopard
system "autoconf" if build.head?
# In Homebrew's 'superenv' sed's path will be incompatible, so
# the correct path is passed into configure here.
args = %W[
--prefix=#{prefix}
--with-extra-functionsdir=#{HOMEBREW_PREFIX}/share/fish/vendor_functions.d
--with-extra-completionsdir=#{HOMEBREW_PREFIX}/share/fish/vendor_completions.d
--with-extra-confdir=#{HOMEBREW_PREFIX}/share/fish/vendor_conf.d
SED=/usr/bin/sed
]
system "./configure", *args
system "./configure", "--prefix=#{prefix}", "SED=/usr/bin/sed"
system "make", "install"
end
def caveats; <<-EOS.undent
You will need to add:
#{HOMEBREW_PREFIX}/bin/fish
to /etc/shells.
Then run:
to /etc/shells. Run:
chsh -s #{HOMEBREW_PREFIX}/bin/fish
to make fish your default shell.
EOS
end
def post_install
(pkgshare/"vendor_functions.d").mkpath
(pkgshare/"vendor_completions.d").mkpath
(pkgshare/"vendor_conf.d").mkpath
If you are upgrading from an older version of fish, you should now run:
killall fishd
to terminate the outdated fish daemon.
EOS
end
test do
+78 -45
View File
@@ -21,17 +21,21 @@ class Gcc < Formula
desc "GNU compiler collection"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz"
sha256 "832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c"
url "http://ftpmirror.gnu.org/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2"
mirror "https://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2"
sha256 "5f835b04b5f7dd4f4d2dc96190ec1621b8d89f2dc6f638f9f8bc1b1014ba8cad"
bottle do
sha256 "dfe5debb5b2d22c65673a38bfc1902042d7094702f49ff3cdfa2ecb30d09308e" => :tiger_g3
sha256 "401a75fa8baebfd62260dfa5c1b2668a4599d2543e4634d3dc7c7bb3b120e9d4" => :tiger_altivec
sha256 "7786105aba6e06111cadb876900ad0f5613ad0b87e699bb81e66baa88d1279c9" => :tiger_altivec
sha256 "aa1e0a6738594a14f270726501de6bd65628cc0f331af458c396e0728744fc1e" => :leopard_g3s
sha256 "2e7f1d7a9600a42b88672f7719dd76257acfaa6994e11f762ccc0234c84bd905" => :leopard_altivec
end
option "with-java", "Build the gcj compiler"
option "with-all-languages", "Enable all compilers and languages, except Ada"
option "with-nls", "Build with native language support (localization)"
option "with-jit", "Build just-in-time compiler"
option "with-jit", "Build the jit compiler"
option "without-fortran", "Build without the gfortran compiler"
# enabling multilib on a host that can't run 64-bit results in build failures
option "without-multilib", "Build without multilib support" if MacOS.prefer_64_bit?
@@ -39,6 +43,7 @@ class Gcc < Formula
depends_on "libmpc"
depends_on "mpfr"
depends_on "isl"
depends_on "ecj" if build.with?("java") || build.with?("all-languages")
if MacOS.version < :leopard
# The as that comes with Tiger isn't capable of dealing with the
@@ -66,43 +71,41 @@ class Gcc < Formula
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64089
patch :DATA
# Fix build with make 3.80
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66947
patch do
url "https://gist.githubusercontent.com/mistydemeo/f5508247c1171edcbddcd95671137bdb/raw/249976f5b22ace26f2373f6fad12c0a1c0e22df4/libgcc-fix-make380.patch"
sha256 "fc5b45bb2771a6b35b0283412a50d7cb13ae982ed5607b27232a976a48078134"
end
# Fix an Intel-only build failure on 10.4
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64184
patch do
url "https://gist.githubusercontent.com/mistydemeo/9c5b8dadd892ba3197a9cb431295cc83/raw/582d1ba135511272f7262f51a3f83c9099cd891d/sysdep-unix-tiger-intel.patch"
sha256 "17afaf7daec1dd207cb8d06a7e026332637b11e83c3ad552b4cd32827f16c1d8"
end
# This patch fixes the build on PPC
# https://gcc.gnu.org/ml/gcc-testresults/2017-01/msg02971.html
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80865
patch do
url "https://gist.githubusercontent.com/mistydemeo/d35fcc040587cc75bd24d3464e93a45d/raw/c5fe1f0c6393526ff45803b0fc14e028149a245e/gcc_altivec.patch"
sha256 "09a795d013ec3e96107bfb9d5c6bba821cc867b88c3bce494ae1564bfd4ababd"
url "https://gist.githubusercontent.com/anonymous/c0eff2ff4bfbf555505968e21311a38f/raw/39e96539676556e87c7461a382b73088c0b5ba28/-"
sha256 "c10779e463fe3c77c574225083a9f7a12638f6b0cb278e8c3d6c40bf9d9c2762"
end
def install
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
if Hardware::CPU.family == :g3 || ARGV.bottle_arch == :g3
ENV.append_to_cflags "-force_cpusubtype_ALL"
end
if MacOS.version < :leopard
ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as"
end
# We avoiding building:
# - Ada, which requires a pre-existing GCC Ada compiler to bootstrap
# - Go, currently not supported on macOS
# - BRIG
languages = %w[c c++ objc obj-c++ fortran]
if build.with? "all-languages"
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap. GCC 4.6.0 adds go as a language option, but it is
# currently only compilable on Linux.
languages = %w[c c++ objc obj-c++ fortran java jit]
else
# C, C++, ObjC compilers are always built
languages = %w[c c++ objc obj-c++]
# JIT compiler is off by default, enabling it has performance cost
languages << "jit" if build.with? "jit"
languages << "fortran" if build.with? "fortran"
languages << "java" if build.with? "java"
languages << "jit" if build.with? "jit"
end
args = [
"--build=#{arch}-apple-darwin#{osmajor}",
@@ -116,14 +119,21 @@ class Gcc < Formula
"--with-mpc=#{Formula["libmpc"].opt_prefix}",
"--with-isl=#{Formula["isl"].opt_prefix}",
"--with-system-zlib",
"--enable-libstdcxx-time=yes",
"--enable-stage1-checking",
"--enable-checking=release",
"--enable-lto",
# Use 'bootstrap-debug' build configuration to force stripping of object
# files prior to comparison during bootstrap (broken by Xcode 6.3).
"--with-build-config=bootstrap-debug",
"--disable-werror",
"--with-pkgversion=Tigerbrew #{name} #{pkg_version} #{build.used_options*" "}".strip,
"--with-bugurl=https://github.com/mistydemeo/tigerbrew/issues",
]
# "Building GCC with plugin support requires a host that supports
# -fPIC, -shared, -ldl and -rdynamic."
args << "--enable-plugin" if MacOS.version > :leopard
args << "--enable-plugin" if MacOS.version > :tiger
# Otherwise make fails during comparison at stage 3
# See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248
@@ -131,13 +141,17 @@ class Gcc < Formula
args << "--disable-nls" if build.without? "nls"
if build.with?("java") || build.with?("all-languages")
args << "--with-ecj-jar=#{Formula["ecj"].opt_share}/java/ecj.jar"
end
if build.without?("multilib") || !MacOS.prefer_64_bit?
args << "--disable-multilib"
else
args << "--enable-multilib"
end
args << "--enable-host-shared" if build.with?("jit")
args << "--enable-host-shared" if build.with?("jit") || build.with?("all-languages")
# Ensure correct install names when linking against libgcc_s;
# see discussion in https://github.com/Homebrew/homebrew/pull/34303
@@ -152,10 +166,12 @@ class Gcc < Formula
end
system "../configure", *args
system "make"
system "make", "bootstrap"
system "make", "install"
bin.install_symlink bin/"gfortran-#{version_suffix}" => "gfortran"
if build.with?("fortran") || build.with?("all-languages")
bin.install_symlink bin/"gfortran-#{version_suffix}" => "gfortran"
end
end
# Handle conflicts between GCC formulae and avoid interfering
@@ -166,6 +182,19 @@ class Gcc < Formula
# Even when suffixes are appended, the info pages conflict when
# install-info is run. TODO fix this.
info.rmtree
# Rename java properties
if build.with?("java") || build.with?("all-languages")
config_files = [
"#{lib}/gcc/#{version_suffix}/logging.properties",
"#{lib}/gcc/#{version_suffix}/security/classpath.security",
"#{lib}/gcc/#{version_suffix}/i386/logging.properties",
"#{lib}/gcc/#{version_suffix}/i386/security/classpath.security"
]
config_files.each do |file|
add_suffix file, version_suffix if File.exist? file
end
end
end
def add_suffix(file, suffix)
@@ -208,19 +237,23 @@ class Gcc < Formula
system "#{bin}/g++-#{version_suffix}", "-o", "hello-cc", "hello-cc.cc"
assert_equal "Hello, world!\n", `./hello-cc`
(testpath/"test.f90").write <<-EOS.undent
integer,parameter::m=10000
real::a(m), b(m)
real::fact=0.5
if build.with?("fortran") || build.with?("all-languages")
fixture = <<-EOS.undent
integer,parameter::m=10000
real::a(m), b(m)
real::fact=0.5
do concurrent (i=1:m)
a(i) = a(i) + fact*b(i)
end do
write(*,"(A)") "Done"
end
EOS
system "#{bin}/gfortran", "-o", "test", "test.f90"
assert_equal "Done\n", `./test`
do concurrent (i=1:m)
a(i) = a(i) + fact*b(i)
end do
print *, "done"
end
EOS
(testpath/"in.f90").write(fixture)
system "#{bin}/gfortran", "-c", "in.f90"
system "#{bin}/gfortran", "-o", "test", "in.o"
assert_equal "done", `./test`.strip
end
end
end
__END__
+5 -12
View File
@@ -55,12 +55,6 @@ class Gcc44 < Formula
sha256 "9c5f6fd30d089e97e0364af322272bb06f3d107f357d2b621503ebfbbb4a5af7"
end
# Handle OS X deployment targets correctly (GCC PR target/63810 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810>).
patch :p0 do
url "https://trac.macports.org/export/129382/trunk/dports/lang/gcc44/files/macosx-version-min.patch"
sha256 "9083143d2c60fbd89d33354710381590da770973746dd6849e18835f449510bc"
end
# The bottles are built on systems with the CLT installed, and do not work
# out of the box on Xcode-only systems due to an incorrect sysroot.
def pour_bottle?
@@ -74,10 +68,6 @@ class Gcc44 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if build.with? "all-languages"
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap.
@@ -138,12 +128,15 @@ class Gcc44 < Formula
system "../configure", *args
# Flags for Clang compatibility
make_flags = 'BOOT_CFLAGS="$BOOT_CFLAGS -D_FORTIFY_SOURCE=0" STAGE1_CFLAGS="$STAGE1_CFLAGS -std=gnu89 -D_FORTIFY_SOURCE=0 -fkeep-inline-functions"'
if build.with? "profiled-build"
# Takes longer to build, may bug out. Provided for those who want to
# optimise all the way to 11.
system "make", "profiledbootstrap"
system "make", make_flags, "profiledbootstrap"
else
system "make", "bootstrap"
system "make", make_flags, "bootstrap"
end
# At this point `make check` could be invoked to run the testsuite. The
+2 -6
View File
@@ -85,10 +85,6 @@ class Gcc45 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if build.with? "all-languages"
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap.
@@ -133,7 +129,7 @@ class Gcc45 < Formula
# "Building GCC with plugin support requires a host that supports
# -fPIC, -shared, -ldl and -rdynamic."
args << "--enable-plugin" if MacOS.version > :tiger && Hardware.cpu_type == :intel
args << "--enable-plugin" if MacOS.version > :tiger
# Otherwise make fails during comparison at stage 3
# See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248
@@ -174,7 +170,7 @@ class Gcc45 < Formula
system "make", "install"
# `make install` neglects to transfer an essential plugin header file.
Pathname.new(Dir[prefix.join "**", "plugin", "include", "config"].first).install "../gcc/config/darwin-sections.def" if MacOS.version > :tiger && Hardware.cpu_type == :intel
Pathname.new(Dir[prefix.join "**", "plugin", "include", "config"].first).install "../gcc/config/darwin-sections.def" if MacOS.version > :tiger
end
# Handle conflicts between GCC formulae.
-4
View File
@@ -81,10 +81,6 @@ class Gcc46 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if build.with? "all-languages"
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap. GCC 4.6.0 add go as a language option, but it is
-12
View File
@@ -64,10 +64,6 @@ class Gcc47 < Formula
depends_on "cloog-ppl015"
depends_on "ecj" if build.with?("java") || build.with?("all-languages")
# The as that comes with Tiger isn't capable of dealing with the
# PPC asm that comes in libitm
depends_on "cctools" => :build if MacOS.version < :leopard
# The bottles are built on systems with the CLT installed, and do not work
# out of the box on Xcode-only systems due to an incorrect sysroot.
def pour_bottle?
@@ -87,10 +83,6 @@ class Gcc47 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if build.with? "all-languages"
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap. GCC 4.6.0 add go as a language option, but it is
@@ -137,10 +129,6 @@ class Gcc47 < Formula
# -fPIC, -shared, -ldl and -rdynamic."
args << "--enable-plugin" if MacOS.version > :tiger
# Otherwise make fails during comparison at stage 3
# See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248
args << "--with-dwarf2" if MacOS.version < :leopard
args << "--disable-nls" if build.without? "nls"
if build.with?("java") || build.with?("all-languages")
-4
View File
@@ -89,10 +89,6 @@ class Gcc48 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if MacOS.version < :leopard
ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as"
end
-4
View File
@@ -83,10 +83,6 @@ class Gcc49 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if build.with? "all-languages"
# Everything but Ada, which requires a pre-existing GCC Ada compiler
# (gnat) to bootstrap. GCC 4.6.0 add go as a language option, but it is
-4
View File
@@ -71,10 +71,6 @@ class Gcc5 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if MacOS.version < :leopard
ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as"
end
+1 -5
View File
@@ -71,10 +71,6 @@ class Gcc6 < Formula
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# Otherwise libstdc++ will be incorrectly tagged with cpusubtype 10 (G4e)
# https://github.com/mistydemeo/tigerbrew/issues/538
ENV.append_to_cflags "-force_cpusubtype_ALL" if Hardware::CPU.family == :g3
if MacOS.version < :leopard
ENV["AS"] = ENV["AS_FOR_TARGET"] = "#{Formula["cctools"].bin}/as"
end
@@ -123,7 +119,7 @@ class Gcc6 < Formula
# "Building GCC with plugin support requires a host that supports
# -fPIC, -shared, -ldl and -rdynamic."
args << "--enable-plugin" if MacOS.version > :leopard
args << "--enable-plugin" if MacOS.version > :tiger
# The pre-Mavericks toolchain requires the older DWARF-2 debugging data
# format to avoid failure during the stage 3 comparison of object files.
+14 -30
View File
@@ -1,37 +1,27 @@
class Gmp < Formula
desc "GNU multiple precision arithmetic library"
homepage "https://gmplib.org/"
url "https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz"
mirror "https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.xz"
sha256 "87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912"
url "http://ftpmirror.gnu.org/gmp/gmp-6.0.0a.tar.bz2"
mirror "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2"
mirror "https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2"
sha256 "7f8e9a804b9c6d07164cf754207be838ece1219425d64e28cfa3e70d5c759aaf"
bottle do
cellar :any
sha1 "954d513d362b0bda155bd8bf0347a49a93e3f885" => :tiger_altivec
sha1 "ef404f79249e760443a037cc5f9374df4074f8fc" => :leopard_g3
sha1 "f6b2011e9b1a6e22ccbb30f6ed94d338063feb30" => :leopard_altivec
end
option "32-bit"
option :cxx11
def arch_to_string_map
@arch_map ||= {
:g3 => "powerpc750",
:g4 => "powerpc7400",
:g4e => "powerpc7450",
:g5 => "powerpc970"
}
end
# https://github.com/mistydemeo/tigerbrew/issues/212
env :std
def install
ENV.cxx11 if build.cxx11?
args = ["--prefix=#{prefix}", "--enable-cxx"]
if build.bottle?
bottle_sym = ARGV.bottle_arch || Hardware.oldest_cpu
arch = arch_to_string_map.fetch(bottle_sym, "core2")
args << "--build=#{arch}-apple-darwin#{`uname -r`.to_i}"
end
if build.build_32_bit? || !MacOS.prefer_64_bit?
ENV.m32
@@ -42,28 +32,22 @@ class Gmp < Formula
# https://github.com/Homebrew/homebrew/issues/20693
args << "--disable-assembly" if build.build_32_bit? || build.bottle?
system "./configure", "--disable-static", *args
system "./configure", *args
system "make"
system "make", "check"
ENV.deparallelize
system "make", "install"
system "make", "clean"
system "./configure", "--disable-shared", "--disable-assembly", *args
system "make"
lib.install Dir[".libs/*.a"]
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <gmp.h>
#include <stdlib.h>
int main() {
mpz_t i, j, k;
mpz_init_set_str (i, "1a", 16);
mpz_init (j);
mpz_init (k);
mpz_sqrtrem (j, k, i);
if (mpz_get_si (j) != 5 || mpz_get_si (k) != 1) abort();
int main()
{
mpz_t integ;
mpz_init (integ);
mpz_clear (integ);
return 0;
}
EOS
-93
View File
@@ -1,93 +0,0 @@
class Gmp4 < Formula
desc "GNU multiple precision arithmetic library"
homepage "http://gmplib.org/"
# Track gcc infrastructure releases.
url "https://ftpmirror.gnu.org/gmp/gmp-4.3.2.tar.bz2"
mirror "https://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.bz2"
mirror "ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2"
sha256 "936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775"
bottle do
cellar :any
revision 1
sha256 "5c5d632ea58479fba37a0844d0b9a4fd1e865e809286ada95d5484d72ab50a78" => :el_capitan
sha256 "932a2d0987dd26bbc3cb54b7d38d4cf6b0e5a4bd46fef8442b79b75f067abf6e" => :yosemite
sha256 "b7012c46ac9e5b5aa1004184e85a2e99fc047d9f92f1e8b82699ba1f1ea1f7bf" => :mavericks
end
keg_only "Conflicts with gmp in main repository."
option "with-32-bit"
option "without-check", "Do not run `make check` to verify libraries"
deprecated_option "32-bit" => "with-32-bit"
deprecated_option "skip-check" => "without-check"
fails_with :gcc_4_0 do
cause "Reports of problems using gcc 4.0 on Leopard: https://github.com/mxcl/homebrew/issues/issue/2302"
end
# Patches gmp.h to remove the __need_size_t define, which
# was preventing libc++ builds from getting the ptrdiff_t type
# Applied upstream in http://gmplib.org:8000/gmp/raw-rev/6cd3658f5621
patch :DATA
def install
args = ["--prefix=#{prefix}", "--enable-cxx"]
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
if MacOS.prefer_64_bit? && !build.build_32_bit?
ENV.m64
args << "--build=x86_64-apple-darwin"
else
ENV.m32
args << "--host=none-apple-darwin"
end
system "./configure", *args
system "make"
ENV.deparallelize # Doesn't install in parallel on 8-core Mac Pro
system "make", "install"
# Different compilers and options can cause tests to fail even
# if everything compiles, so yes, we want to do this step.
system "make", "check" if build.with? "check"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <gmp.h>
int main()
{
mpz_t integ;
mpz_init (integ);
mpz_clear (integ);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lgmp", "-I#{include}", "-o", "test"
system "./test"
end
end
__END__
diff --git a/gmp-h.in b/gmp-h.in
index d7fbc34..3c57c48 100644
--- a/gmp-h.in
+++ b/gmp-h.in
@@ -46,13 +46,11 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#ifndef __GNU_MP__
#define __GNU_MP__ 4
-#define __need_size_t /* tell gcc stddef.h we only want size_t */
#if defined (__cplusplus)
#include <cstddef> /* for size_t */
#else
#include <stddef.h> /* for size_t */
#endif
-#undef __need_size_t
/* Instantiated by configure. */
#if ! defined (__GMP_WITHIN_CONFIGURE)
-111
View File
@@ -1,111 +0,0 @@
class Grip < Formula
desc "GitHub Markdown previewer"
homepage "https://github.com/joeyespo/grip"
url "https://files.pythonhosted.org/packages/3c/ea/2a475ed37e1b6476182e71223c98667f51704bdbc919608372b203c7ea04/grip-4.5.2.tar.gz"
sha256 "048b7e5c738ed80bee345bd10840f27eb31687eb67132b40f2473dc1cf67aa0f"
bottle do
cellar :any_skip_relocation
sha256 "1d4b1cbd24fd7e087f13f947510fbf886bb1eccbd0bc7c45f23c4a5eebec678e" => :tiger_g3
sha256 "cd904541d7370920a24f07abe782cc68f947dc26e820eb7000f9c0edceb9e8e2" => :tiger_g4
sha256 "69934d0ea8e23b288a28e5dbbe429415d0b0e9df7d3bdb3c338b3bf0acd12121" => :tiger_g4e
sha256 "0fabed73fb8cb3072f4b849e47ca2ebab0d6c8300652755866a354e49d146024" => :tiger_g5
end
depends_on "python"
resource "certifi" do
url "https://files.pythonhosted.org/packages/15/d4/2f888fc463d516ff7bf2379a4e9a552fef7f22a94147655d9b1097108248/certifi-2018.1.18.tar.gz"
sha256 "edbc3f203427eef571f79a7692bb160a2b0f7ccaa31953e99bd17e307cf63f7d"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "click" do
url "https://files.pythonhosted.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897/click-6.7.tar.gz"
sha256 "f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
end
resource "docopt" do
url "https://files.pythonhosted.org/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz"
sha256 "49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
end
resource "Flask" do
url "https://files.pythonhosted.org/packages/eb/12/1c7bd06fcbd08ba544f25bf2c6612e305a70ea51ca0eda8007344ec3f123/Flask-0.12.2.tar.gz"
sha256 "49f44461237b69ecd901cc7ce66feea0319b9158743dd27a2899962ab214dac1"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/f4/bd/0467d62790828c23c47fc1dfa1b1f052b24efdf5290f071c7a91d0d82fd3/idna-2.6.tar.gz"
sha256 "2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f"
end
resource "itsdangerous" do
url "https://files.pythonhosted.org/packages/dc/b4/a60bcdba945c00f6d608d8975131ab3f25b22f2bcfe1dab221165194b2d4/itsdangerous-0.24.tar.gz"
sha256 "cbb3fcf8d3e33df861709ecaf89d9e6629cff0a217bc2848f1b41cd30d360519"
end
resource "Jinja2" do
url "https://files.pythonhosted.org/packages/56/e6/332789f295cf22308386cf5bbd1f4e00ed11484299c5d7383378cf48ba47/Jinja2-2.10.tar.gz"
sha256 "f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
end
resource "Markdown" do
url "https://files.pythonhosted.org/packages/b3/73/fc5c850f44af5889192dff783b7b0d8f3fe8d30b65c8e3f78f8f0265fecf/Markdown-2.6.11.tar.gz"
sha256 "a856869c7ff079ad84a3e19cd87a64998350c2b94e9e08e44270faef33400f81"
end
resource "MarkupSafe" do
url "https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz"
sha256 "a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665"
end
resource "path-and-address" do
url "https://files.pythonhosted.org/packages/2b/b5/749fab14d9e84257f3b0583eedb54e013422b6c240491a4ae48d9ea5e44f/path-and-address-2.0.1.zip"
sha256 "e96363d982b3a2de8531f4cd5f086b51d0248b58527227d43cf5014d045371b7"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/71/2a/2e4e77803a8bd6408a2903340ac498cb0a2181811af7c9ec92cb70b0308a/Pygments-2.2.0.tar.gz"
sha256 "dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/b0/e1/eab4fc3752e3d240468a8c0b284607899d2fbfb236a56b7377a329aa8d09/requests-2.18.4.tar.gz"
sha256 "9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/ee/11/7c59620aceedcc1ef65e156cc5ce5a24ef87be4107c2b74458464e437a5d/urllib3-1.22.tar.gz"
sha256 "cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"
end
resource "Werkzeug" do
url "https://files.pythonhosted.org/packages/9f/08/a3bb1c045ec602dc680906fc0261c267bed6b3bb4609430aff92c3888ec8/Werkzeug-0.14.1.tar.gz"
sha256 "c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resources.each do |r|
r.stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
assert_match "<strong>Homebrew</strong> is awesome",
pipe_output("#{bin}/grip - --export -", "**Homebrew** is awesome.")
end
end
+7 -5
View File
@@ -7,12 +7,14 @@ class Isl < Formula
# and update isl_version() function accordingly. All other names will
# result in isl_version() function returning "UNKNOWN" and hence break
# package detection.
url "http://isl.gforge.inria.fr/isl-0.18.tar.xz"
mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/i/isl/isl_0.18.orig.tar.xz"
sha256 "0f35051cc030b87c673ac1f187de40e386a1482a0cfdf2c552dd6031b307ddc4"
url "http://isl.gforge.inria.fr/isl-0.14.1.tar.xz"
sha256 "8882c9e36549fc757efa267706a9af733bb8d7fe3905cbfde43e17a89eea4675"
bottle do
cellar :any
sha256 "5eaa78e68bc8d075525deb825a6eb06c2fb50a17b7dd4396ad0ac55de8aa3756" => :tiger_altivec
sha256 "9b9a2b0962c3ebfcabe04a59ea55b4ca27c78399f8da2b13b9e87d5b6af204c3" => :leopard_g3
sha256 "2aec4bfbb99d9d8f8946f38ba7a047a51ad6cae6332699305dca79f702ca322a" => :leopard_altivec
end
head do
@@ -32,7 +34,7 @@ class Isl < Formula
"--prefix=#{prefix}",
"--with-gmp=system",
"--with-gmp-prefix=#{Formula["gmp"].opt_prefix}"
system "make", "check"
system "make"
system "make", "install"
(share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"]
end
@@ -48,7 +50,7 @@ class Isl < Formula
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lisl", "-o", "test"
system ENV.cc, "test.c", "-lisl", "-o", "test"
system "./test"
end
end
-46
View File
@@ -1,46 +0,0 @@
class Isl011 < Formula
desc "Integer Set Library for the polyhedral model"
homepage "http://freecode.com/projects/isl"
# Track gcc infrastructure releases.
url "http://isl.gforge.inria.fr/isl-0.11.1.tar.bz2"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.11.1.tar.bz2"
sha256 "095f4b54c88ca13a80d2b025d9c551f89ea7ba6f6201d701960bfe5c1466a98d"
bottle do
cellar :any
revision 1
sha256 "13e867965cd3a068d7261b4f07cb9835f8f3e4661f27d151318a3b04fccacbd0" => :el_capitan
sha256 "6d59cb6e7fc0aa67ff5a0734d00aaf712f424dcd6094f29b0dbbfa5d5f205a98" => :yosemite
sha256 "d747feae5b551c03d783886fd3aa58a86ce04a73753d1d8347b196f953d54ddd" => :mavericks
end
keg_only "Conflicts with isl in main repository."
depends_on "gmp4"
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-gmp=system",
"--with-gmp-prefix=#{Formula["gmp4"].opt_prefix}"
system "make", "install"
(share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"]
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <isl/ctx.h>
int main()
{
isl_ctx* ctx = isl_ctx_alloc();
isl_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lisl",
"-I#{include}", "-I#{Formula["gmp4"].include}", "-o", "test"
system "./test"
end
end
-45
View File
@@ -1,45 +0,0 @@
class Isl014 < Formula
desc "Integer Set Library for the polyhedral model"
homepage "http://freecode.com/projects/isl"
# Track gcc infrastructure releases.
url "http://isl.gforge.inria.fr/isl-0.14.tar.bz2"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.14.tar.bz2"
sha256 "7e3c02ff52f8540f6a85534f54158968417fd676001651c8289c705bd0228f36"
bottle do
cellar :any
sha256 "a6166d161841d901af54319a5434e955964712ae5cc19a88705d4f28669dc36b" => :yosemite
sha256 "cbcb2862709fa87913927a3ce261ac989f650a3506abde6c9eaa4da2d58b2b53" => :mavericks
sha256 "04997936c670ba1289574c526a62c69eae7e82c94c20b680df2f995df83b6d59" => :mountain_lion
end
keg_only "Conflicts with isl in main repository."
depends_on "gmp"
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-gmp=system",
"--with-gmp-prefix=#{Formula["gmp"].opt_prefix}"
system "make"
system "make", "install"
(share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"]
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <isl/ctx.h>
int main()
{
isl_ctx* ctx = isl_ctx_alloc();
isl_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lisl", "-o", "test"
system "./test"
end
end
+13 -13
View File
@@ -1,6 +1,6 @@
class Libid3tag < Formula
desc "ID3 tag manipulation library"
homepage "https://www.underbit.com/products/mad/"
homepage "http://www.underbit.com/products/mad/"
url "https://downloads.sourceforge.net/project/mad/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz"
sha256 "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"
@@ -15,32 +15,32 @@ class Libid3tag < Formula
# patch for utf-16 (memory leaks), see https://bugs.launchpad.net/mixxx/+bug/403586
{
"utf16.patchlibid3tag-0.15.1b-utf16" => "487d0c531f3653f8e754d720729cf1cec1bce6e897b845fa61adaaf2668d1568",
"unknown-encoding" => "8b695c9c05e3885655b2e798326b804011615bc6c831cd55cdbacc456a6b9494",
"compat" => "88f486c3d263a4dd5bb556232dcfe2fba175b5124bcdd72aa6c30f562fc87d53",
"file-write" => "eff855cabd8a51866a29246a1b257da64f46aab72d4b8e163e2a4c0d15165bf1",
"utf16.patchlibid3tag-0.15.1b-utf16" => "daf621e8123530fdab5193099031074666fc7330",
"unknown-encoding" => "093def535edb3d2f5be6b173eedf0f93a1c0314c",
"compat" => "8c179b10bf49385e4334aab141e4cf270cb02182",
"file-write" => "b7baae1c87f90aac64a4d17725b2eaad521e42af"
}.each do |name, sha|
patch do
url "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libid3tag/files/0.15.1b/libid3tag-0.15.1b-#{name}.patch?id=56bd759df1d0"
sha256 sha
url "http://mirror.ovh.net/gentoo-portage/media-libs/libid3tag/files/0.15.1b/libid3tag-0.15.1b-#{name}.patch"
sha1 sha
end
end
# typedef for 64-bit long + buffer overflow
{
"64bit-long" => "5f8b3d3419addf90977832b0a6e563acc2c8e243bb826ebb6d0ec573ec122e1b",
"fix_overflow" => "43ea3e0b324fb25802dae6410564c947ce1982243c781ef54b023f060c3b0ac4",
"tag" => "ca7262ddad158ab0be804429d705f8c6a1bb120371dec593323fa4876c1b277f",
"64bit-long" => "f9778590811a050384b9bf8827345b61999f0da3",
"fix_overflow" => "ed80bc74bd81caa225952f72a1a28d54300e43e3",
"tag" => "b7ef9a41a31a37b8bb6d8e064b0c0ba618d3fa03"
}.each do |name, sha|
patch :p0 do
url "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libid3tag/files/0.15.1b/libid3tag-0.15.1b-#{name}.patch?id=56bd759df1d0"
sha256 sha
url "http://mirror.ovh.net/gentoo-portage/media-libs/libid3tag/files/0.15.1b/libid3tag-0.15.1b-#{name}.patch"
sha1 sha
end
end
# corrects "a cappella" typo
patch :p2 do
url "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libid3tag/files/0.15.1b/libid3tag-0.15.1b-a_capella.patch?id=56bd759df1d0"
url "http://mirror.ovh.net/gentoo-portage/media-libs/libid3tag/files/0.15.1b/libid3tag-0.15.1b-a_capella.patch"
sha256 "5e86270ebb179d82acee686700d203e90f42e82beeed455b0163d8611657d395"
end
-57
View File
@@ -1,57 +0,0 @@
class Libmpc08 < Formula
desc "C library for high precision complex numbers"
homepage "http://multiprecision.org"
# Track gcc infrastructure releases.
url "http://multiprecision.org/mpc/download/mpc-0.8.1.tar.gz"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz"
sha256 "e664603757251fd8a352848276497a4c79b7f8b21fd8aedd5cc0598a38fee3e4"
bottle do
cellar :any
revision 1
sha256 "e3bb3e309c6c5bd709fee9a136a642289357fcc4aa9c793df1c96785947c99d9" => :el_capitan
sha256 "79a024cd86280716cc82f35e88ae9695f0606d2b09e585d3d9a0f7fc800eec20" => :yosemite
sha256 "105469fc116eae8a19000848c91ea1bea71ad5e3f395624938030c3813eca0ed" => :mavericks
end
keg_only "Conflicts with libmpc in main repository."
depends_on "gmp4"
depends_on "mpfr2"
def install
args = [
"--prefix=#{prefix}",
"--disable-dependency-tracking",
"--with-gmp=#{Formula["gmp4"].opt_prefix}",
"--with-mpfr=#{Formula["mpfr2"].opt_prefix}",
]
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <mpc.h>
int main()
{
mpc_t x;
mpc_init2 (x, 256);
mpc_clear (x);
return 0;
}
EOS
gmp4 = Formula["gmp4"]
mpfr2 = Formula["mpfr2"]
system ENV.cc, "test.c",
"-I#{gmp4.include}", "-L#{gmp4.lib}", "-lgmp",
"-I#{mpfr2.include}", "-L#{mpfr2.lib}", "-lmpfr",
"-I#{include}", "-L#{lib}", "-lmpc",
"-o", "test"
system "./test"
end
end
+4 -4
View File
@@ -14,10 +14,10 @@ class Libpcap < Formula
keg_only :provided_by_osx
# System versions are too old on older OS Xs
# https://github.com/mistydemeo/tigerbrew/issues/574
depends_on "bison" => :build
depends_on "flex" => :build
unless OS.mac?
depends_on "bison" => :build
depends_on "flex" => :build
end
def install
system "./configure", "--prefix=#{prefix}",
-41
View File
@@ -1,41 +0,0 @@
class Mgba < Formula
desc "Game Boy Advance emulator"
homepage "https://mgba.io/"
url "https://github.com/mgba-emu/mgba/archive/0.6.3.tar.gz"
sha256 "35c8906c01206adae714fee9c2bc39698c514a4adb32c9c4a5a3fa58b2d10f9a"
head "https://github.com/mgba-emu/mgba.git"
depends_on :ld64 # fixes a linktime error on Tiger
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "libepoxy"
depends_on "libpng"
depends_on "libzip"
depends_on "sdl2"
# error: stdarg.h: No such file or directory
fails_with :gcc if MacOS.version == :tiger
def install
# Qt is still broken on 10.4, so build with it off by default.
# FFmpeg introduces a VideoDecodeAcceleration framework requirement,
# which isn't available on older OS Xs.
# Imagemagick fails to link due to some strange path lookup issues.
# The Sqlite feature isn't exposed in the SDL build, so no reason to enable it.
args = ["-DBUILD_QT=OFF", "-DUSE_FFMPEG=OFF", "-DUSE_MAGICK=OFF", "-DUSE_SQLITE3=OFF"]
# GCC 4.0 and 4.2 don't support -flto
# The buildsystem will detect this in the next stable release.
# GCC also doesn't enable LTO on Tiger.
if MacOS.version < :leopard || [:gcc, :gcc_4_0].include?(ENV.compiler)
args << "-DBUILD_LTO=OFF"
end
system "cmake", ".", *(std_cmake_args + args)
system "make", "install"
end
test do
assert_match version.to_s, shell_output("#{bin}/mGBA --version")
end
end
+7 -6
View File
@@ -1,16 +1,17 @@
class Miniupnpc < Formula
desc "UpnP IGD client library and daemon"
homepage "https://miniupnp.tuxfamily.org"
url "http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-2.0.20170509.tar.gz"
sha256 "d3c368627f5cdfb66d3ebd64ca39ba54d6ff14a61966dbecb8dd296b7039f16a"
homepage "http://miniupnp.tuxfamily.org"
url "http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.9.20150609.tar.gz"
sha256 "86e6ccec5b660ba6889893d1f3fca21db087c6466b1a90f495a1f87ab1cd1c36"
bottle do
cellar :any
sha256 "aecb5c84e988af64b0d3d4c3f090d033a6daaad5fe145cbec599537bcba65646" => :el_capitan
sha256 "b31e62a6331c82219bdf674c9d5b366f1288f203b947f446bbade154ab54025d" => :yosemite
sha256 "ffc0d9665983408ee86c4e5aae53c66abb22f56d700c8ceea6bd01f2a3875c75" => :mavericks
sha256 "ba1333c0e47f68fb0b11e945ada0aff81b69517aea4356f936fed0eaf357475e" => :mountain_lion
end
# /usr/bin/ld: -i argument: nstall_name must have a ':' between its symbol names
depends_on :ld64
def install
system "make", "INSTALLPREFIX=#{prefix}", "install"
end
+14 -5
View File
@@ -1,12 +1,22 @@
class Mpfr < Formula
desc "C library for multiple-precision floating-point computations"
homepage "http://www.mpfr.org/"
url "https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.6.tar.xz"
mirror "https://ftpmirror.gnu.org/mpfr/mpfr-3.1.6.tar.xz"
sha256 "7a62ac1a04408614fccdc506e4844b10cf0ad2c2b1677097f8f35d3a1344a950"
# Upstream is down a lot, so use mirrors
url "https://mirrors.kernel.org/debian/pool/main/m/mpfr4/mpfr4_3.1.3.orig.tar.xz"
mirror "https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.3.tar.xz"
sha256 "6835a08bd992c8257641791e9a6a2b35b02336c8de26d0a8577953747e514a16"
bottle do
cellar :any
sha256 "04e066ed7657626ae08398f894d58b23e0614af343f8a1d6fe4a892f3f943e17" => :tiger_altivec
sha256 "9422c33c89b7782aa0b777e7bbbecf8539681b76dc32d6ae6faaf498eb471d0b" => :leopard_g3
sha256 "cfbbd0bb406a79a5bdeddc16a5f01a61597aeb19a03e4be76c8ab3cf4fccbaef" => :leopard_altivec
end
# http://www.mpfr.org/mpfr-current/allpatches
patch do
url "https://gist.github.com/anonymous/3a7d24cf2c68f21eb940/raw/471e928fcdbfb5c2fa7428cfb496496e6ee469aa/mpfr-3.1.3.diff"
sha256 "1ca002acc121413b9ce39e9f12bb6efe4bed4ec45cf3f3ffcff122b94f6694de"
end
option "32-bit"
@@ -23,8 +33,7 @@ class Mpfr < Formula
def install
ENV.m32 if build.build_32_bit?
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}",
"--disable-silent-rules"
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "make"
system "make", "check"
system "make", "install"
-57
View File
@@ -1,57 +0,0 @@
class Mpfr2 < Formula
desc "Multiple-precision floating-point computations C lib"
homepage "http://www.mpfr.org/"
# Track gcc infrastructure releases.
url "http://www.mpfr.org/mpfr-2.4.2/mpfr-2.4.2.tar.bz2"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2"
sha256 "c7e75a08a8d49d2082e4caee1591a05d11b9d5627514e678f02d66a124bcf2ba"
bottle do
cellar :any
revision 1
sha256 "08e5aa9a8b8631afe6478ab7973a152316237cbddcb0f76ddaebebec99ee77b0" => :el_capitan
sha256 "bb6d912bd1688077a961a91ae12a94e372e339546df84295013473bb9882def5" => :yosemite
sha256 "8745f1ca353d9bd28c07ac4c602b2836ca6d39477fa8736baba55fc46ce66d85" => :mavericks
end
option "with-32-bit"
deprecated_option "32-bit" => "with-32-bit"
depends_on "gmp4"
keg_only "Conflicts with mpfr in main repository."
fails_with :clang do
build 421
cause <<-EOS.undent
clang build 421 segfaults while building in superenv;
see https://github.com/mxcl/homebrew/issues/15061
EOS
end
def install
gmp4 = Formula["gmp4"]
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--with-gmp=#{gmp4.opt_prefix}
]
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
# Note: This logic should match what the GMP formula does.
if MacOS.prefer_64_bit? && !build.build_32_bit?
ENV.m64
args << "--build=x86_64-apple-darwin"
else
ENV.m32
args << "--build=none-apple-darwin"
end
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
end
end
+1 -1
View File
@@ -1,7 +1,7 @@
class Mysql < Formula
desc "Open source relational database management system"
homepage "https://dev.mysql.com/doc/refman/5.6/en/"
url "https://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.35.tar.gz"
url "https://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.35.tar.gz"
sha256 "dddcba169b98844d7c65346cbd791c853edf942d78440381685087b84aa35020"
bottle do
+82
View File
@@ -0,0 +1,82 @@
class Openssh < Formula
desc "OpenBSD freely-licensed SSH connectivity tools"
homepage "https://www.openssh.com/"
url "https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz"
mirror "https://www.mirrorservice.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz"
version "7.5p1"
sha256 "9846e3c5fab9f0547400b4d2c017992f914222b3fd1f8eee6c7dc6bc5e59f9f0"
revision 1
bottle do
sha256 "87916642682b44296aa06297aaeeb2ef10519c6d0363d5286be74657e8758167" => :sierra
sha256 "d3573d5402f065728fed6bd00085d6d4599b7151f14ac1cdf000a3140a9526a6" => :el_capitan
sha256 "36eab43111afa57e0a3c112b09e85453613196e85922ae546a599d54b555556b" => :yosemite
end
# Please don't resubmit the keychain patch option. It will never be accepted.
# https://github.com/Homebrew/homebrew-dupes/pull/482#issuecomment-118994372
depends_on "openssl"
depends_on "ldns" => :optional
depends_on "pkg-config" => :build if build.with? "ldns"
# Both these patches are applied by Apple.
patch do
url "https://raw.githubusercontent.com/Homebrew/patches/1860b0a74/openssh/patch-sandbox-darwin.c-apple-sandbox-named-external.diff"
sha256 "d886b98f99fd27e3157b02b5b57f3fb49f43fd33806195970d4567f12be66e71"
end
patch do
url "https://raw.githubusercontent.com/Homebrew/patches/d8b2d8c2/openssh/patch-sshd.c-apple-sandbox-named-external.diff"
sha256 "3505c58bf1e584c8af92d916fe5f3f1899a6b15cc64a00ddece1dc0874b2f78f"
end
resource "com.openssh.sshd.sb" do
url "https://opensource.apple.com/source/OpenSSH/OpenSSH-209.50.1/com.openssh.sshd.sb"
sha256 "a273f86360ea5da3910cfa4c118be931d10904267605cdd4b2055ced3a829774"
end
def install
ENV.append "CPPFLAGS", "-D__APPLE_SANDBOX_NAMED_EXTERNAL__"
# Ensure sandbox profile prefix is correct.
# We introduce this issue with patching, it's not an upstream bug.
inreplace "sandbox-darwin.c", "@PREFIX@/share/openssh", etc/"ssh"
args = %W[
--with-libedit
--with-kerberos5
--prefix=#{prefix}
--sysconfdir=#{etc}/ssh
--with-pam
--with-ssl-dir=#{Formula["openssl"].opt_prefix}
]
args << "--with-ldns" if build.with? "ldns"
system "./configure", *args
system "make"
system "make", "install"
# This was removed by upstream with very little announcement and has
# potential to break scripts, so recreate it for now.
# Debian have done the same thing.
bin.install_symlink bin/"ssh" => "slogin"
buildpath.install resource("com.openssh.sshd.sb")
(etc/"ssh").install "com.openssh.sshd.sb" => "org.openssh.sshd.sb"
end
test do
assert_match "OpenSSH_", shell_output("#{bin}/ssh -V 2>&1")
begin
pid = fork { exec sbin/"sshd", "-D", "-p", "8022" }
sleep 2
assert_match "sshd", shell_output("lsof -i :8022")
ensure
Process.kill(9, pid)
Process.wait(pid)
end
end
end
+10 -7
View File
@@ -1,16 +1,18 @@
class Pcre2 < Formula
desc "Perl compatible regular expressions library with a new API"
homepage "https://www.pcre.org/"
url "https://ftp.pcre.org/pub/pcre/pcre2-10.30.tar.bz2"
sha256 "90bd41c605d30e3745771eb81928d779f158081a51b2f314bbcc1f73de5773db"
homepage "http://www.pcre.org/"
url "https://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.20.tar.bz2"
mirror "https://www.mirrorservice.org/sites/downloads.sourceforge.net/p/pc/pcre/pcre2/10.20/pcre2-10.20.tar.bz2"
sha256 "332e287101c9e9567d1ed55391b338b32f1f72c5b5ee7cc81ef2274a53ad487a"
head "svn://vcs.exim.org/pcre2/code/trunk"
bottle do
cellar :any
sha256 "bd0d09c9849ec4ce62bff6bf422cf8c42dfa7d39e684c0d7e7d3d176a749ab76" => :tiger_g3
sha256 "032c6cc3f59a97be735e385714da097201d03afb5ecc1ee943d0f5ebf8f06d52" => :tiger_altivec
sha256 "23e8ed207c87f4a77e01b49d1972de94795e398ab00e4fe1d2260f1c905306f7" => :tiger_g5
sha256 "df6f0855251cd664b41896e72262d28ed73b82b585b09d5df1a8d54783c8583c" => :el_capitan
sha256 "acd343182f0033d61a8b9266909a1c3a609d9a450d1cf28fe30fefa9c54c36e3" => :yosemite
sha256 "febc1cf22e5da7f4f873dadda0d88a158602d99b49d61ed51441d82083a9b924" => :mavericks
sha256 "5258f37a0149806a78d777c6c311ff9c53eff4d4ae3d14c47825f4c279eed298" => :mountain_lion
end
option :universal
@@ -26,10 +28,11 @@ class Pcre2 < Formula
"--enable-pcre2grep-libbz2",
"--enable-jit"
system "make"
system "make", "check"
system "make", "install"
end
test do
system "#{bin}/pcre2grep", "regular expression", prefix/"README"
system "#{bin}/pcre2grep", "regular expression", "#{prefix}/README"
end
end
-42
View File
@@ -1,42 +0,0 @@
class Ppl011 < Formula
homepage "http://bugseng.com/products/ppl/"
# Track gcc infrastructure releases.
url "http://bugseng.com/products/ppl/download/ftp/releases/0.11/ppl-0.11.tar.gz"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/ppl-0.11.tar.gz"
sha256 "3453064ac192e095598576c5b59ecd81a26b268c597c53df05f18921a4f21c77"
revision 1
bottle do
sha256 "be178bf8fc11a049a27b83d0b00660a3ee4426845657f3d8279b31e10730a878" => :yosemite
sha256 "f89fff76bdc39bea26763f765188523ba34eb9d07d3834c79a8d50a489a9aabc" => :mavericks
sha256 "f257cca9615ae1fb0a239c1fbf4f505dbcba139744999a9c8d7f512b5dbb7fa4" => :mountain_lion
end
depends_on "m4" => :build if MacOS.version < :leopard
depends_on "gmp4"
conflicts_with "ppl", :because => "They install the same binaries"
# https://www.cs.unipr.it/mantis/view.php?id=596
# https://github.com/Homebrew/homebrew/issues/27431
# Using different patch from upstream bug report to avoid autoreconf.
patch do
url "https://gist.githubusercontent.com/manphiz/9507743/raw/45081e12c2f1faf81e8536f365af05173c6dab5c/patch-ppl-flexible-array-clang_v2.patch"
sha256 "db8ced5366ec4c3efb6fd20d3b4e440de3f8b9ec1d930a33b6a23d006dc25944"
end
def install
system "./configure", "--prefix=#{prefix}",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--disable-ppl_lpsol",
"--disable-ppl_lcdd",
"--disable-ppl_pips",
"--with-gmp-prefix=#{Formula["gmp4"].opt_prefix}"
system "make", "install"
end
test do
system bin/"ppl-config", "--bindir", "--libdir", "--license"
end
end
+101 -40
View File
@@ -1,19 +1,24 @@
class Python < Formula
desc "Interpreted, interactive, object-oriented programming language"
homepage "https://www.python.org"
url "https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz"
sha256 "22d9b1ac5b26135ad2b8c2901a9413537e08749a753356ee913c84dbd2df5574"
head "https://github.com/python/cpython.git", :branch => "2.7"
url "https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz"
sha256 "d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978"
revision 3
head "https://hg.python.org/cpython", :using => :hg, :branch => "2.7"
bottle do
sha256 "8dc69c4e1f6f1ebaa59033ea30bf96f924d496ba0d0a7d698e5b9ed20369a657" => :tiger_g3
sha256 "5aa18fb91dc3b1b3bc810171b78b0a30b68de878457666addd9c08bd2873692d" => :tiger_altivec
sha256 "2ac20b04ff599f02e950431622943f2c92e70e85c097f645265adaf4dd8c6a31" => :sierra
sha256 "ed692ad5e13437a751dce19865989ce7e3344402aa38496db3e78ab179121197" => :el_capitan
sha256 "834c7ac3ce19df12cb4fb9cbb1cae0c7fbdcaf33a9141dc1c3791ab801df27f0" => :yosemite
end
# Please don't add a wide/ucs4 option as it won't be accepted.
# More details in: https://github.com/Homebrew/homebrew/pull/32368
option :universal
option "with-quicktest", "Run `make quicktest` after the build (for devs; may fail)"
option "with-tcl-tk", "Use Tigerbrew's Tk instead of OS X Tk (has optional Cocoa and threads support)"
option "with-poll", "Enable select.poll, which is not fully implemented on OS X (https://bugs.python.org/issue5154)"
# sphinx-doc depends on python, but on 10.6 or earlier python is fulfilled by
# brew, which would lead to circular dependency.
@@ -38,27 +43,30 @@ class Python < Formula
skip_clean "bin/easy_install", "bin/easy_install-2.7"
resource "setuptools" do
url "https://files.pythonhosted.org/packages/1a/04/d6f1159feaccdfc508517dba1929eb93a2854de729fa68da9d5c6b48fa00/setuptools-39.2.0.zip"
sha256 "f7cddbb5f5c640311eb00eab6e849f7701fa70bf6a183fc8a2c33dd1d1672fb2"
url "https://files.pythonhosted.org/packages/9f/7c/0a33c528164f1b7ff8cf0684cf88c2e733c8ae0119ceca4a3955c7fc059d/setuptools-23.1.0.tar.gz"
sha256 "4e269d36ba2313e6236f384b36eb97b3433cf99a16b94c74cca7eee2b311f2be"
end
resource "pip" do
url "https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d4eab3d11a57446f08259dee8f02/pip-10.0.1.tar.gz"
sha256 "f2bd08e0cd1b06e10218feaf6fef299f473ba706582eb3bd9d52203fdbd7ee68"
url "https://files.pythonhosted.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz"
sha256 "4d24b03ffa67638a3fa931c09fd9e0273ffa904e95ebebe7d4b1a54c93d7b732"
end
resource "wheel" do
url "https://files.pythonhosted.org/packages/2a/fb/aefe5d5dbc3f4fe1e815bcdb05cbaab19744d201bbc9b59cfa06ec7fc789/wheel-0.31.1.tar.gz"
sha256 "0a2e54558a0628f2145d2fc822137e322412115173e8a2ddbe1c9024338ae83c"
url "https://files.pythonhosted.org/packages/c9/1d/bd19e691fd4cfe908c76c429fe6e4436c9e83583c4414b54f6c85471954a/wheel-0.29.0.tar.gz"
sha256 "1ebb8ad7e26b448e9caa4773d2357849bf80ff9e313964bcaf79cbf0201a1648"
end
# Patch to disable the search for Tk.framework, since Homebrew's Tk is
# a plain unix build. Remove `-lX11`, too because our Tk is "AquaTk".
if build.with? "tcl-tk"
patch do
url "https://raw.githubusercontent.com/Homebrew/patches/42fcf22/python/brewed-tk-patch.diff"
sha256 "15c153bdfe51a98efe48f8e8379f5d9b5c6c4015e53d3f9364d23c8689857f09"
end
patch :DATA if build.with? "tcl-tk"
# Patch for pyport.h macro issue
# https://bugs.python.org/issue10910
# https://trac.macports.org/ticket/44288
patch do
url "https://bugs.python.org/file30805/issue10910-workaround.txt"
sha256 "c075353337f9ff3ccf8091693d278782fcdff62c113245d8de43c5c7acc57daf"
end
def lib_cellar
@@ -77,15 +85,19 @@ class Python < Formula
# setuptools remembers the build flags python is built with and uses them to
# build packages later. Xcode-only systems need different flags.
def pour_bottle
reason <<~EOS
The bottle needs the Apple Command Line Tools to be installed.
You can install them, if desired, with:
xcode-select --install
reason <<-EOS.undent
The bottle needs the Apple Command Line Tools to be installed.
You can install them, if desired, with:
xcode-select --install
EOS
satisfy { MacOS::CLT.installed? }
end
def install
if build.with? "poll"
opoo "The given option --with-poll enables a somewhat broken poll() on OS X (https://bugs.python.org/issue5154)."
end
# Unset these so that installing pip and setuptools puts them where we want
# and not into some other Python the user has installed.
ENV["PYTHONHOME"] = nil
@@ -166,7 +178,18 @@ class Python < Formula
args << "CPPFLAGS=#{cppflags.join(" ")}" unless cppflags.empty?
system "./configure", *args
# HAVE_POLL is "broken" on OS X. See:
# https://trac.macports.org/ticket/18376
# https://bugs.python.org/issue5154
if build.without? "poll"
inreplace "pyconfig.h", /.*?(HAVE_POLL[_A-Z]*).*/, '#undef \1'
end
system "make"
if build.with?("quicktest") || build.bottle?
system "make", "quicktest", "TESTPYTHONOPTS=-s", "TESTOPTS=-j#{ENV.make_jobs} -w"
end
ENV.deparallelize do
# Tell Python not to install into /Applications
@@ -191,9 +214,6 @@ class Python < Formula
# Symlink the pkgconfig files into HOMEBREW_PREFIX so they're accessible.
(lib/"pkgconfig").install_symlink Dir["#{frameworks}/Python.framework/Versions/Current/lib/pkgconfig/*"]
# Remove 2to3 because Python 3 also installs it
rm bin/"2to3"
# Remove the site-packages that Python created in its Cellar.
site_packages_cellar.rmtree
@@ -210,13 +230,6 @@ class Python < Formula
end
def post_install
# Avoid conflicts with lingering unversioned files from Python 3
rm_f %W[
#{HOMEBREW_PREFIX}/bin/easy_install
#{HOMEBREW_PREFIX}/bin/pip
#{HOMEBREW_PREFIX}/bin/wheel
]
# Fix up the site-packages so that user-installed Python software survives
# minor updates, such as going from 2.7.0 to 2.7.1:
@@ -237,7 +250,7 @@ class Python < Formula
# setuptools-0.9.5-py3.3.egg
rm_rf Dir["#{site_packages}/setuptools*"]
rm_rf Dir["#{site_packages}/distribute*"]
rm_rf Dir["#{site_packages}/pip[-_.][0-9]*", "#{site_packages}/pip"]
rm_rf (Dir["#{site_packages}/pip[-_.][0-9]*"] + Dir["#{site_packages}/pip"])
setup_args = ["-s", "setup.py", "--no-user-cfg", "install", "--force",
"--verbose",
@@ -271,21 +284,21 @@ class Python < Formula
end
cfg = lib_cellar/"distutils/distutils.cfg"
cfg.atomic_write <<~EOS
cfg.atomic_write <<-EOF.undent
[install]
prefix=#{HOMEBREW_PREFIX}
[build_ext]
include_dirs=#{include_dirs.join ":"}
library_dirs=#{library_dirs.join ":"}
EOS
EOF
end
def sitecustomize
<<~EOS
<<-EOF.undent
# This file is created by Homebrew and is executed on each python startup.
# Don't print from here, or else python command line scripts may fail!
# <https://docs.brew.sh/Homebrew-and-Python>
# <https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Homebrew-and-Python.md>
import re
import os
import sys
@@ -328,10 +341,10 @@ class Python < Formula
# Set the sys.executable to use the opt_prefix
sys.executable = '#{opt_bin}/python2.7'
EOS
EOF
end
def caveats; <<~EOS
def caveats; <<-EOS.undent
Pip and setuptools have been installed. To update them
pip install --upgrade pip setuptools
@@ -341,8 +354,8 @@ class Python < Formula
They will install into the site-package directory
#{site_packages}
See: https://docs.brew.sh/Homebrew-and-Python
EOS
See: https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Homebrew-and-Python.md
EOS
end
test do
@@ -351,6 +364,54 @@ class Python < Formula
system "#{bin}/python", "-c", "import sqlite3"
# Check if some other modules import. Then the linked libs are working.
system "#{bin}/python", "-c", "import Tkinter; root = Tkinter.Tk()"
system bin/"pip", "list", "--format=columns"
system bin/"pip", "list"
end
end
__END__
diff --git a/setup.py b/setup.py
index 716f08e..66114ef 100644
--- a/setup.py
+++ b/setup.py
@@ -1810,9 +1810,6 @@ class PyBuildExt(build_ext):
# Rather than complicate the code below, detecting and building
# AquaTk is a separate method. Only one Tkinter will be built on
# Darwin - either AquaTk, if it is found, or X11 based Tk.
- if (host_platform == 'darwin' and
- self.detect_tkinter_darwin(inc_dirs, lib_dirs)):
- return
# Assume we haven't found any of the libraries or include files
# The versions with dots are used on Unix, and the versions without
@@ -1858,21 +1855,6 @@ class PyBuildExt(build_ext):
if dir not in include_dirs:
include_dirs.append(dir)
- # Check for various platform-specific directories
- if host_platform == 'sunos5':
- include_dirs.append('/usr/openwin/include')
- added_lib_dirs.append('/usr/openwin/lib')
- elif os.path.exists('/usr/X11R6/include'):
- include_dirs.append('/usr/X11R6/include')
- added_lib_dirs.append('/usr/X11R6/lib64')
- added_lib_dirs.append('/usr/X11R6/lib')
- elif os.path.exists('/usr/X11R5/include'):
- include_dirs.append('/usr/X11R5/include')
- added_lib_dirs.append('/usr/X11R5/lib')
- else:
- # Assume default location for X11
- include_dirs.append('/usr/X11/include')
- added_lib_dirs.append('/usr/X11/lib')
# If Cygwin, then verify that X is installed before proceeding
if host_platform == 'cygwin':
@@ -1897,9 +1879,6 @@ class PyBuildExt(build_ext):
if host_platform in ['aix3', 'aix4']:
libs.append('ld')
- # Finally, link with the X11 libraries (not appropriate on cygwin)
- if host_platform != "cygwin":
- libs.append('X11')
ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
define_macros=[('WITH_APPINIT', 1)] + defs,
+90 -127
View File
@@ -1,54 +1,51 @@
class Python3 < Formula
desc "Interpreted, interactive, object-oriented programming language"
homepage "https://www.python.org/"
url "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz"
sha256 "0382996d1ee6aafe59763426cf0139ffebe36984474d0ec4126dd1c40a8b3549"
url "https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.xz"
sha256 "d6d7aa1634a5eeeca6ed4fca266982a04f84bd8f3945a9179e20b24ad2e2be91"
revision 1
bottle do
sha256 "2caf6b1d5c9166e4135392905adbb342d9abff35377762fc101278ba367089a3" => :tiger_g3
sha256 "b5bbf6517590aae2a173d4dc2b586525b110d5188a4b5b2f465e41bfcf73f495" => :tiger_altivec
revision 3
sha256 "5a955a6800431f4b38f7dcc4910deaf3c9e3a47f68b5a4b2117527c57290c4dd" => :el_capitan
sha256 "956b2bfe8289da7584089768e6143f852b9586ffd552d9b1e4c5e116f7c52587" => :yosemite
sha256 "98e2f771b7bc6e33f5eae068788b9197619eb037f043a292790482aa82577528" => :mavericks
end
head do
url "https://github.com/python/cpython.git"
resource "blurb" do
url "https://files.pythonhosted.org/packages/f2/2d/541cf1d8054dbb320aca5e9dcce5d66efb227be9adb75d2697ee45d1f742/blurb-1.0.6.tar.gz"
sha256 "90c7d2e5d141d7d1fc6ca0fe660025317ac81ca078e6045c46b1bc5a675ce5d1"
end
end
head "https://hg.python.org/cpython", :using => :hg
option :universal
option "with-tcl-tk", "Use Tigerbrew's Tk instead of OS X Tk (has optional Cocoa and threads support)"
option "with-quicktest", "Run `make quicktest` after the build"
deprecated_option "quicktest" => "with-quicktest"
deprecated_option "with-brewed-tk" => "with-tcl-tk"
depends_on "pkg-config" => :build
depends_on "sphinx-doc" => :build if MacOS.version > :snow_leopard
depends_on "readline" => :recommended
depends_on "sqlite"
depends_on "sqlite" => :recommended
depends_on "gdbm" => :recommended
depends_on "openssl"
depends_on "xz" => :recommended # for the lzma module added in 3.3
depends_on "tcl-tk" => :optional
depends_on :x11 if build.with?("tcl-tk") && Tab.for_name("tcl-tk").with?("x11")
skip_clean "bin/pip3", "bin/pip-3.4", "bin/pip-3.5", "bin/pip-3.6", "bin/pip-3.7"
skip_clean "bin/easy_install3", "bin/easy_install-3.4", "bin/easy_install-3.5", "bin/easy_install-3.6", "bin/easy_install-3.7"
skip_clean "bin/pip3", "bin/pip-3.4", "bin/pip-3.5"
skip_clean "bin/easy_install3", "bin/easy_install-3.4", "bin/easy_install-3.5"
resource "setuptools" do
url "https://files.pythonhosted.org/packages/1a/04/d6f1159feaccdfc508517dba1929eb93a2854de729fa68da9d5c6b48fa00/setuptools-39.2.0.zip"
sha256 "f7cddbb5f5c640311eb00eab6e849f7701fa70bf6a183fc8a2c33dd1d1672fb2"
url "https://pypi.python.org/packages/source/s/setuptools/setuptools-18.3.1.tar.gz"
sha256 "2fa230727104b07e522deec17929e84e041c9047e392c055347a02b0d5ca874d"
end
resource "pip" do
url "https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d4eab3d11a57446f08259dee8f02/pip-10.0.1.tar.gz"
sha256 "f2bd08e0cd1b06e10218feaf6fef299f473ba706582eb3bd9d52203fdbd7ee68"
url "https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz"
sha256 "ca047986f0528cfa975a14fb9f7f106271d4e0c3fe1ddced6c1db2e7ae57a477"
end
resource "wheel" do
url "https://files.pythonhosted.org/packages/2a/fb/aefe5d5dbc3f4fe1e815bcdb05cbaab19744d201bbc9b59cfa06ec7fc789/wheel-0.31.1.tar.gz"
sha256 "0a2e54558a0628f2145d2fc822137e322412115173e8a2ddbe1c9024338ae83c"
url "https://pypi.python.org/packages/source/w/wheel/wheel-0.26.0.tar.gz"
sha256 "eaad353805c180a47545a256e6508835b65a8e830ba1093ed8162f19a50a530c"
end
# Homebrew's tcl-tk is built in a standard unix fashion (due to link errors)
@@ -56,6 +53,27 @@ class Python3 < Formula
# X11.
patch :DATA if build.with? "tcl-tk"
# Fix extension module builds against Xcode 7 SDKs
# https://github.com/Homebrew/homebrew/issues/41085
# https://bugs.python.org/issue25136
patch do
url "https://bugs.python.org/file40478/xcode-stubs.diff"
sha256 "029cc0dc72b1bcf4ddc5f913cc4a3fd970378073c6355921891f041aca2f8b12"
end
def lib_cellar
prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}"
end
def site_packages_cellar
lib_cellar/"site-packages"
end
# The HOMEBREW_PREFIX location of site-packages.
def site_packages
HOMEBREW_PREFIX/"lib/python#{xy}/site-packages"
end
fails_with :llvm do
build 2336
cause <<-EOS.undent
@@ -81,50 +99,38 @@ class Python3 < Formula
ENV["PYTHONHOME"] = nil
ENV["PYTHONPATH"] = nil
xy = (buildpath/"configure.ac").read.slice(/PYTHON_VERSION, (3\.\d)/, 1)
lib_cellar = prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}"
args = %W[
--prefix=#{prefix}
--enable-ipv6
--datarootdir=#{share}
--datadir=#{share}
--enable-framework=#{frameworks}
--enable-loadable-sqlite-extensions
--without-ensurepip
--with-openssl=#{Formula["openssl"].opt_prefix}
]
args << "--without-gcc" if ENV.compiler == :clang
cflags = []
ldflags = []
cppflags = []
unless MacOS::CLT.installed?
# Help Python's build system (setuptools/pip) to build things on Xcode-only systems
# The setup.py looks at "-isysroot" to get the sysroot (and not at --sysroot)
cflags << "-isysroot #{MacOS.sdk_path}"
ldflags << "-isysroot #{MacOS.sdk_path}"
cppflags << "-I#{MacOS.sdk_path}/usr/include" # find zlib
# For the Xlib.h, Python needs this header dir with the system Tk
cflags = "CFLAGS=-isysroot #{MacOS.sdk_path}"
ldflags = "LDFLAGS=-isysroot #{MacOS.sdk_path}"
args << "CPPFLAGS=-I#{MacOS.sdk_path}/usr/include" # find zlib
if build.without? "tcl-tk"
cflags << "-I#{MacOS.sdk_path}/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers"
cflags += " -I#{MacOS.sdk_path}/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers"
end
args << cflags
args << ldflags
end
# Avoid linking to libgcc http://code.activestate.com/lists/python-dev/112195/
args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}"
# We want our readline! This is just to outsmart the detection code,
# We want our readline and openssl! This is just to outsmart the detection code,
# superenv makes cc always find includes/libs!
inreplace "setup.py",
"do_readline = self.compiler.find_library_file(lib_dirs, 'readline')",
"do_readline = '#{Formula["readline"].opt_lib}/libhistory.dylib'"
inreplace "setup.py" do |s|
s.gsub! "sqlite_setup_debug = False", "sqlite_setup_debug = True"
s.gsub! "for d_ in inc_dirs + sqlite_inc_paths:",
"for d_ in ['#{Formula["sqlite"].opt_include}']:"
s.gsub! "do_readline = self.compiler.find_library_file(lib_dirs, 'readline')",
"do_readline = '#{Formula["readline"].opt_lib}/libhistory.dylib'"
s.gsub! "/usr/local/ssl", Formula["openssl"].opt_prefix
end
if build.universal?
@@ -132,6 +138,9 @@ class Python3 < Formula
args << "--enable-universalsdk" << "--with-universal-archs=intel"
end
# Allow sqlite3 module to load extensions: http://docs.python.org/library/sqlite3.html#f1
inreplace("setup.py", 'sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))', "pass") if build.with? "sqlite"
# Allow python modules to use ctypes.find_library to find homebrew's stuff
# even if homebrew is not a /usr/local/lib. Try this with:
# `brew install enchant && pip install pyenchant`
@@ -146,11 +155,8 @@ class Python3 < Formula
ENV.append "LDFLAGS", "-L#{tcl_tk}/lib"
end
args << "CFLAGS=#{cflags.join(" ")}" unless cflags.empty?
args << "LDFLAGS=#{ldflags.join(" ")}" unless ldflags.empty?
args << "CPPFLAGS=#{cppflags.join(" ")}" unless cppflags.empty?
system "./configure", *args
system "make"
ENV.deparallelize # Installs must be serialized
@@ -158,6 +164,7 @@ class Python3 < Formula
system "make", "install", "PYTHONAPPSDIR=#{prefix}"
# Demos and Tools
system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{share}/python3"
system "make", "quicktest" if build.include? "quicktest"
# Any .app get a " 3" attached, so it does not conflict with python 2.x.
Dir.glob("#{prefix}/*.app") { |app| mv app, app.sub(".app", " 3.app") }
@@ -175,45 +182,21 @@ class Python3 < Formula
rm bin/"2to3"
# Remove the site-packages that Python created in its Cellar.
(prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}/site-packages").rmtree
site_packages_cellar.rmtree
# These makevars are available through distutils.sysconfig at runtime and
# some third-party software packages depend on them
inreplace frameworks/"Python.framework/Versions/#{xy}/lib/python#{xy}/config-#{xy}m/Makefile" do |s|
s.change_make_var! "LINKFORSHARED",
"-u _PyMac_Error #{opt_prefix}/Frameworks/Python.framework/Versions/#{xy}/Python"
end
%w[setuptools pip wheel].each do |r|
(libexec/r).install resource(r)
end
if MacOS.version > :snow_leopard
cd "Doc" do
if build.head?
system bin/"python3", "-m", "venv", "./venv"
resource("blurb").stage do
system buildpath/"Doc/venv/bin/python3", "-m", "pip", "install", "-v",
"--no-deps", "--no-binary", ":all", "--ignore-installed", "."
end
end
system "make", "html"
doc.install Dir["build/html/*"]
end
end
# Install unversioned symlinks in libexec/bin.
{
"idle" => "idle3",
"pydoc" => "pydoc3",
"python" => "python3",
"python-config" => "python3-config",
}.each do |unversioned_name, versioned_name|
(libexec/"bin").install_symlink (bin/versioned_name).realpath => unversioned_name
end
end
def post_install
ENV.delete "PYTHONPATH"
xy = (prefix/"Frameworks/Python.framework/Versions").children.min.basename.to_s
site_packages = HOMEBREW_PREFIX/"lib/python#{xy}/site-packages"
site_packages_cellar = prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}/site-packages"
# Fix up the site-packages so that user-installed Python software survives
# minor updates, such as going from 3.3.2 to 3.3.3:
@@ -249,50 +232,45 @@ class Python3 < Formula
rm_rf [bin/"pip", bin/"easy_install"]
mv bin/"wheel", bin/"wheel3"
# Install unversioned symlinks in libexec/bin.
{
"easy_install" => "easy_install-#{xy}",
"pip" => "pip3",
"wheel" => "wheel3",
}.each do |unversioned_name, versioned_name|
(libexec/"bin").install_symlink (bin/versioned_name).realpath => unversioned_name
end
# post_install happens after link
%W[pip3 pip#{xy} easy_install-#{xy} wheel3].each do |e|
(HOMEBREW_PREFIX/"bin").install_symlink bin/e
end
# Help distutils find brewed stuff when building extensions
include_dirs = [HOMEBREW_PREFIX/"include", Formula["openssl"].opt_include,
Formula["sqlite"].opt_include]
library_dirs = [HOMEBREW_PREFIX/"lib", Formula["openssl"].opt_lib,
Formula["sqlite"].opt_lib]
include_dirs = [HOMEBREW_PREFIX/"include", Formula["openssl"].opt_include]
library_dirs = [HOMEBREW_PREFIX/"lib", Formula["openssl"].opt_lib]
if build.with? "sqlite"
include_dirs << Formula["sqlite"].opt_include
library_dirs << Formula["sqlite"].opt_lib
end
if build.with? "tcl-tk"
include_dirs << Formula["tcl-tk"].opt_include
library_dirs << Formula["tcl-tk"].opt_lib
end
cfg = prefix/"Frameworks/Python.framework/Versions/#{xy}/lib/python#{xy}/distutils/distutils.cfg"
cfg.atomic_write <<~EOS
cfg = lib_cellar/"distutils/distutils.cfg"
cfg.atomic_write <<-EOF.undent
[install]
prefix=#{HOMEBREW_PREFIX}
[build_ext]
include_dirs=#{include_dirs.join ":"}
library_dirs=#{library_dirs.join ":"}
EOS
EOF
end
def xy
version.to_s.slice(/(3.\d)/) || "3.6"
end
def sitecustomize
xy = (prefix/"Frameworks/Python.framework/Versions").children.min.basename.to_s
<<~EOS
<<-EOF.undent
# This file is created by Homebrew and is executed on each python startup.
# Don't print from here, or else python command line scripts may fail!
# <https://docs.brew.sh/Homebrew-and-Python>
# <https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md>
import re
import os
import sys
@@ -319,46 +297,32 @@ class Python3 < Formula
# the Cellar site-packages is a symlink to the HOMEBREW_PREFIX
# site_packages; prefer the shorter paths
long_prefix = re.compile(r'#{rack}/[0-9\._abrc]+/Frameworks/Python\.framework/Versions/#{xy}/lib/python#{xy}/site-packages')
sys.path = [long_prefix.sub('#{HOMEBREW_PREFIX/"lib/python#{xy}/site-packages"}', p) for p in sys.path]
sys.path = [long_prefix.sub('#{site_packages}', p) for p in sys.path]
# Set the sys.executable to use the opt_prefix
sys.executable = '#{opt_bin}/python#{xy}'
EOS
EOF
end
def caveats
if prefix.exist?
xy = (prefix/"Frameworks/Python.framework/Versions").children.min.basename.to_s
else
xy = version.to_s.slice(/(3\.\d)/) || "3.7"
end
text = <<~EOS
Python has been installed as
#{HOMEBREW_PREFIX}/bin/python3
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
#{opt_libexec}/bin
If you need Homebrew's Python 2.7 run
brew install python
Pip, setuptools, and wheel have been installed. To update them run
pip3 install --upgrade pip setuptools wheel
text = <<-EOS.undent
Pip and setuptools have been installed. To update them
pip3 install --upgrade pip setuptools
You can install Python packages with
pip3 install <package>
They will install into the site-package directory
#{HOMEBREW_PREFIX/"lib/python#{xy}/site-packages"}
See: https://docs.brew.sh/Homebrew-and-Python
They will install into the site-package directory
#{site_packages}
See: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md
EOS
# Tk warning only for 10.6
tk_caveats = <<~EOS
tk_caveats = <<-EOS.undent
Apple's Tcl/Tk is not recommended for use with Python on Mac OS X 10.6.
For more information see: https://www.python.org/download/mac/tcltk/
For more information see: http://www.python.org/download/mac/tcltk/
EOS
text += tk_caveats unless MacOS.version >= :lion
@@ -366,7 +330,6 @@ class Python3 < Formula
end
test do
xy = (prefix/"Frameworks/Python.framework/Versions").children.min.basename.to_s
# Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions
# and it can occur that building sqlite silently fails if OSX's sqlite is used.
system "#{bin}/python#{xy}", "-c", "import sqlite3"
+25 -4
View File
@@ -1,24 +1,42 @@
class Qemu < Formula
desc "x86 and PowerPC Emulator"
homepage "http://wiki.qemu.org"
# 2.2.1 is the last version to work pre-10.6
# See: https://github.com/mistydemeo/tigerbrew/issues/523
url "http://wiki.qemu-project.org/download/qemu-2.2.1.tar.bz2"
sha256 "4617154c6ef744b83e10b744e392ad111dd351d435d6563ce24d8da75b1335a0"
head "git://git.qemu-project.org/qemu.git"
stable do
url "http://wiki.qemu-project.org/download/qemu-2.4.0.1.tar.bz2"
sha256 "ecfe8b88037e41e817d72c460c56c6a0b573d540d6ba38b162d0de4fd22d1bdb"
# Upstream patch to "fix" pre-10.5 file handler UI... by removing the UI.
# The UI is gone on all OS X versions as of qemu 2.5.0; this patch can be removed then.
patch do
url "https://github.com/qemu/qemu/commit/365d7f3c7aacc789ead96b8eeb5ba5b0a8d93d48.patch"
sha256 "0b32b6af97d7079302ee4a76699ffe232b4121f5488079b8e757161170cea0d9"
end
end
bottle do
sha256 "c6bf8ef38e8af71b00a906a4578bd180d91dce2f3c2f092818690b52bfaac895" => :el_capitan
sha256 "36e3cee1a950d0877d6120b4e7603ddd96e506af54e72337276e5d931e8c40dc" => :yosemite
sha256 "043f1c5b577fdfbaac516bc1ca909dee089cd591fd018b68c1298ab859170ef9" => :mavericks
end
depends_on "make" => :build if MacOS.version < :leopard
depends_on "pkg-config" => :build
depends_on "libtool" => :build
depends_on "jpeg"
depends_on "gnutls"
depends_on "glib"
depends_on "libutil" if MacOS.version < :leopard
depends_on "pixman"
depends_on "vde" => :optional
depends_on "sdl" => :optional
depends_on "gtk+" => :optional
depends_on "libssh2" => :optional
fails_with :gcc_4_0
fails_with :gcc
# 3.2MB working disc-image file hosted on upstream's servers for people to use to test qemu functionality.
resource "armtest" do
url "http://wiki.qemu.org/download/arm-test-0.2.tar.gz"
@@ -32,6 +50,9 @@ class Qemu < Formula
# Needed for certain stdint macros on 10.4
ENV.append_to_cflags "-D__STDC_CONSTANT_MACROS"
# Rez is provided in a normal path in later Xcodes
ENV.prepend_path "PATH", "/Developer/Tools"
# Make 3.80 does not support the `or` operator and has trouble evaluating `unnest-vars`
# See https://github.com/mistydemeo/tigerbrew/pull/496
ENV["MAKE"] = make_path
+2 -1
View File
@@ -3,7 +3,8 @@ class Qt < Formula
homepage "https://www.qt.io/"
stable do
url "https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz"
url "https://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz"
mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz"
sha256 "e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0"
end
+1 -2
View File
@@ -7,8 +7,7 @@ class Readline < Formula
bottle do
cellar :any
sha256 "5ec9e06a248e6d50c9dfa10ab3a862597fbbb66e79039c2848a6da4995b16af4" => :tiger_g3
sha256 "42447f1f1ed5a90e778c74131bb24431438864dccd8fdf1d9f120ee62550da67" => :tiger_altivec
sha256 "f36867f7a2762620894058678f400aa945c9a6930a7a33f7e74d02e12639bbb4" => :tiger_altivec
sha256 "87370403df816b715cb920cce228a31240e7d6eab976bf32b92e2f77050dac06" => :leopard_g3
sha256 "3d347f4be190c3881c6240f3037e4e5b474b47c36740cf21595ba4122e280205" => :leopard_altivec
end
+8 -8
View File
@@ -27,17 +27,17 @@ class Ruby < Formula
depends_on "openssl"
depends_on :x11 if build.with? "tcltk"
if true# MacOS.version <= :leopard
if MacOS.version <= :leopard
# fix for https://bugs.ruby-lang.org/issues/11054
patch do
url "https://github.com/ruby/ruby/commit/1c80c388d5bd48018c419a2ea3ed9f7b7514dfa3.patch?full_index=1"
sha256 "8ba0a24a36702d2cbc94aa73cb6f0b11793348b0158c11c8608e073c71601bb5"
url "https://github.com/ruby/ruby/commit/1c80c388d5bd48018c419a2ea3ed9f7b7514dfa3.patch"
sha256 "b53661f3077f10af2446f6faf5870d476471290859b7058cd2661e6e6ca24e8e"
end
# fix for https://bugs.ruby-lang.org/issues/13247
patch do
url "https://github.com/ruby/ruby/commit/9e1a9858c84142e32b1bc51b23fa06a025f98b46.patch?full_index=1"
sha256 "300f13461385804ddfb314d9b0880bb47ad4f53f48209681d193a800418c31e6"
url "https://github.com/ruby/ruby/commit/9e1a9858c84142e32b1bc51b23fa06a025f98b46.patch"
sha256 "6bae61c482b59771613c281def4826cd32fa5d9fbe8d0f4935b50896b65fe5fe"
end
# fix for ext/fiddle/libffi-3.2.1/src/x86/win32.S
@@ -45,9 +45,9 @@ class Ruby < Formula
patch :DATA
end
# fails_with :llvm do
# build 2326
# end
fails_with :llvm do
build 2326
end
def install
# mcontext types had a member named `ss` instead of `__ss`
+9 -9
View File
@@ -1,14 +1,14 @@
class Tcsh < Formula
desc "Enhanced, fully compatible version of the Berkeley C shell"
homepage "http://www.tcsh.org/"
url "ftp://ftp.astron.com/pub/tcsh/tcsh-6.20.00.tar.gz"
mirror "https://ftp.osuosl.org/pub/blfs/conglomeration/tcsh/tcsh-6.20.00.tar.gz"
sha256 "b89de7064ab54dac454a266cfe5d8bf66940cb5ed048d0c30674ea62e7ecef9d"
url "ftp://ftp.astron.com/pub/tcsh/tcsh-6.19.00.tar.gz"
mirror "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/tcsh-6.19.00.tar.gz"
sha256 "12e271e0b89e4259d9d6e8d525322e77340e7244cfbd199a591e5f8146285c49"
bottle do
sha256 "9ea07dfb5815b5cfda4c022870a31fce1e1e66109d6afd21d45870b6566eef50" => :tiger_g3
sha256 "e574d87dd70e6604f675033fcea4bd3f7529242dd868d705a8bae694f87f7a03" => :tiger_altivec
sha256 "2ff1a8f5dbd9a71f555009b7ee509dc033953d4558a3fed85f74781a12942c5a" => :tiger_g5
sha256 "2d3fed239e9d5ac71b47c3e5bf96b93c1e9ba77c3799ca482a5b6809621d5f1e" => :yosemite
sha256 "ff5b980d71cb0f151264f0a7f6c6b34120e2420aac284ecfe8fcf908f4e90c07" => :mavericks
sha256 "beab7a774551d3b446526359c31900fbbc7300403b545395c1949ba302a65e24" => :mountain_lion
end
def install
@@ -17,10 +17,10 @@ class Tcsh < Formula
end
test do
(testpath/"test.csh").write <<~EOS
#!#{bin}/tcsh -f
(testpath/"test.csh").write <<-EOS.undent
#!#{bin}/tcsh
set ARRAY=( "t" "e" "s" "t" )
foreach i ( 1 2 3 4 )
foreach i ( `seq $#ARRAY` )
echo -n $ARRAY[$i]
end
EOS
+3 -4
View File
@@ -1,9 +1,8 @@
class Timedog < Formula
desc "Lists files that were saved by a backup of the OS X Time Machine"
homepage "https://github.com/nlfiedler/timedog"
url "https://github.com/nlfiedler/timedog/archive/v1.4.tar.gz"
sha256 "169ab408fe5c6b292a7d4adf0845c42160108fd43d6a392b95210204de49cb52"
head "https://github.com/nlfiedler/timedog.git"
homepage "http://timedog.googlecode.com/"
url "https://timedog.googlecode.com/files/timedog-1.3.zip"
sha256 "4683f37a28407dabc5c56dc45e6480dd2db460289321edce8980a236cc2787ec"
def install
bin.install "timedog"
+1 -1
View File
@@ -1,7 +1,7 @@
class Unar < Formula
desc "RAR archive command-line tools"
homepage "http://unarchiver.c3.cx/commandline"
url "https://wakaba.c3.cx/releases/TheUnarchiver/unar1.8.1_src.zip"
url "https://theunarchiver.googlecode.com/files/unar1.8.1_src.zip"
version "1.8.1"
sha256 "67ccb1c780150840f38de63b8e7047717ef4c71b7574d9ef57bd9d9c93255709"
+1 -1
View File
@@ -3,7 +3,7 @@
class Xz < Formula
desc "General-purpose data compression with high compression ratio"
homepage "http://tukaani.org/xz/"
url "http://download.openpkg.org/components/cache/xz/xz-5.2.1.tar.gz"
url "https://fossies.org/linux/misc/xz-5.2.1.tar.gz"
mirror "http://tukaani.org/xz/xz-5.2.1.tar.gz"
sha256 "b918b6648076e74f8d7ae19db5ee663df800049e187259faf5eb997a7b974681"
-1
View File
@@ -149,7 +149,6 @@ module Homebrew
f.puts "HOMEBREW_BOTTLE_DOMAIN: #{BottleSpecification::DEFAULT_DOMAIN}"
f.puts hardware
f.puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}"
f.puts "Curl: #{ENV["HOMEBREW_CURL"]}"
f.puts "Xcode: #{xcode ? xcode : "N/A"}"
f.puts "CLT: #{clt ? clt : "N/A"}"
f.puts "GCC-4.0: build #{gcc_40}" if gcc_40
+11
View File
@@ -528,6 +528,17 @@ class Checks
end
end
def check_ruby_version
ruby_version = MacOS.version >= "10.9" ? "2.0" : "1.8"
if RUBY_VERSION[/\d\.\d/] != ruby_version then <<-EOS.undent
Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Tigerbrew
is developed and tested on Ruby #{ruby_version}, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.
EOS
end
end
def check_homebrew_prefix
unless HOMEBREW_PREFIX.to_s == "/usr/local"
<<-EOS.undent
+1 -1
View File
@@ -92,7 +92,7 @@ module Homebrew
def make_request(path, data, auth)
headers = {
"User-Agent" => HOMEBREW_USER_AGENT_CURL,
"User-Agent" => HOMEBREW_USER_AGENT,
"Accept" => "application/vnd.github.v3+json",
"Content-Type" => "application/json"
}
-19
View File
@@ -39,23 +39,4 @@ module Homebrew
def help_s
HOMEBREW_HELP
end
def help_for_command(cmd)
cmd_path = if File.exist?(HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.sh")
HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.sh"
elsif ARGV.homebrew_developer? && File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh")
HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh"
elsif File.exist?(HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb")
HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb"
elsif ARGV.homebrew_developer? && File.exist?(HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb")
HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb"
end
return if cmd_path.nil?
cmd_path.read.
split("\n").
grep(/^#:/).
map { |line| line.slice(2..-1).delete("`").sub(/^ \* /, "brew ") }.
join("\n")
end
end
+8 -28
View File
@@ -25,35 +25,15 @@ module Homebrew
puts "Writing HTML fragments to #{DOC_PATH}"
puts "Writing manpages to #{TARGET_PATH}"
header = (SOURCE_PATH/"header.1.md").read
footer = (SOURCE_PATH/"footer.1.md").read
sub_commands = Pathname.glob("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}").
sort_by { |source_file| source_file.basename.sub(/\.(rb|sh)$/, "") }.
map { |source_file|
source_file.read.
split("\n").
grep(/^#:/).
map { |line| line.slice(2..-1) }.
join("\n")
}.
reject { |s| s.strip.empty? }.
join("\n\n")
target_file = nil
Dir["#{SOURCE_PATH}/*.md"].each do |source_file|
target_html = DOC_PATH/"#{File.basename(source_file, ".md")}.html"
safe_system "ronn --fragment --pipe --organization='Tigerbrew' --manual='brew' #{source_file} > #{target_html}"
target_man = TARGET_PATH/File.basename(source_file, ".md")
safe_system "ronn --roff --pipe --organization='Tigerbrew' --manual='brew' #{source_file} > #{target_man}"
end
target_md = SOURCE_PATH/"brew.1.md"
target_md.atomic_write(header + sub_commands + footer)
args = %W[
--pipe
--organization=Tigerbrew
--manual=brew
#{SOURCE_PATH}/brew.1.md
]
target_html = DOC_PATH/"brew.1.html"
target_html.atomic_write Utils.popen_read("ronn", "--fragment", *args)
target_man = TARGET_PATH/"brew.1"
target_man.atomic_write Utils.popen_read("ronn", "--roff", *args)
system "man", target_file if ARGV.flag? "--verbose"
end
end
end
-44
View File
@@ -1,44 +0,0 @@
setup-curl-path() {
local vendor_dir
local vendor_curl_current_version
local vendor_curl_path
vendor_dir="$HOMEBREW_LIBRARY/Homebrew/vendor"
vendor_curl_current_version="$vendor_dir/portable-curl/current"
vendor_curl_path="$vendor_curl_current_version/bin/curl"
if [[ "$HOMEBREW_COMMAND" != "vendor-install" ]]
then
if [[ -x "$vendor_curl_path" ]]
then
HOMEBREW_CURL="$vendor_curl_path"
if [[ $(readlink "$vendor_curl_current_version") != "$(<"$vendor_dir/portable-curl-version")" ]]
then
if ! brew vendor-install curl --quiet
then
onoe "Failed to upgrade vendor Curl."
fi
fi
else
if [[ -n "$HOMEBREW_OSX" ]]
then
HOMEBREW_CURL="/usr/bin/curl"
else
HOMEBREW_CURL="$(which curl)"
fi
if [[ "$HOMEBREW_OSX_VERSION_NUMERIC" -lt "100900" || ! -x "$HOMEBREW_CURL" ]]
then
brew vendor-install curl --quiet
if [[ ! -x "$vendor_curl_path" ]]
then
odie "Failed to install vendor Curl."
fi
HOMEBREW_CURL="$vendor_curl_path"
fi
fi
fi
export HOMEBREW_CURL
}
-233
View File
@@ -1,233 +0,0 @@
#: @hide_from_man_page
#: * `vendor-install` [<target>]:
#: Install vendor version of Homebrew dependencies.
# Hide shellcheck complaint:
# shellcheck source=/dev/null
source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh"
VENDOR_DIR="$HOMEBREW_LIBRARY/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable.
if [[ -n "$HOMEBREW_OSX" ]]
then
# PPC-only 10.4 build
if [[ "$HOMEBREW_PROCESSOR" != "Intel" ]]
then
ruby_URL="https://archive.org/download/tigerbrew/portable-ruby-2.3.3.tiger_g3.bottle.tar.gz"
ruby_SHA="162bed8c95fb30d4580ebc7dfadbb9d699171edbd7b60d8259de7f4cfc55cc32"
# Intel-only 10.4 build
else
ruby_URL="https://archive.org/download/tigerbrew/portable-ruby-2.3.3.tiger_i386.bottle.tar.gz"
ruby_SHA="7f4f13348d583bc9e8594d2b094c6b0140ce0a32a226a145b8b7f9993fca8c28"
fi
# Curl used on older OS Xs to download software
# PPC-only 10.4 build
if [[ "$HOMEBREW_PROCESSOR" != "Intel" ]]
then
curl_URL="https://archive.org/download/tigerbrew/portable-curl-7.58.0.tiger_g3.bottle.tar.gz"
curl_SHA="b3c29e64b62c281e6820460c823d6f7d983e7234fd398ffd13d49c6a011c6bda"
# Intel-only 10.4 build
else
curl_URL="https://archive.org/download/tigerbrew/portable-curl-7.58.0.tiger_i386.bottle.tar.gz"
curl_SHA="552eff67a04f23ee3e041e51387fbebc8b950c265a1b92bed2fdd69ea71496a8"
fi
elif [[ -n "$HOMEBREW_LINUX" ]]
then
ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.0.0-p648.x86_64_linux.bottle.tar.gz"
ruby_SHA="dbb5118a22a6a75cc77e62544a3d8786d383fab1bdaf8c154951268807357bf0"
fi
fetch() {
local -a curl_args
local sha
local temporary_path
curl_args=(
--fail \
--remote-time \
--location \
--user-agent "$HOMEBREW_USER_AGENT_CURL" \
)
if [[ -n "$HOMEBREW_QUIET" ]]
then
curl_args[${#curl_args[*]}]="--silent"
elif [[ -z "$HOMEBREW_VERBOSE" ]]
then
curl_args[${#curl_args[*]}]="--progress-bar"
fi
# Certs are too old to recognize most modern websites; count on the
# sha256 hashes to ensure we're fetching the right thing.
if [[ "$HOMEBREW_CURL" = "/usr/bin/curl" && "$HOMEBREW_OSX_VERSION_NUMERIC" -lt "100900" ]]
then
curl_args[${#curl_args[*]}]="--insecure"
fi
temporary_path="${CACHED_LOCATION}.incomplete"
mkdir -p "$HOMEBREW_CACHE"
[[ -n "$HOMEBREW_QUIET" ]] || echo "==> Downloading $VENDOR_URL"
if [[ -f "$CACHED_LOCATION" ]]
then
[[ -n "$HOMEBREW_QUIET" ]] || echo "Already downloaded: $CACHED_LOCATION"
else
if [[ -f "$temporary_path" ]]
then
"$HOMEBREW_CURL" "${curl_args[@]}" -C - "$VENDOR_URL" -o "$temporary_path"
if [[ $? -eq 33 ]]
then
[[ -n "$HOMEBREW_QUIET" ]] || echo "Trying a full download"
rm -f "$temporary_path"
"$HOMEBREW_CURL" "${curl_args[@]}" "$VENDOR_URL" -o "$temporary_path"
fi
else
"$HOMEBREW_CURL" "${curl_args[@]}" "$VENDOR_URL" -o "$temporary_path"
fi
if [[ ! -f "$temporary_path" ]]
then
odie "Download failed: ${VENDOR_URL}"
fi
trap '' SIGINT
mv "$temporary_path" "$CACHED_LOCATION"
trap - SIGINT
fi
if [[ "$(sysctl -n hw.cputype)" = "18" ]]; then
cpu_family="$(sysctl -n hw.cpusubtype)"
else
cpu_family="$(sysctl -n hw.cpufamily)"
fi
if [[ -x "$(which shasum)" ]]
then
sha="$(shasum -a 256 "$CACHED_LOCATION" | cut -d' ' -f1)"
elif [[ -x "$(which sha256sum)" ]]
then
sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)"
# Ruby 1.8.2's vendored Ruby has broken SHA256 calculation pre-G4e
elif [[ -x "$(which ruby)" && "$cpu_family" != 9 && "$cpu_family" != 10 ]]
then
sha="$(ruby -e "require 'digest/sha2'; digest = Digest::SHA256.new; File.open('$CACHED_LOCATION', 'rb') { |f| digest.update(f.read) }; puts digest.hexdigest")"
# Pure Perl SHA256 implementation
else
sha="$($VENDOR_DIR/sha256 "$CACHED_LOCATION")"
fi
if [[ "$sha" != "$VENDOR_SHA" ]]
then
odie <<EOS
Checksum mismatch.
Expected: $VENDOR_SHA
Actual: $sha
Archive: $CACHED_LOCATION
To retry an incomplete download, remove the file above.
EOS
fi
}
install() {
local tar_args
local verb
if [[ -n "$HOMEBREW_VERBOSE" ]]
then
tar_args="xvzf"
else
tar_args="xzf"
fi
mkdir -p "$VENDOR_DIR/portable-$VENDOR_NAME"
safe_cd "$VENDOR_DIR/portable-$VENDOR_NAME"
trap '' SIGINT
if [[ -d "$VENDOR_VERSION" ]]
then
verb="reinstall"
mv "$VENDOR_VERSION" "$VENDOR_VERSION.reinstall"
elif [[ -n "$(ls -A .)" ]]
then
verb="upgrade"
else
verb="install"
fi
safe_cd "$VENDOR_DIR"
[[ -n "$HOMEBREW_QUIET" ]] || echo "==> Unpacking $(basename "$VENDOR_URL")"
tar "$tar_args" "$CACHED_LOCATION"
safe_cd "$VENDOR_DIR/portable-$VENDOR_NAME"
if "./$VENDOR_VERSION/bin/$VENDOR_NAME" --version >/dev/null 2>&1
then
ln -sfn "$VENDOR_VERSION" current
# remove old vendor installations by sorting files with modified time.
ls -t | grep -Ev "^(current|$VENDOR_VERSION)" | tail -n +4 | xargs rm -rf
if [[ -d "$VENDOR_VERSION.reinstall" ]]
then
rm -rf "$VENDOR_VERSION.reinstall"
fi
else
rm -rf "$VENDOR_VERSION"
if [[ -d "$VENDOR_VERSION.reinstall" ]]
then
mv "$VENDOR_VERSION.reinstall" "$VENDOR_VERSION"
fi
odie "Failed to $verb vendor $VENDOR_NAME."
fi
trap - SIGINT
}
homebrew-vendor-install() {
local option
local url_var
local sha_var
for option in "$@"
do
case "$option" in
-\?|-h|--help|--usage) brew help vendor-install; exit $? ;;
--verbose) HOMEBREW_VERBOSE=1 ;;
--quiet) HOMEBREW_QUIET=1 ;;
--debug) HOMEBREW_DEBUG=1 ;;
--*) ;;
-*)
[[ "$option" = *v* ]] && HOMEBREW_VERBOSE=1
[[ "$option" = *q* ]] && HOMEBREW_QUIET=1
[[ "$option" = *d* ]] && HOMEBREW_DEBUG=1
;;
*)
[[ -n "$VENDOR_NAME" ]] && odie "This command does not take multiple vendor targets"
VENDOR_NAME="$option"
;;
esac
done
[[ -z "$VENDOR_NAME" ]] && odie "This command requires one vendor target."
[[ -n "$HOMEBREW_DEBUG" ]] && set -x
url_var="${VENDOR_NAME}_URL"
sha_var="${VENDOR_NAME}_SHA"
VENDOR_URL="${!url_var}"
VENDOR_SHA="${!sha_var}"
if [[ -z "$VENDOR_URL" || -z "$VENDOR_SHA" ]]
then
odie <<-EOS
Cannot find a vendored version of $VENDOR_NAME for your $HOMEBREW_PROCESSOR
processor on $HOMEBREW_PRODUCT!
EOS
fi
VENDOR_VERSION="$(<"$VENDOR_DIR/portable-${VENDOR_NAME}-version")"
CACHED_LOCATION="$HOMEBREW_CACHE/$(basename "$VENDOR_URL")"
lock "vendor-install-$VENDOR_NAME"
fetch
install
}
+2 -2
View File
@@ -1,7 +1,7 @@
# @private
module CompilerConstants
GNU_GCC_VERSIONS = %w[4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 6 7]
GNU_GCC_REGEXP = /^gcc-(4\.[3-9]|[5-7])$/
GNU_GCC_VERSIONS = %w[4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 6]
GNU_GCC_REGEXP = /^gcc-(4\.[3-9]|[5-6])$/
COMPILER_SYMBOL_MAP = {
"gcc-4.0" => :gcc_4_0,
"gcc-4.2" => :gcc,
+30 -12
View File
@@ -1,8 +1,33 @@
if ENV["HOMEBREW_BREW_FILE"]
# Path to `bin/brew` main executable in {HOMEBREW_PREFIX}
HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"])
else
odie "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
def cache
if ENV["HOMEBREW_CACHE"]
Pathname.new(ENV["HOMEBREW_CACHE"]).expand_path
else
# we do this for historic reasons, however the cache *should* be the same
# directory whichever user is used and whatever instance of brew is executed
home_cache = Pathname.new("~/Library/Caches/Homebrew").expand_path
if home_cache.directory? && home_cache.writable_real?
home_cache
else
Pathname.new("/Library/Caches/Homebrew").extend Module.new {
def mkpath
unless exist?
super
chmod 0775
end
end
}
end
end
end
HOMEBREW_CACHE = cache
undef cache
# Where brews installed via URL are cached
HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE+"Formula"
unless defined? HOMEBREW_BREW_FILE
HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"] || which("brew").to_s
end
# Where we link under
@@ -22,13 +47,6 @@ else
HOMEBREW_REPOSITORY+"Cellar"
end
# Where downloads (bottles, source tarballs, etc.) are cached
HOMEBREW_CACHE = Pathname.new(ENV["HOMEBREW_CACHE"])
# Where brews installed via URL are cached
HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE/"Formula"
# Where build, postinstall, and test logs of formulae are written to
HOMEBREW_LOGS = Pathname.new(ENV["HOMEBREW_LOGS"] || "~/Library/Logs/Homebrew/").expand_path
HOMEBREW_TEMP = Pathname.new(ENV.fetch("HOMEBREW_TEMP", "/tmp"))
-32
View File
@@ -1,32 +0,0 @@
#: * `linkage` [`--test`] [`--reverse`] <formula>:
#: Checks the library links of an installed formula.
#:
#: Only works on installed formulae. An error is raised if it is run on
#: uninstalled formulae.
#:
#: If `--test` is passed, only display missing libraries and exit with a
#: non-zero exit code if any missing libraries were found.
#:
#: If `--reverse` is passed, print the dylib followed by the binaries
#: which link to it for each library the keg references.
require "os/mac/linkage_checker"
module Homebrew
module_function
def linkage
ARGV.kegs.each do |keg|
ohai "Checking #{keg.name} linkage" if ARGV.kegs.size > 1
result = LinkageChecker.new(keg)
if ARGV.include?("--test")
result.display_test_output
Homebrew.failed = true if result.broken_dylibs?
elsif ARGV.include?("--reverse")
result.display_reverse_output
else
result.display_normal_output
end
end
end
end
+11 -2
View File
@@ -280,8 +280,17 @@ class Pathname
end
def sha256
require "digest/sha2"
incremental_hash(Digest::SHA256)
if MacOS.version == :tiger
sha256_vendored_sha2
else
require "digest/sha2"
incremental_hash(Digest::SHA2)
end
end
def sha256_vendored_sha2
str = Open3.popen3("#{HOMEBREW_REPOSITORY}/Library/Homebrew/vendor/sha256", "-256", self.to_s) {|_, stdout, _| stdout.read.chomp}
str.match(/= ((\d|[a-z])+)/).captures.first
end
def verify_checksum(expected)
+2 -5
View File
@@ -17,7 +17,7 @@ require "extend/leopard" if RUBY_VERSION <= "1.8.6"
ARGV.extend(HomebrewArgvExtension)
HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"]
HOMEBREW_VERSION = "0.9.5"
HOMEBREW_WWW = "https://github.com/mistydemeo/tigerbrew"
require "config"
@@ -43,10 +43,7 @@ else
end
HOMEBREW_GITHUB_API_TOKEN = ENV["HOMEBREW_GITHUB_API_TOKEN"]
HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"]
ruby_version = "#{RUBY_VERSION}#{"-p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL}"
HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{ruby_version}"
HOMEBREW_USER_AGENT = "Tigerbrew #{HOMEBREW_VERSION} (Ruby #{RUBY_VERSION}; #{OS_VERSION})"
HOMEBREW_CURL_ARGS = "-f#LA"
-8
View File
@@ -7,20 +7,12 @@ module OS
/linux/i === RUBY_PLATFORM
end
::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
if OS.mac?
require "os/mac"
ISSUES_URL = "https://github.com/mistydemeo/tigerbrew/wiki/troubleshooting"
PATH_OPEN = "/usr/bin/open"
# compatibility
::MACOS_FULL_VERSION = OS::Mac.full_version.to_s
::MACOS_VERSION = OS::Mac.version.to_s
elsif OS.linux?
ISSUES_URL = "https://github.com/Homebrew/linuxbrew/wiki/troubleshooting"
PATH_OPEN = "xdg-open"
# compatibility
::MACOS_FULL_VERSION = ::MACOS_VERSION = "0"
else
raise "Unknown operating system"
end
+1 -7
View File
@@ -12,13 +12,7 @@ module OS
# This can be compared to numerics, strings, or symbols
# using the standard Ruby Comparable methods.
def version
@version ||= Version.new(full_version.to_s[/10\.\d+/])
end
# This can be compared to numerics, strings, or symbols
# using the standard Ruby Comparable methods.
def full_version
@full_version ||= Version.new(ENV["HOMEBREW_OSX_VERSION"].chomp)
@version ||= Version.new(MACOS_VERSION)
end
def cat
-142
View File
@@ -1,142 +0,0 @@
require "set"
require "keg"
require "formula"
class LinkageChecker
attr_reader :keg, :formula
attr_reader :brewed_dylibs, :system_dylibs, :broken_dylibs, :variable_dylibs
attr_reader :undeclared_deps, :reverse_links
def initialize(keg, formula = nil)
@keg = keg
@formula = formula || resolve_formula(keg)
@brewed_dylibs = Hash.new { |h, k| h[k] = Set.new }
@system_dylibs = Set.new
@broken_dylibs = Set.new
@variable_dylibs = Set.new
@undeclared_deps = []
@reverse_links = Hash.new { |h, k| h[k] = Set.new }
check_dylibs
end
def check_dylibs
@keg.find do |file|
next if file.symlink? || file.directory?
next unless file.dylib? || file.mach_o_executable? || file.mach_o_bundle?
# weakly loaded dylibs may not actually exist on disk, so skip them
# when checking for broken linkage
file.dynamically_linked_libraries.each do |dylib|
@reverse_links[dylib] << file
if dylib.start_with? "@"
@variable_dylibs << dylib
else
begin
owner = Keg.for Pathname.new(dylib)
rescue NotAKegError
@system_dylibs << dylib
rescue Errno::ENOENT
@broken_dylibs << dylib
else
tap = Tab.for_keg(owner).tap
f = if tap.nil? || tap.core_tap?
owner.name
else
"#{tap}/#{owner.name}"
end
@brewed_dylibs[f] << dylib
end
end
end
end
@undeclared_deps = check_undeclared_deps if formula
end
def check_undeclared_deps
filter_out = proc do |dep|
next true if dep.build?
next false unless dep.optional? || dep.recommended?
formula.build.without?(dep)
end
declared_deps = formula.deps.reject { |dep| filter_out.call(dep) }.map(&:name)
declared_requirement_deps = formula.requirements.reject { |req| filter_out.call(req) }.map(&:default_formula).compact
declared_dep_names = (declared_deps + declared_requirement_deps).map { |dep| dep.split("/").last }
undeclared_deps = @brewed_dylibs.keys.select do |full_name|
name = full_name.split("/").last
next false if name == formula.name
!declared_dep_names.include?(name)
end
undeclared_deps.sort do |a, b|
if a.include?("/") && !b.include?("/")
1
elsif !a.include?("/") && b.include?("/")
-1
else
a <=> b
end
end
end
def display_normal_output
display_items "System libraries", @system_dylibs
display_items "Homebrew libraries", @brewed_dylibs
display_items "Variable-referenced libraries", @variable_dylibs
display_items "Missing libraries", @broken_dylibs
display_items "Possible undeclared dependencies", @undeclared_deps
end
def display_reverse_output
return if @reverse_links.empty?
sorted = @reverse_links.sort
sorted.each do |dylib, files|
puts dylib
files.each do |f|
unprefixed = f.to_s.strip_prefix "#{@keg}/"
puts " #{unprefixed}"
end
puts unless dylib == sorted.last[0]
end
end
def display_test_output
display_items "Missing libraries", @broken_dylibs
puts "No broken dylib links" if @broken_dylibs.empty?
end
def broken_dylibs?
!@broken_dylibs.empty?
end
def undeclared_deps?
!@undeclared_deps.empty?
end
private
# Display a list of things.
# Things may either be an array, or a hash of (label -> array)
def display_items(label, things)
return if things.empty?
puts "#{label}:"
if things.is_a? Hash
things.sort.each do |list_label, list|
list.sort.each do |item|
puts " #{item} (#{list_label})"
end
end
else
things.sort.each do |item|
puts " #{item}"
end
end
end
def resolve_formula(keg)
f = Formulary.from_rack(keg.rack)
f.build = Tab.for_keg(keg)
f
rescue FormulaUnavailableError
opoo "Formula unavailable: #{keg.name}"
end
end
+1 -1
View File
@@ -1,7 +1,7 @@
# match expressions when taps are given as ARGS, e.g. someuser/sometap
HOMEBREW_TAP_ARGS_REGEX = %r{^([\w-]+)/(homebrew-)?([\w-]+)$}
# match taps' formulae, e.g. someuser/sometap/someformula
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.@]+)$}
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.]+)$}
# match core's formulae, e.g. homebrew/homebrew/someformula
HOMEBREW_CORE_FORMULA_REGEX = %r{^homebrew/homebrew/([\w+-.]+)$}i
# match taps' directory paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap
+11 -4
View File
@@ -235,15 +235,22 @@ def quiet_system(cmd, *args)
end
def curl(*args)
curl = Pathname.new ENV["HOMEBREW_CURL"]
brewed_curl = HOMEBREW_PREFIX/"opt/curl/bin/curl"
curl_certs = HOMEBREW_PREFIX/"opt/curl-ca-bundle"
use_curl = MacOS.version <= "10.6" && brewed_curl.exist? && curl_certs.exist?
curl = if use_curl
brewed_curl
else
Pathname.new "/usr/bin/curl"
end
raise "#{curl} is not executable" unless curl.exist? && curl.executable?
flags = HOMEBREW_CURL_ARGS
flags = flags.delete("#") if ARGV.verbose?
args = [flags, HOMEBREW_USER_AGENT_CURL, *args]
args = [flags, HOMEBREW_USER_AGENT, *args]
# See https://github.com/Homebrew/homebrew/issues/6103
args << "--insecure" if MacOS.version <= "10.6" if ENV["HOMEBREW_CURL"] == "/usr/bin/curl"
args << "--insecure" if MacOS.version < "10.6" unless use_curl
args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"]
args << "--silent" unless $stdout.tty?
@@ -425,7 +432,7 @@ module GitHub
require "net/https"
headers = {
"User-Agent" => HOMEBREW_USER_AGENT_RUBY,
"User-Agent" => HOMEBREW_USER_AGENT,
"Accept" => "application/vnd.github.v3+json"
}
-57
View File
@@ -1,57 +0,0 @@
# create a lock using `flock(2)`. A name is required as first argument.
# the lock will be automatically unlocked when the shell process quits.
# Noted due to the fixed FD, a shell process can only create one lock.
lock() {
local name="$1"
local lock_dir="$HOMEBREW_PREFIX/var/homebrew/locks"
local lock_file="$lock_dir/$name"
[[ -d "$lock_dir" ]] || mkdir -p "$lock_dir"
if ! [[ -w "$lock_dir" ]]
then
odie <<EOS
Can't create $name lock in $lock_dir!
Fix permissions by running:
sudo chown -R \$(whoami) $HOMEBREW_PREFIX/var/homebrew
EOS
fi
# 200 is the file descriptor used in the lock.
# This FD should be used exclusively for lock purpose.
# Any value except 0(stdin), 1(stdout) and 2(stderr) can do the job.
# Noted, FD is unique per process but it will be shared to subprocess.
# It is recommended to choose a large number to avoid conflicting with
# other FD opened by the script.
#
# close FD first, this is required if parent process holds a different lock.
exec 200>&-
# open the lock file to FD, so the shell process can hold the lock.
exec 200>"$lock_file"
if ! _create_lock 200 "$name"
then
odie <<EOS
Another active Homebrew $name process is already in progress.
Please wait for it to finish or terminate it to continue.
EOS
fi
}
_create_lock() {
local lock_fd="$1"
local name="$2"
local ruby="/usr/bin/ruby"
local python="/usr/bin/python"
[[ -x "$ruby" ]] || ruby="$(which ruby 2>/dev/null)"
[[ -x "$python" ]] || python="$(which python 2>/dev/null)"
if [[ -x "$ruby" ]] && "$ruby" -e "exit(RUBY_VERSION >= '1.8.7')"
then
"$ruby" -e "File.new($lock_fd).flock(File::LOCK_EX | File::LOCK_NB) || exit(1)"
elif [[ -x "$(which flock)" ]]
then
flock -n "$lock_fd"
elif [[ -x "$python" ]]
then
"$python" -c "import fcntl; fcntl.flock($lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)"
else
onoe "Cannot create $name lock, please avoid running Homebrew in parallel."
fi
}
-57
View File
@@ -1,57 +0,0 @@
setup-ruby-path() {
local vendor_dir
local vendor_ruby_current_version
local vendor_ruby_path
local ruby_version_major
vendor_dir="$HOMEBREW_LIBRARY/Homebrew/vendor"
vendor_ruby_current_version="$vendor_dir/portable-ruby/current"
vendor_ruby_path="$vendor_ruby_current_version/bin/ruby"
if [[ -z "$HOMEBREW_DEVELOPER" ]]
then
unset HOMEBREW_RUBY_PATH
fi
if [[ -z "$HOMEBREW_RUBY_PATH" && "$HOMEBREW_COMMAND" != "vendor-install" ]]
then
if [[ -x "$vendor_ruby_path" ]]
then
HOMEBREW_RUBY_PATH="$vendor_ruby_path"
if [[ $(readlink "$vendor_ruby_current_version") != "$(<"$vendor_dir/portable-ruby-version")" ]]
then
if ! brew vendor-install ruby --quiet
then
onoe "Failed to upgrade vendor Ruby."
fi
fi
else
if [[ -n "$HOMEBREW_OSX" ]]
then
HOMEBREW_RUBY_PATH="/usr/bin/ruby"
else
HOMEBREW_RUBY_PATH="$(which ruby)"
fi
if [[ -n "$HOMEBREW_RUBY_PATH" ]]
then
ruby_version_major="$("$HOMEBREW_RUBY_PATH" --version)"
ruby_version_major="${ruby_version_major#ruby }"
ruby_version_major="${ruby_version_major%%.*}"
fi
if [[ "$ruby_version_major" != "2" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" ]]
then
brew vendor-install ruby --quiet
if [[ ! -x "$vendor_ruby_path" ]]
then
odie "Failed to install vendor Ruby."
fi
HOMEBREW_RUBY_PATH="$vendor_ruby_path"
fi
fi
fi
export HOMEBREW_RUBY_PATH
}
-23
View File
@@ -1,23 +0,0 @@
Digest::SHA::PurePerl version 5.95
==================================
Digest::SHA::PurePerl is a complete implementation of the NIST
Secure Hash Standard. It gives Perl programmers a convenient way
to calculate SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224,
and SHA-512/256 message digests. The module can handle all types of
input, including partial-byte data.
DEPENDENCIES
None
COPYRIGHT AND LICENSE
Copyright (C) 2003-2014 Mark Shelor
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Please refer to the Perl Artistic License for details:
http://search.cpan.org/perldoc?perlartistic
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1 +0,0 @@
7.58.0
-1
View File
@@ -1 +0,0 @@
2.3.3
BIN
View File
Binary file not shown.
+28
View File
@@ -0,0 +1,28 @@
AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/
Copyright (c) 2000-2001, Aaron D. Gifford
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-329
View File
@@ -1,329 +0,0 @@
#!/usr/bin/perl
## shasum: filter for computing SHA digests (ref. sha1sum/md5sum)
##
## Copyright (C) 2003-2015 Mark Shelor, All Rights Reserved
##
## Version: 5.95
## Sat Jan 10 12:15:36 MST 2015
## shasum SYNOPSIS adapted from GNU Coreutils sha1sum. Add
## "-a" option for algorithm selection,
## "-U" option for Universal Newlines support,
## "-0" option for reading bit strings, and
## "-p" option for portable digests (to be deprecated).
use strict;
use warnings;
use Fcntl;
use Getopt::Long;
my $POD = <<'END_OF_POD';
=head1 NAME
shasum - Print or Check SHA Checksums
=head1 SYNOPSIS
Usage: shasum [OPTION]... [FILE]...
Print or check SHA checksums.
With no FILE, or when FILE is -, read standard input.
-a, --algorithm 1, 224, 256, 384, 512, 512224, 512256
-b, --binary read in binary mode
-c, --check read SHA sums from the FILEs and check them
-t, --text read in text mode (default)
-U, --UNIVERSAL read in Universal Newlines mode
produces same digest on Windows/Unix/Mac
-0, --01 read in BITS mode
ASCII '0' interpreted as 0-bit,
ASCII '1' interpreted as 1-bit,
all other characters ignored
-p, --portable read in portable mode (to be deprecated)
The following two options are useful only when verifying checksums:
-s, --status don't output anything, status code shows success
-w, --warn warn about improperly formatted checksum lines
-h, --help display this help and exit
-v, --version output version information and exit
When verifying SHA-512/224 or SHA-512/256 checksums, indicate the
algorithm explicitly using the -a option, e.g.
shasum -a 512224 -c checksumfile
The sums are computed as described in FIPS PUB 180-4. When checking,
the input should be a former output of this program. The default
mode is to print a line with checksum, a character indicating type
(`*' for binary, ` ' for text, `U' for UNIVERSAL, `^' for BITS, `?'
for portable), and name for each FILE.
Report shasum bugs to mshelor@cpan.org
=head1 DESCRIPTION
Running I<shasum> is often the quickest way to compute SHA message
digests. The user simply feeds data to the script through files or
standard input, and then collects the results from standard output.
The following command shows how to compute digests for typical inputs
such as the NIST test vector "abc":
perl -e "print qq(abc)" | shasum
Or, if you want to use SHA-256 instead of the default SHA-1, simply say:
perl -e "print qq(abc)" | shasum -a 256
Since I<shasum> mimics the behavior of the combined GNU I<sha1sum>,
I<sha224sum>, I<sha256sum>, I<sha384sum>, and I<sha512sum> programs,
you can install this script as a convenient drop-in replacement.
Unlike the GNU programs, I<shasum> encompasses the full SHA standard by
allowing partial-byte inputs. This is accomplished through the BITS
option (I<-0>). The following example computes the SHA-224 digest of
the 7-bit message I<0001100>:
perl -e "print qq(0001100)" | shasum -0 -a 224
=head1 AUTHOR
Copyright (c) 2003-2015 Mark Shelor <mshelor@cpan.org>.
=head1 SEE ALSO
I<shasum> is implemented using the Perl module L<Digest::SHA> or
L<Digest::SHA::PurePerl>.
=cut
END_OF_POD
my $VERSION = "5.95";
sub usage {
my($err, $msg) = @_;
$msg = "" unless defined $msg;
if ($err) {
warn($msg . "Type shasum -h for help\n");
exit($err);
}
my($USAGE) = $POD =~ /SYNOPSIS(.+?)^=/sm;
$USAGE =~ s/^\s*//;
$USAGE =~ s/\s*$//;
$USAGE =~ s/^ //gm;
print $USAGE, "\n";
exit($err);
}
## Sync stdout and stderr by forcing a flush after every write
select((select(STDOUT), $| = 1)[0]);
select((select(STDERR), $| = 1)[0]);
## Collect options from command line
my ($alg, $binary, $check, $text, $status, $warn, $help, $version);
my ($portable, $BITS, $reverse, $UNIVERSAL, $versions);
eval { Getopt::Long::Configure ("bundling") };
GetOptions(
'b|binary' => \$binary, 'c|check' => \$check,
't|text' => \$text, 'a|algorithm=i' => \$alg,
's|status' => \$status, 'w|warn' => \$warn,
'h|help' => \$help, 'v|version' => \$version,
'p|portable' => \$portable,
'0|01' => \$BITS,
'R|REVERSE' => \$reverse,
'U|UNIVERSAL' => \$UNIVERSAL,
'V|VERSIONS' => \$versions,
) or usage(1, "");
## Deal with help requests and incorrect uses
usage(0)
if $help;
usage(1, "shasum: Ambiguous file mode\n")
if scalar(grep {defined $_}
($binary, $portable, $text, $BITS, $UNIVERSAL)) > 1;
usage(1, "shasum: --warn option used only when verifying checksums\n")
if $warn && !$check;
usage(1, "shasum: --status option used only when verifying checksums\n")
if $status && !$check;
## Try to use Digest::SHA. If not installed, use the slower
## but functionally equivalent Digest::SHA::PurePerl instead.
## If option -R is invoked, reverse the module preference,
## i.e. try Digest::SHA::PurePerl first, then Digest::SHA.
my @MODS = qw(Digest::SHA Digest::SHA::PurePerl);
@MODS[0, 1] = @MODS[1, 0] if $reverse;
my $module;
for (@MODS) {
my $mod = $_;
if (eval "require $mod") {
$module = $mod;
last;
}
}
die "shasum: Unable to find " . join(" or ", @MODS) . "\n"
unless defined $module;
## Default to SHA-256 unless overridden by command line option
$alg = 256 unless defined $alg;
grep { $_ == $alg } (1, 224, 256, 384, 512, 512224, 512256)
or usage(1, "shasum: Unrecognized algorithm\n");
## Display version information if requested
if ($version) {
print "$VERSION\n";
exit(0);
}
if ($versions) {
print "shasum $VERSION\n";
print "$module ", eval "\$${module}::VERSION", "\n";
print "perl ", defined $^V ? sprintf("%vd", $^V) : $], "\n";
exit(0);
}
## Try to figure out if the OS is DOS-like. If it is,
## default to binary mode when reading files, unless
## explicitly overridden by command line "--text" or
## "--UNIVERSAL" or "--portable" options.
my $isDOSish = ($^O =~ /^(MSWin\d\d|os2|dos|mint|cygwin)$/);
if ($isDOSish) { $binary = 1 unless $text || $UNIVERSAL || $portable }
my $modesym = $binary ? '*' : ($UNIVERSAL ? 'U' :
($BITS ? '^' : ($portable ? '?' : ' ')));
## Read from STDIN (-) if no files listed on command line
@ARGV = ("-") unless @ARGV;
## sumfile($file): computes SHA digest of $file
sub sumfile {
my $file = shift;
my $mode = $binary ? 'b' : ($UNIVERSAL ? 'U' :
($BITS ? '0' : ($portable ? 'p' : '')));
my $digest = eval { $module->new($alg)->addfile($file, $mode) };
if ($@) { warn "shasum: $file: $!\n"; return }
$digest->hexdigest;
}
## %len2alg: maps hex digest length to SHA algorithm
my %len2alg = (40 => 1, 56 => 224, 64 => 256, 96 => 384, 128 => 512);
$len2alg{56} = 512224 if $alg == 512224;
$len2alg{64} = 512256 if $alg == 512256;
## unescape: convert backslashed filename to plain filename
sub unescape {
$_ = shift;
s/\\\\/\0/g;
s/\\n/\n/g;
return if /\\/;
s/\0/\\/g;
return $_;
}
## verify: confirm the digest values in a checksum file
sub verify {
my $checkfile = shift;
my ($err, $fmt_errs, $read_errs, $match_errs) = (0, 0, 0, 0);
my ($num_lines, $num_files) = (0, 0);
my ($bslash, $sum, $fname, $rsp, $digest);
local *FH;
$checkfile eq '-' and open(FH, '< -')
and $checkfile = 'standard input'
or sysopen(FH, $checkfile, O_RDONLY)
or die "shasum: $checkfile: $!\n";
while (<FH>) {
next if /^#/; s/\n$//; s/^[ \t]+//; $num_lines++;
$bslash = s/^\\//;
($sum, $modesym, $fname) =
/^([\da-fA-F]+)[ \t]([ *?^U])([^\0]*)/;
$alg = defined $sum ? $len2alg{length($sum)} : undef;
$fname = unescape($fname) if defined $fname && $bslash;
if (grep { ! defined $_ } ($alg, $sum, $modesym, $fname)) {
$alg = 1 unless defined $alg;
warn("shasum: $checkfile: $.: improperly " .
"formatted SHA$alg checksum line\n") if $warn;
$fmt_errs++;
next;
}
$fname =~ s/\r$// unless -e $fname;
$rsp = "$fname: "; $num_files++;
($binary, $text, $UNIVERSAL, $BITS, $portable) =
map { $_ eq $modesym } ('*', ' ', 'U', '^', 'p');
unless ($digest = sumfile($fname)) {
$rsp .= "FAILED open or read\n";
$err = 1; $read_errs++;
}
else {
if (lc($sum) eq $digest) { $rsp .= "OK\n" }
else { $rsp .= "FAILED\n"; $err = 1; $match_errs++ }
}
print $rsp unless $status;
}
close(FH);
unless ($num_files) {
$alg = 1 unless defined $alg;
warn("shasum: $checkfile: no properly formatted " .
"SHA$alg checksum lines found\n");
$err = 1;
}
elsif (! $status) {
warn("shasum: WARNING: $fmt_errs line" . ($fmt_errs>1?
's are':' is') . " improperly formatted\n") if $fmt_errs;
warn("shasum: WARNING: $read_errs listed file" .
($read_errs>1?'s':'') . " could not be read\n") if $read_errs;
warn("shasum: WARNING: $match_errs computed checksum" .
($match_errs>1?'s':'') . " did NOT match\n") if $match_errs;
}
return($err == 0);
}
## Verify or compute SHA checksums of requested files
my($file, $digest);
my $STATUS = 0;
for $file (@ARGV) {
if ($check) { $STATUS = 1 unless verify($file) }
elsif ($digest = sumfile($file)) {
if ($file =~ /[\n\\]/) {
$file =~ s/\\/\\\\/g; $file =~ s/\n/\\n/g;
$digest = "\\$digest";
}
print "$digest $modesym", "$file\n";
}
else { $STATUS = 1 }
}
exit($STATUS)
+5 -21
View File
@@ -116,27 +116,11 @@ begin
# It should never affect external commands so they can handle usage
# arguments themselves.
if empty_argv
$stderr.puts ARGV.usage
exit 1
elsif help_flag
if cmd.nil?
puts ARGV.usage
exit 0
else
# Handle both internal ruby and shell commands
require "cmd/help"
help_text = Homebrew.help_for_command(cmd)
if help_text.nil?
# External command, let it handle help by itself
elsif help_text.empty?
puts "No help available for #{cmd}"
exit 1
else
puts help_text
exit 0
end
end
if empty_argv || (help_flag && (cmd.nil? || internal_cmd))
# TODO: - `brew help cmd` should display subcommand help
require "cmd/help"
puts ARGV.usage
exit ARGV.any? ? 0 : 1
end
if internal_cmd
-219
View File
@@ -1,219 +0,0 @@
HOMEBREW_VERSION="0.9.5"
odie() {
if [[ -t 2 ]] # check whether stderr is a tty.
then
echo -ne "\033[4;31mError\033[0m: " >&2 # highlight Error with underline and red color
else
echo -n "Error: " >&2
fi
if [[ $# -eq 0 ]]
then
/bin/cat >&2
else
echo "$*" >&2
fi
exit 1
}
safe_cd() {
cd "$@" >/dev/null || odie "Error: failed to cd to $*!"
}
brew() {
"$HOMEBREW_BREW_FILE" "$@"
}
# Force UTF-8 to avoid encoding issues for users with broken locale settings.
if [[ "$(locale charmap 2> /dev/null)" != "UTF-8" ]]
then
export LC_ALL="en_US.UTF-8"
fi
# Where we store built products; /usr/local/Cellar if it exists,
# otherwise a Cellar relative to the Repository.
if [[ -d "$HOMEBREW_PREFIX/Cellar" ]]
then
HOMEBREW_CELLAR="$HOMEBREW_PREFIX/Cellar"
else
HOMEBREW_CELLAR="$HOMEBREW_REPOSITORY/Cellar"
fi
case "$*" in
--prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;;
--cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;;
--repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;;
esac
if [[ "$HOMEBREW_PREFIX" = "/" || "$HOMEBREW_PREFIX" = "/usr" ]]
then
# it may work, but I only see pain this route and don't want to support it
odie "Cowardly refusing to continue at this prefix: $HOMEBREW_PREFIX"
fi
# Users may have these set, pointing the system Ruby
# at non-system gem paths
unset GEM_HOME
unset GEM_PATH
HOMEBREW_SYSTEM="$(uname -s)"
case "$HOMEBREW_SYSTEM" in
Darwin) HOMEBREW_OSX="1";;
Linux) HOMEBREW_LINUX="1";;
esac
HOMEBREW_CURL="/usr/bin/curl"
if [[ -n "$HOMEBREW_OSX" ]]
then
HOMEBREW_PROCESSOR="$(uname -p)"
HOMEBREW_PRODUCT="Homebrew"
HOMEBREW_SYSTEM="Macintosh"
# This is i386 even on x86_64 machines
[[ "$HOMEBREW_PROCESSOR" = "i386" ]] && HOMEBREW_PROCESSOR="Intel"
HOMEBREW_OSX_VERSION="$(/usr/bin/sw_vers -productVersion)"
HOMEBREW_OS_VERSION="Mac OS X $HOMEBREW_OSX_VERSION"
HOMEBREW_OSX_VERSION_NUMERIC="$(printf "%02d%02d%02d" $(echo "${HOMEBREW_OSX_VERSION//./ }"))"
else
HOMEBREW_PROCESSOR="$(uname -m)"
HOMEBREW_PRODUCT="${HOMEBREW_SYSTEM}brew"
[[ -n "$HOMEBREW_LINUX" ]] && HOMEBREW_OS_VERSION="$(lsb_release -sd 2>/dev/null)"
: "${HOMEBREW_OS_VERSION:=$(uname -r)}"
fi
HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_VERSION)"
HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | /usr/bin/awk '{print $1"/"$2}')"
HOMEBREW_USER_AGENT_CURL="$HOMEBREW_USER_AGENT $HOMEBREW_CURL_VERSION"
if [[ -z "$HOMEBREW_CACHE" ]]
then
HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew"
fi
# Declared in bin/brew
export HOMEBREW_BREW_FILE
export HOMEBREW_PREFIX
export HOMEBREW_REPOSITORY
export HOMEBREW_LIBRARY
# Declared in brew.sh
export HOMEBREW_VERSION
export HOMEBREW_CACHE
export HOMEBREW_CELLAR
export HOMEBREW_SYSTEM
export HOMEBREW_CURL
export HOMEBREW_OS_VERSION
export HOMEBREW_OSX_VERSION
export HOMEBREW_USER_AGENT
export HOMEBREW_USER_AGENT_CURL
if [[ -n "$HOMEBREW_OSX" ]]
then
if [[ -f "/usr/bin/xcode-select" ]] && [[ "$('/usr/bin/xcode-select' --print-path)" = "/" ]]
then
odie <<EOS
Your xcode-select path is currently set to '/'.
This causes the 'xcrun' tool to hang, and can render Homebrew unusable.
If you are using Xcode, you should:
sudo xcode-select -switch /Applications/Xcode.app
Otherwise, you should:
sudo rm -rf /usr/share/xcode-select
EOS
fi
XCRUN_OUTPUT="$(/usr/bin/xcrun clang 2>&1)"
XCRUN_STATUS="$?"
if [[ "$XCRUN_STATUS" -ne 0 && "$XCRUN_OUTPUT" = *license* ]]
then
odie <<EOS
You have not agreed to the Xcode license. Please resolve this by running:
sudo xcodebuild -license
EOS
fi
fi
# Many Pathname operations use getwd when they shouldn't, and then throw
# odd exceptions. Reduce our support burden by showing a user-friendly error.
if [[ ! -d "$(pwd)" ]]
then
odie "The current working directory doesn't exist, cannot proceed."
fi
if [[ "$1" = -v ]]
then
# Shift the -v to the end of the parameter list
shift
set -- "$@" -v
fi
HOMEBREW_ARG_COUNT="$#"
HOMEBREW_COMMAND="$1"
shift
case "$HOMEBREW_COMMAND" in
ls) HOMEBREW_COMMAND="list";;
homepage) HOMEBREW_COMMAND="home";;
-S) HOMEBREW_COMMAND="search";;
up) HOMEBREW_COMMAND="update";;
ln) HOMEBREW_COMMAND="link";;
instal) HOMEBREW_COMMAND="install";; # gem does the same
rm) HOMEBREW_COMMAND="uninstall";;
remove) HOMEBREW_COMMAND="uninstall";;
configure) HOMEBREW_COMMAND="diy";;
abv) HOMEBREW_COMMAND="info";;
dr) HOMEBREW_COMMAND="doctor";;
--repo) HOMEBREW_COMMAND="--repository";;
environment) HOMEBREW_COMMAND="--env";;
--config) HOMEBREW_COMMAND="config";;
esac
if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]]; then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh"
elif [[ -n "$HOMEBREW_DEVELOPER" && -f "$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" ]]; then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh"
fi
if [[ "$(id -u)" = "0" && "$(/usr/bin/stat -f%u "$HOMEBREW_BREW_FILE")" != "0" ]]
then
case "$HOMEBREW_COMMAND" in
install|reinstall|postinstall|link|pin|update|upgrade|vendor-install|create|migrate|tap|tap-pin|switch)
odie <<EOS
Cowardly refusing to 'sudo brew $HOMEBREW_COMMAND'
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
EOS
;;
esac
fi
# Hide shellcheck complaint:
# shellcheck source=/dev/null
source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh"
setup-ruby-path
if [[ -x "$HOMEBREW_LIBRARY/Homebrew/cmd/vendor-curl.sh" ]]
then
source "$HOMEBREW_LIBRARY/Homebrew/cmd/vendor-curl.sh"
setup-curl-path
fi
# This may have changed after we vendored curl; regenerate it
HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | /usr/bin/awk '{print $1"/"$2}')"
HOMEBREW_USER_AGENT_CURL="$HOMEBREW_USER_AGENT $HOMEBREW_CURL_VERSION"
export HOMEBREW_USER_AGENT_CURL
if [[ -n "$HOMEBREW_BASH_COMMAND" ]]
then
# source rather than executing directly to ensure the entire file is read into
# memory before it is run. This makes running a Bash script behave more like
# a Ruby script and avoids hard-to-debug issues if the Bash script is updated
# at the same time as being run.
#
# Hide shellcheck complaint:
# shellcheck source=/dev/null
source "$HOMEBREW_BASH_COMMAND"
{ "homebrew-$HOMEBREW_COMMAND" "$@"; exit $?; }
else
# Unshift command back into argument list (unless argument list was empty).
[[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@"
exec "$HOMEBREW_RUBY_PATH" -W0 "$HOMEBREW_LIBRARY/brew.rb" "$@"
fi
+2 -2
View File
@@ -22,7 +22,7 @@ What Packages Are Available?
----------------------------
1. You can [browse the Formula directory on GitHub][formula].
2. Or type `brew search` for a list.
3. Or use `brew desc` to browse packages from the command line.
3. Or use [`brew desc`][brew-desc] to browse packages from the command line.
More Documentation
------------------
@@ -49,7 +49,7 @@ Many of the formulae in the repository have been tested, but there are still man
Credits
-------
Homebrew is originally by [mxcl][mxcl], a splendid chap. This fork is by [mistydemeo](https://github.com/mistydemeo), incorporating some code originally written by @sceaga.
Homebrew is originally by [mxcl][mxcl], a splendid chap. This fork is by @mistydemeo, incorporating some code originally written by @sceaga.
License
-------
+33 -5
View File
@@ -1,8 +1,15 @@
#!/bin/bash
#!/bin/sh
chdir() {
cd "$@" >/dev/null
}
# Force UTF-8 to avoid encoding issues for users with broken locale settings.
if [ "$(locale charmap 2> /dev/null)" != "UTF-8" ]
then
export LC_ALL="en_US.UTF-8"
fi
BREW_FILE_DIRECTORY="$(chdir "${0%/*}" && pwd -P)"
HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/${0##*/}"
@@ -14,8 +21,29 @@ then
chdir "$BREW_SYMLINK_DIRECTORY" && pwd -P)"
fi
HOMEBREW_PREFIX="$(chdir "$(dirname "$(dirname "$HOMEBREW_BREW_FILE")")" && pwd -P)"
HOMEBREW_REPOSITORY="$(chdir "$BREW_FILE_DIRECTORY"/../ && pwd -P)"
HOMEBREW_LIBRARY="$(chdir "$BREW_FILE_DIRECTORY"/../Library && pwd -P)"
BREW_LIBRARY_DIRECTORY="$(chdir "$BREW_FILE_DIRECTORY"/../Library && pwd -P)"
source "$HOMEBREW_LIBRARY/brew.sh"
# Users may have these set, pointing the system Ruby
# at non-system gem paths
unset GEM_HOME
unset GEM_PATH
if [ -z "$HOMEBREW_DEVELOPER" ]
then
unset HOMEBREW_RUBY_PATH
fi
if [ -z "$HOMEBREW_RUBY_PATH" ]
then
if [ "$(uname -s)" = "Darwin" ]
then
HOMEBREW_RUBY_PATH="/usr/bin/ruby"
else
HOMEBREW_RUBY_PATH="$(which ruby)"
fi
fi
export HOMEBREW_BREW_FILE
export HOMEBREW_RUBY_PATH
exec "$HOMEBREW_RUBY_PATH" -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"