46 lines
1.5 KiB
Ruby
46 lines
1.5 KiB
Ruby
class Jasper < Formula
|
|
desc "Library for manipulating JPEG-2000 images"
|
|
homepage "https://www.ece.uvic.ca/~frodo/jasper/"
|
|
url "https://github.com/mdadams/jasper/archive/version-2.0.22.tar.gz"
|
|
sha256 "afc4166bff29b8a0dc46ed5e8d6a208d7976fccfd0b1146e3400c8b2948794a2"
|
|
license "JasPer-2.0"
|
|
|
|
bottle do
|
|
sha256 "590c8f74a4c56cfa073ea1f0dce947f078629c950e0922c0b390cc9335ec041a" => :catalina
|
|
sha256 "42ab71f49df2b4630532a5cc69376e422505d7ffa38b92503aa690d96f8b5244" => :mojave
|
|
sha256 "609bd3da5552b7990456428c1f0005fc0a86d55590199c88a78e8f2504708907" => :high_sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "jpeg"
|
|
|
|
def install
|
|
mkdir "build" do
|
|
# Make sure macOS's GLUT.framework is used, not XQuartz or freeglut
|
|
# Reported to CMake upstream 4 Apr 2016 https://gitlab.kitware.com/cmake/cmake/issues/16045
|
|
glut_lib = "#{MacOS.sdk_path}/System/Library/Frameworks/GLUT.framework"
|
|
|
|
system "cmake", "..",
|
|
"-DGLUT_glut_LIBRARY=#{glut_lib}",
|
|
"-DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=false",
|
|
*std_cmake_args
|
|
system "make"
|
|
system "make", "install"
|
|
system "make", "clean"
|
|
|
|
system "cmake", "..",
|
|
"-DGLUT_glut_LIBRARY=#{glut_lib}",
|
|
"-DJAS_ENABLE_SHARED=OFF",
|
|
*std_cmake_args
|
|
system "make"
|
|
lib.install "src/libjasper/libjasper.a"
|
|
end
|
|
end
|
|
|
|
test do
|
|
system bin/"jasper", "--input", test_fixtures("test.jpg"),
|
|
"--output", "test.bmp"
|
|
assert_predicate testpath/"test.bmp", :exist?
|
|
end
|
|
end
|