Skip to content

Commit

Permalink
ode: revert from cmake to autotools, disable demos
Browse files Browse the repository at this point in the history
The switch to use cmake in Homebrew#167158 changed the configuration
options in a way that affects downstream users, so this
reverts that change until cmake can be used with the same
configuration.

Also use the `--disable-demos` argument.
  • Loading branch information
scpeters committed Apr 1, 2024
1 parent 7f664cb commit bb18fec
Showing 1 changed file with 45 additions and 10 deletions.
55 changes: 45 additions & 10 deletions Formula/o/ode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Ode < Formula
url "https://bitbucket.org/odedevs/ode/downloads/ode-0.16.5.tar.gz"
sha256 "ba875edd164570958795eeaa70f14853bfc34cc9871f8adde8da47e12bd54679"
license any_of: ["LGPL-2.1-or-later", "BSD-3-Clause"]
revision 1
head "https://bitbucket.org/odedevs/ode.git", branch: "master"

bottle do
Expand All @@ -16,21 +17,28 @@ class Ode < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "389509a9254588ea10f1e0d888d7ed487ed509de9a07fff79cdee31ed4c856d5"
end

depends_on "cmake" => :build
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "libccd"

on_linux do
depends_on "mesa"
depends_on "mesa-glu"
end
# Fix -flat_namespace being used on Big Sur and later.
# We patch `libtool.m4` and not `configure` because we call `./bootstrap`.
patch :DATA

def install
args = []
args << "-DOPENGL_INCLUDE_DIR=#{Formula["mesa"].include}" if OS.linux?
inreplace "bootstrap", "libtoolize", "glibtoolize"
system "./bootstrap"

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
system "./configure", "--prefix=#{prefix}",
"--enable-libccd",
"--enable-shared",
"--disable-static",
"--disable-demos",
"--enable-double-precision"
system "make"
system "make", "install"
end

test do
Expand All @@ -48,3 +56,30 @@ def install
system "./test"
end
end

__END__
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 10ab284..bfc1d56 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1067,16 +1067,11 @@ _LT_EOF
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]][[,.]]*)
+ darwin*)
+ case ${MACOSX_DEPLOYMENT_TARGET},$host in
+ 10.[[012]],*|,*powerpc*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
+ *)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;

0 comments on commit bb18fec

Please sign in to comment.