homebrew-core/Formula/assimp.rb
Steven Peters 90083b491e Fix brew test linking errors in several formula on 10.10
OS X 10.10 seems to require "-L{lib}" as a C/C++ compiler
argument in order to link properly. This is causing
several brew test failures.

This patch modifies several formula in a single commit
by adding "-L{lib}" to the brew test ENV.cc argument
lists. I manually verified that these specific tests
are failing with the change and passing with it on 10.10.

To identify other formulae that may be subject to this
issue, the following may be used:
~~~
grep -rnI 'ENV\.cc.*test\.c' Library/Formula \
  | grep -v '\-L#{lib}'
~~~

Closes Homebrew/homebrew#35806.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-01-17 22:58:56 -06:00

64 lines
1.8 KiB
Ruby

require "formula"
class Assimp < Formula
homepage "http://assimp.sourceforge.net/"
url "https://downloads.sourceforge.net/project/assimp/assimp-3.1/assimp-3.1.1_no_test_models.zip"
sha1 "d7bc1d12b01d5c7908d85ec9ff6b2d972e565e2d"
version "3.1.1"
head "https://github.com/assimp/assimp.git"
bottle do
cellar :any
revision 1
sha1 "147bc1b92a31526950262c123b2d78d78b092005" => :yosemite
sha1 "a44ef2d43ab074beb0b03196e65df3bf1a8e406b" => :mavericks
sha1 "31bb541f50c5ff22055ce2f608ae88ab4997407c" => :mountain_lion
end
option "without-boost", "Compile without thread safe logging or multithreaded computation if boost isn't installed"
depends_on "cmake" => :build
depends_on "boost" => [:recommended, :build]
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
test do
# Library test.
(testpath/'test.cpp').write <<-EOS.undent
#include <assimp/Importer.hpp>
int main() {
Assimp::Importer importer;
return 0;
}
EOS
system ENV.cc, "test.cpp", "-L#{lib}", "-lassimp", "-o", "test"
system "./test"
# Application test.
(testpath/"test.obj").write <<-EOS.undent
# WaveFront .obj file - a single square based pyramid
# Start a new group:
g MySquareBasedPyramid
# List of vertices:
v -0.5 0 0.5 # Front left.
v 0.5 0 0.5 # Front right.
v 0.5 0 -0.5 # Back right
v -0.5 0 -0.5 # Back left.
v 0 1 0 # Top point (top of pyramid).
# List of faces:
f 4 3 2 1 # Square base (note: normals are placed anti-clockwise).
f 1 2 5 # Triangle on front.
f 3 4 5 # Triangle on back.
f 4 1 5 # Triangle on left side.
f 2 3 5
EOS
system "assimp", "export", testpath/"test.obj", testpath/"test.ply"
end
end