Open ghost opened 4 years ago
I am also unable to build VobSub2SRT on MacOS. I think the Homebrew errors here are just an indicator of the failing build overall. I get the same problem without Homebrew. I'm using MacOS Mojave 10.15.5. I also tried making the build changes from https://github.com/ruediger/VobSub2SRT/issues/73 which worked for others (though on older OS versions?) and still get errors:
/Library/Developer/CommandLineTools/usr/bin/make -C build
[ 50%] Built target mplayer
[ 60%] Building CXX object src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o
/VobSub2SRT-master/src/vobsub2srt.c++:218:3: error: use of undeclared identifier 'TessBaseAPI'; did you mean 'tesseract::TessBaseAPI'?
TessBaseAPI::SimpleInit(tess_path, tess_lang, false); // TODO params
^~~~~~~~~~~
tesseract::TessBaseAPI
/usr/local/include/tesseract/baseapi.h:91:16: note: 'tesseract::TessBaseAPI' declared here
class TESS_API TessBaseAPI {
^
/VobSub2SRT-master/src/vobsub2srt.c++:218:16: error: no member named 'SimpleInit' in 'tesseract::TessBaseAPI'
TessBaseAPI::SimpleInit(tess_path, tess_lang, false); // TODO params
~~~~~~~~~~~~~^
/VobSub2SRT-master/src/vobsub2srt.c++:220:5: error: use of undeclared identifier 'TessBaseAPI'; did you mean 'tesseract::TessBaseAPI'?
TessBaseAPI::SetVariable("tessedit_char_blacklist", blacklist.c_str());
^~~~~~~~~~~
tesseract::TessBaseAPI
/usr/local/include/tesseract/baseapi.h:91:16: note: 'tesseract::TessBaseAPI' declared here
class TESS_API TessBaseAPI {
^
/VobSub2SRT-master/src/vobsub2srt.c++:220:18: error: call to non-static member function without an object argument
TessBaseAPI::SetVariable("tessedit_char_blacklist", blacklist.c_str());
~~~~~~~~~~~~~^~~~~~~~~~~
/VobSub2SRT-master/src/vobsub2srt.c++:275:20: error: use of undeclared identifier 'TessBaseAPI'; did you mean 'tesseract::TessBaseAPI'?
char *text = TessBaseAPI::TesseractRect(image, 1, stride, 0, 0, width, height);
^~~~~~~~~~~
tesseract::TessBaseAPI
/usr/local/include/tesseract/baseapi.h:91:16: note: 'tesseract::TessBaseAPI' declared here
class TESS_API TessBaseAPI {
^
/VobSub2SRT-master/src/vobsub2srt.c++:275:33: error: call to non-static member function without an object argument
char *text = TessBaseAPI::TesseractRect(image, 1, stride, 0, 0, width, height);
~~~~~~~~~~~~~^~~~~~~~~~~~~
/VobSub2SRT-master/src/vobsub2srt.c++:314:3: error: use of undeclared identifier 'TessBaseAPI'; did you mean 'tesseract::TessBaseAPI'?
TessBaseAPI::End();
^~~~~~~~~~~
tesseract::TessBaseAPI
/usr/local/include/tesseract/baseapi.h:91:16: note: 'tesseract::TessBaseAPI' declared here
class TESS_API TessBaseAPI {
^
/VobSub2SRT-master/src/vobsub2srt.c++:314:16: error: call to non-static member function without an object argument
TessBaseAPI::End();
~~~~~~~~~~~~~^~~
8 errors generated.
make[3]: *** [src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o] Error 1
make[2]: *** [src/CMakeFiles/vobsub2srt.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
Yup, I have the same problem on Mojave.
==> make install
Last 15 lines from /Users/sel02129/Library/Logs/Homebrew/vobsub2srt/02.make:
/usr/local/include/tesseract/serialis.h:43:41: error: expected ';' after top level declarator
constexpr size_t countof(T const (&)[N]) noexcept {
^
/usr/local/include/tesseract/serialis.h:55:40: error: unknown type name 'size_t'; did you mean 'ssize_t'?
bool DeSerialize(FILE* fp, char* data, size_t n = 1);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_ssize_t.h:31:33: note: 'ssize_t' declared here
typedef __darwin_ssize_t ssize_t;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/CMakeFiles/vobsub2srt.dir/all] Error 2
make: *** [all] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
Traceback (most recent call last):
28: from /usr/local/Homebrew/Library/Homebrew/build.rb:202:in `<main>'
27: from /usr/local/Homebrew/Library/Homebrew/build.rb:118:in `install'
26: from /usr/local/Homebrew/Library/Homebrew/utils.rb:474:in `with_env'
25: from /usr/local/Homebrew/Library/Homebrew/build.rb:123:in `block in install'
24: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1170:in `brew'
23: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2146:in `stage'
22: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `stage'
21: from /usr/local/Homebrew/Library/Homebrew/resource.rb:81:in `stage'
20: from /usr/local/Homebrew/Library/Homebrew/resource.rb:106:in `unpack'
19: from /usr/local/Homebrew/Library/Homebrew/resource.rb:196:in `mktemp'
18: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `run'
17: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `chdir'
16: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `block in run'
15: from /usr/local/Homebrew/Library/Homebrew/resource.rb:197:in `block in mktemp'
14: from /usr/local/Homebrew/Library/Homebrew/resource.rb:111:in `block in unpack'
13: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2171:in `block in stage'
12: from /usr/local/Homebrew/Library/Homebrew/utils.rb:474:in `with_env'
11: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2172:in `block (2 levels) in stage'
10: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1177:in `block in brew'
9: from /usr/local/Homebrew/Library/Homebrew/build.rb:152:in `block (2 levels) in install'
8: from /Users/sel02129/Library/Caches/Homebrew/Formula/vobsub2srt.rb:15:in `install'
7: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2089:in `mkdir'
6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:128:in `cd'
5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:128:in `chdir'
4: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2090:in `block in mkdir'
3: from /Users/sel02129/Library/Caches/Homebrew/Formula/vobsub2srt.rb:17:in `block in install'
2: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1967:in `system'
1: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1967:in `open'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2029:in `block in system': Failed executing: make install (BuildError)
5: from /usr/local/Homebrew/Library/Homebrew/brew.rb:45:in `<main>'
4: from /usr/local/Homebrew/Library/Homebrew/brew.rb:151:in `rescue in <main>'
3: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:406:in `dump'
2: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:352:in `issues'
1: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:356:in `fetch_issues'
/usr/local/Homebrew/Library/Homebrew/utils/github.rb:305:in `issues_for_formula': undefined method `full_name' for nil:NilClass (NoMethodError)
Install instructions for macOS fail. Could somebody fix this?
Traceback (most recent call last):
brew extract
orbrew create
andbrew tap-new
to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError)brew extract
orbrew create
andbrew tap-new
to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError)
Same issue on my MacMini running Mojave:
$ brew install --HEAD https://github.com/ruediger/VobSub2SRT/raw/master/packaging/vobsub2srt.rb
brew extract
orbrew create
andbrew tap-new
to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError)brew extract
orbrew create
andbrew tap-new
to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError)
Since this issue started off with a build error, I opened a new issue:
https://github.com/ruediger/VobSub2SRT/issues/87
to cover the "Non-checksummed download of vobsub2srt formula file from an arbitrary URL is unsupported!" failure.
Has anyone tried building VobSub2SRT on macOS with an older version of Tesseract? If you're using Homebrew to compile, Homebrew will always use the latest version of any requirement for building. Building against Tesseract v3 probably stands a better chance.
Since this project hasn't been updated it awhile, I suspect it assumes an older version of Tesseract. Like this version back from when the--with-all-languages
flag was still supported. Sadly this means it needs to be done manually without homebrew. (or if you're lucky enough to have an unlinked older version of Tesseract previously downloaded by Homebrew that could work)
I think a lot of the problem is that on macOS the compiler defaults to clang instead of gcc.
clang also defaults to an earlier c++ version unless you specifically give it a flag not to: https://stackoverflow.com/questions/45047508/error-unknown-type-name-constexpr-during-make-in-mac-os-x
I've been trying to modify the cmake config to get it to either use gcc or pass in the -std=c++11
flag to clang, but I'm having no luck, mostly because I'm not a cmake user and am not sure how to modify the config. If somebody else could help that would be cool 🙂
There's also this that attempts to show you how to force cmake to use gcc: https://stackoverflow.com/questions/45933732/how-to-specify-a-compiler-in-cmake
I was able to build vobsub2srt on MacOS 14 Sonoma using this fork: https://github.com/leonard-slass/VobSub2SRT You can review the changes compared to this repo here: https://github.com/ruediger/VobSub2SRT/compare/master...leonard-slass:VobSub2SRT:master
You can build and install using brew like so:
wget https://raw.githubusercontent.com/leonard-slass/VobSub2SRT/master/packaging/vobsub2srt.rb
sed -i '' 's/ruediger/leonard-slass/;s/git:/https:/' vobsub2srt.rb
brew install --HEAD vobsub2srt.rb
Last login: Wed Jun 24 15:49:24 on ttys001
The default interactive shell is now zsh. To update your account to use zsh, please run
chsh -s /bin/zsh
. For more details, please visit https://support.apple.com/kb/HT208050. mbp:~ xia$ brew install --HEAD https://github.com/ruediger/VobSub2SRT/raw/master/packaging/vobsub2srt.rb Updating Homebrew... ^CWarning: Calling Non-checksummed download of vobsub2srt formula file from an arbitrary URL is deprecated! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead. ######################################################################## 100.0%-######################################################################## 100.0% ==> Cloning git://github.com/ruediger/VobSub2SRT.git Updating /Users/xiaa/Library/Caches/Homebrew/vobsub2srt--git ==> Checking out branch master Already on 'master' Your branch is up to date with 'origin/master'. HEAD is now at 0ba6e25 Merge pull request #64 from CamJN/master ==> cmake .. ==> make install Last 15 lines from /Users/xiaa/Library/Logs/Homebrew/vobsub2srt/02.make: ^ In file included from /tmp/vobsub2srt-20200624-61427-otjkxz/src/vobsub2srt.c++:27: In file included from /usr/local/include/tesseract/baseapi.h:31: /usr/local/include/tesseract/serialis.h:59:43: error: unknown type name 'size_t'; did you mean 'ssize_t'? bool DeSerialize(FILE fp, int32_t data, size_t n = 1); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_ssize_t.h:31:33: note: 'ssize_t' declared here typedef __darwin_ssize_t ssize_t; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make[2]: [src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [src/CMakeFiles/vobsub2srt.dir/all] Error 2 make: [all] Error 2Do not report this issue to Homebrew/brew or Homebrew/core!
Traceback (most recent call last): 28: from /usr/local/Homebrew/Library/Homebrew/build.rb:202:in'
8: from /usr/local/Homebrew/Library/Homebrew/brew.rb:150:in
<main>' 27: from /usr/local/Homebrew/Library/Homebrew/build.rb:118:in
install' 26: from /usr/local/Homebrew/Library/Homebrew/utils.rb:474:inwith_env' 25: from /usr/local/Homebrew/Library/Homebrew/build.rb:123:in
block in install' 24: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1166:inbrew' 23: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2130:in
stage' 22: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:instage' 21: from /usr/local/Homebrew/Library/Homebrew/resource.rb:81:in
stage' 20: from /usr/local/Homebrew/Library/Homebrew/resource.rb:106:inunpack' 19: from /usr/local/Homebrew/Library/Homebrew/resource.rb:196:in
mktemp' 18: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:inrun' 17: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in
chdir' 16: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:inblock in run' 15: from /usr/local/Homebrew/Library/Homebrew/resource.rb:197:in
block in mktemp' 14: from /usr/local/Homebrew/Library/Homebrew/resource.rb:111:inblock in unpack' 13: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2154:in
block in stage' 12: from /usr/local/Homebrew/Library/Homebrew/utils.rb:474:inwith_env' 11: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2155:in
block (2 levels) in stage' 10: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1173:inblock in brew' 9: from /usr/local/Homebrew/Library/Homebrew/build.rb:152:in
block (2 levels) in install' 8: from /Users/xiaa/Library/Caches/Homebrew/Formula/vobsub2srt.rb:15:ininstall' 7: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2073:in
mkdir' 6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:128:incd' 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:128:in
chdir' 4: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2074:inblock in mkdir' 3: from /Users/xiaa/Library/Caches/Homebrew/Formula/vobsub2srt.rb:17:in
block in install' 2: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1951:insystem' 1: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1951:in
open' /usr/local/Homebrew/Library/Homebrew/formula.rb:2013:inblock in system': Failed executing: make install (BuildError) 9: from /usr/local/Homebrew/Library/Homebrew/brew.rb:45:in
rescue in <main>' 7: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:413:in
dump' 6: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:359:inissues' 5: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:363:in
fetch_issues' 4: from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:299:inissues_for_formula' 3: from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:285:in
search_issues' 2: from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:394:insearch' 1: from /usr/local/Homebrew/Library/Homebrew/utils/github.rb:219:in
open_api' /usr/local/Homebrew/Library/Homebrew/utils/github.rb:267:in `raise_api_error': curl failed! % Total % Received % Xferd Average Speed Time Time Time Current (GitHub::Error) Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (7) Failed to connect to api.github.com port 443: Connection refused mbp:~ xiaa$