diff --git a/terminalimageviewer.rb b/terminalimageviewer.rb index 1231af6..0353528 100644 --- a/terminalimageviewer.rb +++ b/terminalimageviewer.rb @@ -4,12 +4,26 @@ class Terminalimageviewer < Formula url "https://github.com/stefanhaustein/TerminalImageViewer/archive/v1.0.0.tar.gz" sha256 "d28c5746d25d83ea707db52b54288c4fc1851c642ae021951967e69296450c8c" head "https://github.com/stefanhaustein/TerminalImageViewer.git" + depends_on "gcc" => :build unless OS.linux? depends_on "imagemagick" def install cd "src/main/cpp" do - # No expermimental/filesystem.h on clang system "make" + if OS.mac? + # No expermimental/filesystem.h on mac + system "#{Formula["gcc"].opt_bin}/gcc-#{Formula["gcc"].version_suffix}", "-std=c++17", + "-Wall", + "-fpermissive", + "-fexceptions", + "-O2", "-c", + "tiv.cpp", "-o", "tiv.o" + system "#{Formula["gcc"].opt_bin}/gcc-#{Formula["gcc"].version_suffix}", "tiv.o", "-o", + "tiv", "-lstdc++fs", + "-pthread", "-s" + else + system "make" + end bin.install "tiv" end end