From f78b65c1f375e688c7500f644a1766e48b783933 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 9 Apr 2020 18:13:40 +0800 Subject: [PATCH] Homebrew! Almost forgot to add macOS support --- terminalimageviewer.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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