45 lines
1.5 KiB
Ruby
45 lines
1.5 KiB
Ruby
class Pdfsandwich < Formula
|
|
desc "Generate sandwich OCR PDFs from scanned file"
|
|
homepage "http://www.tobias-elze.de/pdfsandwich/"
|
|
url "https://downloads.sourceforge.net/project/pdfsandwich/pdfsandwich%200.1.7/pdfsandwich-0.1.7.tar.bz2"
|
|
sha256 "9795ffea84b9b6b501f38d49a4620cf0469ddf15aac31bac6dbdc9ec1716fa39"
|
|
revision 2
|
|
head "https://svn.code.sf.net/p/pdfsandwich/code/trunk/src"
|
|
|
|
livecheck do
|
|
url :stable
|
|
end
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "f3447cdc4b55c92559cdd98cab1e94c077be490e6e233c8c4cc9d0fd3f5e4c2c" => :catalina
|
|
sha256 "87c031a295045f43cc24f5c4e0c4efac50125cd87d2f072d31466e4e7fb05923" => :mojave
|
|
sha256 "19968ba90f012e29f28e0af81f68b6828d83a987e67e862c2a04545d9163d375" => :high_sierra
|
|
end
|
|
|
|
depends_on "gawk" => :build
|
|
depends_on "ocaml" => :build
|
|
depends_on "exact-image"
|
|
depends_on "ghostscript"
|
|
depends_on "imagemagick"
|
|
depends_on "poppler"
|
|
depends_on "tesseract"
|
|
depends_on "unpaper"
|
|
|
|
def install
|
|
system "./configure", "--disable-debug",
|
|
"--disable-dependency-tracking",
|
|
"--prefix=#{prefix}"
|
|
system "make"
|
|
system "make", "install"
|
|
bin.env_script_all_files(libexec/"bin", PATH: "#{Formula["poppler"].opt_bin}:$PATH")
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/pdfsandwich", "-o", testpath/"test_ocr.pdf",
|
|
test_fixtures("test.pdf")
|
|
assert_predicate testpath/"test_ocr.pdf", :exist?,
|
|
"Failed to create ocr file"
|
|
end
|
|
end
|