homebrew-core/Formula/devil.rb

63 lines
1.9 KiB
Ruby

class Devil < Formula
desc "Cross-platform image library"
homepage "https://sourceforge.net/projects/openil/"
revision 1
head "https://github.com/DentonW/DevIL.git"
stable do
url "https://downloads.sourceforge.net/project/openil/DevIL/1.8.0/DevIL-1.8.0.tar.gz"
sha256 "0075973ee7dd89f0507873e2580ac78336452d29d34a07134b208f44e2feb709"
# jpeg 9 compatibility
# Upstream commit from 3 Jan 2017 "Fixed int to boolean conversion error
# under Linux"
patch do
url "https://github.com/DentonW/DevIL/commit/41fcabbe.patch?full_index=1"
sha256 "324dc09896164bef75bb82b37981cc30dfecf4f1c2386c695bb7e92a2bb8154d"
end
# jpeg 9 compatibility
# Upstream commit from 7 Jan 2017 "Fixing boolean compilation errors under
# Linux / MacOS, issue #48 at https://github.com/DentonW/DevIL/issues/48"
patch do
url "https://github.com/DentonW/DevIL/commit/4a2d7822.patch?full_index=1"
sha256 "7e74a4366ef485beea1c4285f2b371b6bfa0e2513b83d4d45e4e120690c93f1d"
end
end
bottle do
cellar :any
sha256 "7cb8354e26e1d30503c5f232f70c45fad049be1b1a341fa5cc99cb57741c4e61" => :high_sierra
sha256 "25bd964db15fdfa4085b73bd1014044f36b877285db451089b4fa7928b02d555" => :sierra
sha256 "d3821710ef1409df56d15f6e277e3863abfbf568517f57a83eeafccd02afac2b" => :el_capitan
sha256 "5812c01a10936b7f7083d82f2a39d509fe630e41b78e2164f0482ab558026c69" => :yosemite
end
depends_on "cmake" => :build
depends_on "jasper"
depends_on "jpeg"
depends_on "libpng"
depends_on "libtiff"
depends_on "little-cms2"
def install
cd "DevIL" do
system "cmake", ".", *std_cmake_args
system "make", "install"
end
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <IL/il.h>
int main() {
ilInit();
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-I#{include}",
"-L#{lib}", "-lIL", "-lILU"
system "./test"
end
end