homebrew-core/Formula/libraw.rb

51 lines
1.6 KiB
Ruby

class Libraw < Formula
desc "Library for reading RAW files from digital photo cameras"
homepage "https://www.libraw.org/"
url "https://www.libraw.org/data/LibRaw-0.20.0.tar.gz"
sha256 "1f0a383da2ce9f409087facd28261decbf6be72cc90c78cd003b0766e4d694a3"
license any_of: ["LGPL-2.1-only", "CDDL-1.0"]
livecheck do
url "https://www.libraw.org/download/"
regex(/href=.*?LibRaw[._-]v?(\d+(?:\.\d+)*)\.t/i)
end
bottle do
cellar :any
sha256 "b1ca92d6627af7e3f7eb67683da5d5e911298b2e3c45c20d233e9beaa0ab8d44" => :catalina
sha256 "5e016ab1fe114cb8e9d272aeb7f0135222ac56715f8326f87a3d2f81f5ab2d9e" => :mojave
sha256 "8a41cdb86d8af0121493d810cebfcecde17fc39cc4e73645a3f485b9fd66274f" => :high_sierra
end
depends_on "pkg-config" => :build
depends_on "jasper"
depends_on "jpeg"
depends_on "libomp"
depends_on "little-cms2"
resource "librawtestfile" do
url "https://www.rawsamples.ch/raws/nikon/d1/RAW_NIKON_D1.NEF"
sha256 "7886d8b0e1257897faa7404b98fe1086ee2d95606531b6285aed83a0939b768f"
end
def install
system "./configure", "--prefix=#{prefix}",
"--disable-dependency-tracking",
"ac_cv_prog_c_openmp=-Xpreprocessor -fopenmp",
"ac_cv_prog_cxx_openmp=-Xpreprocessor -fopenmp",
"LDFLAGS=-lomp"
system "make"
system "make", "install"
doc.install Dir["doc/*"]
prefix.install "samples"
end
test do
resource("librawtestfile").stage do
filename = "RAW_NIKON_D1.NEF"
system "#{bin}/raw-identify", "-u", filename
system "#{bin}/simple_dcraw", "-v", "-T", filename
end
end
end