File: terminalimageviewer.rb

package info (click to toggle)
tiv 1.2.1%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 136 kB
  • sloc: cpp: 539; makefile: 30; ruby: 23
file content (26 lines) | stat: -rw-r--r-- 1,157 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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/refs/tags/v1.1.1.tar.gz"
  sha256 "9a5f5c8688ef8db0e88dfcea6a1ae30da32268a7ab7972ff0de71955a75af0db"
  license "Apache-2.0"
  head "https://github.com/stefanhaustein/TerminalImageViewer.git", branch: "master"
  
  depends_on "imagemagick"

  def install
    cd "src/main/cpp" do
      system "/usr/local/bin/g++-#{Formula["gcc"].version_suffix}", "-std=c++17", "-Wall", "-fpermissive",
             "-fexceptions", "-O2", "-c", "-L/usr/local/opt/gcc/lib/gcc/#{Formula["gcc"].version_suffix}/", "tiv.cpp",
             "-o", "tiv.o"
      system "/usr/local/bin/g++-#{Formula["gcc"].version_suffix}", "tiv.o", "-o", "tiv",
             "-L/usr/local/opt/gcc/lib/gcc/#{Formula["gcc"].version_suffix}/", "-pthread", "-s"
      bin.install "tiv"
    end
  end

  test do
    assert_equal "\e[48;2;0;0;255m\e[38;2;0;0;255m  \e[0m",
                 shell_output("#{bin}/tiv #{test_fixtures("test.png")}").strip
  end
end