stefanhaustein / TerminalImageViewer

Small C++ program to display images in a (modern) terminal using RGB ANSI codes and unicode block graphics characters
Other
1.56k stars 111 forks source link

homebrew install not working #95

Closed Mellbourn closed 2 years ago

Mellbourn commented 3 years ago

The suggested command

brew install https://raw.githubusercontent.com/stefanhaustein/TerminalImageViewer/master/terminalimageviewer.rb

Results in the following message for me

`brew extract` or `brew create` and `brew tap-new` to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of terminalimageviewer formula file from an arbitrary URL is unsupported!  (UsageError)
aaronliu0130 commented 3 years ago
Option 1:
    brew tap stefanhaustein/TerminalImageViewer https://github.com/stefanhaustein/TerminalImageViewer
    brew install terminalimageviewer

Option 2(deprecated):
    brew install https://raw.githubusercontent.com/stefanhaustein/TerminalImageViewer/master/terminalimageviewer.rb

This is from the pul request #89 . For some reason the owner is being lazy to review it. Use option 1 @Mellbourn

stefanhaustein commented 3 years ago

Thanks for the patch and sorry for the delay!

Mellbourn commented 3 years ago

After executing

brew tap stefanhaustein/TerminalImageViewer https://github.com/stefanhaustein/TerminalImageViewer
brew install terminalimageviewer

I got

==> Installing stefanhaustein/terminalimageviewer/terminalimageviewer
==> make
Last 15 lines from /Users/klas.mellbourn/Library/Logs/Homebrew/terminalimageviewer/01.make:
2021-03-14 12:40:59 +0100

make

clang++ -O2 -fpermissive -std=c++17 -Wall -fexceptions   -c -o tiv.o tiv.cpp
clang++ -pthread tiv.o -o tiv  -lstdc++fs
ld: library not found for -lstdc++fs
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tiv] Error 1

Do not report this issue to Homebrew/brew or Homebrew/core!

Traceback (most recent call last):
        29: from /opt/homebrew/Library/Homebrew/build.rb:227:in `<main>'
        28: from /opt/homebrew/Library/Homebrew/build.rb:134:in `install'
        27: from /opt/homebrew/Library/Homebrew/utils.rb:550:in `with_env'
        26: from /opt/homebrew/Library/Homebrew/build.rb:139:in `block in install'
        25: from /opt/homebrew/Library/Homebrew/formula.rb:1216:in `brew'
        24: from /opt/homebrew/Library/Homebrew/formula.rb:2241:in `stage'
        23: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `stage'
        22: from /opt/homebrew/Library/Homebrew/resource.rb:91:in `stage'
        21: from /opt/homebrew/Library/Homebrew/resource.rb:116:in `unpack'
        20: from /opt/homebrew/Library/Homebrew/resource.rb:198:in `mktemp'
        19: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `run'
        18: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
        17: from /opt/homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
        16: from /opt/homebrew/Library/Homebrew/resource.rb:117:in `block in unpack'
        15: from /opt/homebrew/Library/Homebrew/download_strategy.rb:85:in `stage'
        14: from /opt/homebrew/Library/Homebrew/download_strategy.rb:98:in `chdir'
        13: from /opt/homebrew/Library/Homebrew/download_strategy.rb:98:in `chdir'
        12: from /opt/homebrew/Library/Homebrew/resource.rb:121:in `block (2 levels) in unpack'
        11: from /opt/homebrew/Library/Homebrew/formula.rb:2261:in `block in stage'
        10: from /opt/homebrew/Library/Homebrew/utils.rb:550:in `with_env'
         9: from /opt/homebrew/Library/Homebrew/formula.rb:2262:in `block (2 levels) in stage'
         8: from /opt/homebrew/Library/Homebrew/formula.rb:1223:in `block in brew'
         7: from /opt/homebrew/Library/Homebrew/build.rb:175:in `block (2 levels) in install'
         6: from /opt/homebrew/Library/Taps/stefanhaustein/homebrew-terminalimageviewer/terminalimageviewer.rb:11:in `install'
         5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:128:in `cd'
         4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:128:in `chdir'
         3: from /opt/homebrew/Library/Taps/stefanhaustein/homebrew-terminalimageviewer/terminalimageviewer.rb:12:in `block in install'
         2: from /opt/homebrew/Library/Homebrew/formula.rb:2048:in `system'
         1: from /opt/homebrew/Library/Homebrew/formula.rb:2048:in `open'
/opt/homebrew/Library/Homebrew/formula.rb:2112:in `block in system': Failed executing: make (BuildError)
        9: from /opt/homebrew/Library/Homebrew/brew.rb:155:in `<main>'
        8: from /opt/homebrew/Library/Homebrew/brew.rb:167:in `rescue in <main>'
        7: from /opt/homebrew/Library/Homebrew/exceptions.rb:475:in `dump'
        6: from /opt/homebrew/Library/Homebrew/exceptions.rb:421:in `issues'
        5: from /opt/homebrew/Library/Homebrew/exceptions.rb:425:in `fetch_issues'
        4: from /opt/homebrew/Library/Homebrew/utils/github.rb:67:in `issues_for_formula'
        3: from /opt/homebrew/Library/Homebrew/utils/github.rb:36:in `search_issues'
        2: from /opt/homebrew/Library/Homebrew/utils/github.rb:165:in `search'
        1: from /opt/homebrew/Library/Homebrew/utils/github/api.rb:237:in `open_rest'
/opt/homebrew/Library/Homebrew/utils/github/api.rb:298:in `raise_error': Validation Failed: [{"message"=>"The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.", "resource"=>"Search", "field"=>"q", "code"=>"invalid"}] (GitHub::API::ValidationFailedError)

