Skip to content

Commit

Permalink
gmp 6.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fxcoudert authored and SMillerDev committed Oct 15, 2023
1 parent 1a88cd5 commit 9509af9
Showing 1 changed file with 17 additions and 31 deletions.
48 changes: 17 additions & 31 deletions Formula/g/gmp.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
class Gmp < Formula
desc "GNU multiple precision arithmetic library"
homepage "https://gmplib.org/"
# gmplib.org blocks GitHub server IPs, so it should not be the primary URL
url "https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz"
mirror "https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz"
sha256 "a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898"
license any_of: ["LGPL-3.0-or-later", "GPL-2.0-or-later"]
revision 1

stable do
url "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz"
mirror "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz"
sha256 "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2"

# Fix -flat_namespace being used on Big Sur and later.
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff"
sha256 "35acd6aebc19843f1a2b3a63e880baceb0f5278ab1ace661e57a502d9d78c93c"
end
end
head "https://gmplib.org/repo/gmp/", using: :hg

livecheck do
url "https://gmplib.org/download/gmp/"
Expand All @@ -35,32 +27,26 @@ class Gmp < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "786ae29f0c0b06ea86e42bd9c6ac2c49bd5757da037dead7053e8bd612c4cf8c"
end

head do
url "https://gmplib.org/repo/gmp/", using: :hg
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build

uses_from_macos "m4" => :build

# Prevent crash on macOS 12 betas with release gmp 6.2.1, can be removed after the next gmp release.
patch do
url "https://gmplib.org/repo/gmp/raw-rev/5f32dbc41afc"
sha256 "a44ef57903b240df6fde6c9d2fe40063f785995c43b6bfc7a237c571f53613e0"
end

def install
system "./.bootstrap" if build.head?

args = std_configure_args
args << "--enable-cxx"
if build.head?
system "./.bootstrap"
else
# Regenerate configure to avoid flat namespace linking
# Reported by email: https://gmplib.org/list-archives/gmp-bugs/2023-July/thread.html
# Remove in next version
system "autoreconf", "-i", "-s"
end

# Enable --with-pic to avoid linking issues with the static library
args << "--with-pic"
args = std_configure_args + %w[--enable-cxx --with-pic]

cpu = Hardware::CPU.arm? ? "aarch64" : Hardware.oldest_cpu

if OS.mac?
args << "--build=#{cpu}-apple-darwin#{OS.kernel_version.major}"
else
Expand Down

0 comments on commit 9509af9

Please sign in to comment.