2020-04-09 11:57:30 +02:00
|
|
|
class Terminalimageviewer < Formula
|
|
|
|
desc "Display images in a terminal using block graphic characters"
|
|
|
|
homepage "https://github.com/stefanhaustein/TerminalImageViewer"
|
|
|
|
url "https://github.com/stefanhaustein/TerminalImageViewer/archive/v1.0.0.tar.gz"
|
|
|
|
sha256 "d28c5746d25d83ea707db52b54288c4fc1851c642ae021951967e69296450c8c"
|
|
|
|
head "https://github.com/stefanhaustein/TerminalImageViewer.git"
|
2020-04-09 12:13:40 +02:00
|
|
|
depends_on "gcc" => :build unless OS.linux?
|
2020-04-09 11:57:30 +02:00
|
|
|
depends_on "imagemagick"
|
|
|
|
|
|
|
|
def install
|
|
|
|
cd "src/main/cpp" do
|
|
|
|
system "make"
|
2020-04-09 12:13:40 +02:00
|
|
|
if OS.mac?
|
2020-07-07 12:52:39 +02:00
|
|
|
# No expermimental/filesystem.h on mac.
|
|
|
|
system "/usr/local/bin/gcc-#{Formula["gcc"].version_suffix}", "-std=c++17",
|
2020-04-09 12:13:40 +02:00
|
|
|
"-Wall",
|
|
|
|
"-fpermissive",
|
|
|
|
"-fexceptions",
|
|
|
|
"-O2", "-c",
|
2020-07-07 12:52:39 +02:00
|
|
|
"-L/usr/local/opt/gcc/lib/gcc/10/",
|
2020-04-09 12:13:40 +02:00
|
|
|
"tiv.cpp", "-o", "tiv.o"
|
2020-07-07 12:52:39 +02:00
|
|
|
system "/usr/local/bin/gcc-#{Formula["gcc"].version_suffix}", "tiv.o", "-o",
|
|
|
|
"tiv", "-L/usr/local/opt/gcc/lib/gcc/10/",
|
2020-04-09 12:13:40 +02:00
|
|
|
"-pthread", "-s"
|
|
|
|
else
|
|
|
|
system "make"
|
|
|
|
end
|
2020-04-09 11:57:30 +02:00
|
|
|
bin.install "tiv"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
# Downloads a public domain test file from wikimedia commons and displays it.
|
|
|
|
# For some reason, when you redirect the output it is blank.
|
|
|
|
assert_equal "",
|
|
|
|
shell_output("#{bin}/tiv -0 https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png").strip
|
|
|
|
end
|
|
|
|
end
|