This is on a Mac mini 2020 (M1) without Rosetta 2 installed, running Big Sur 11.2.3.

uname -a
Darwin Klass-Mac-mini.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64
aaronliu0130 commented 3 years ago

It seems like homebrew is not recognizing your apple silicon mac as a mac for some reason.

aaronliu0130 commented 3 years ago

Have you tried brew update and brew doctor? Try brew install gcc and /usr/local/bin/gcc-10 -O2 -fpermissive -std=c++17 -Wall -fexceptions -L/usr/local/opt/gcc/lib/gcc/10/ -c -o tiv.o tiv.cpp and /usr/local/bin/gcc-10 -pthread tiv.o -o tiv -L/usr/local/opt/gcc/lib/gcc/10/ if so. Make sure you are in the project's src/main/cpp path before that.

Mellbourn commented 3 years ago

brew doctor reports no problem. I've run brew update several times, it works fine. I have installed lots of other formulas using homebrew. In what folder should I run those gcc commands? I can't find any tiv folder.

aaronliu0130 commented 3 years ago

brew doctor reports no problem. I've run brew update several times, it works fine. I have installed lots of other formulas using homebrew. In what folder should I run those gcc commands? I can't find any tiv folder.

@Mellbourn "Make sure you are in the project's src/main/cpp path before that."

Mellbourn commented 3 years ago

@Mellbourn "Make sure you are in the project's src/main/cpp path before that."

@aaronliu0130 how does the src/main/cpp path start? "I can't find any tiv folder"

aaronliu0130 commented 3 years ago

@Mellbourn I said nothing about some "tiv folder", I said to run the command in the project's src/main/cpp path.

mmahmoudian commented 3 years ago

@aaronliu0130 I'm also confused about your comment. Would you please give a short step-by-step list for what should be done? Should we first clone this repo and then go to the src/main/cpp subfolder, or we should go to the folder in which brew clones?

aaronliu0130 commented 3 years ago

@aaronliu0130 I'm also confused about your comment. Would you please give a short step-by-step list for what should be done? Should we first clone this repo and then go to the src/main/cpp subfolder, or we should go to the folder in which brew clones?

@mmahmoudian @Mellbourn Sorry for the confusion, here it is:

  1. brew install gcc
  2. Clone this repo or download the archive from GitHub
  3. cd src/main/cpp
  4. /usr/local/bin/gcc-10 -O2 -fpermissive -std=c++17 -Wall -fexceptions -L/usr/local/opt/gcc/lib/gcc/10/ -c -o tiv.o tiv.cpp
    /usr/local/bin/gcc-10 -pthread tiv.o -o tiv -L/usr/local/opt/gcc/lib/gcc/10/
  5. Report results
stefanhaustein commented 3 years ago

What is the state of this?

Is this still an issue?

aaronliu0130 commented 2 years ago

@Mellbourn @mmahmoudian Does newest homebrew install from core or this repo have issues?

Mellbourn commented 2 years ago

Latest homebrew install from core works great. Thanks!

mmahmoudian commented 2 years ago

I don't have access to a Mac for the time being, therefore I cannot test. Sorry, and thanks for the efforts. 👍🏼