VobSub2SRT icon indicating copy to clipboard operation
VobSub2SRT copied to clipboard

Build failed on MacOS Mojave with Homebrew

Open martap79 opened this issue 6 years ago • 10 comments

Installing vobsub2srt --HEAD ==> Cloning git://github.com/ruediger/VobSub2SRT.git Cloning into '/Users/marvin/Library/Caches/Homebrew/vobsub2srt--git'... ==> Checking out branch master Already on 'master' Your branch is up to date with 'origin/master'. ==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/vobsub ==> make install Last 15 lines from /Users/marvin/Library/Logs/Homebrew/vobsub2srt/02.make: ^ In file included from /tmp/vobsub2srt-20181107-81806-lxgjcj/src/vobsub2srt.c++:27: In file included from /usr/local/include/tesseract/baseapi.h:32: /usr/local/include/tesseract/serialis.h:60: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.14.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

martap79 avatar Nov 07 '18 15:11 martap79

Also failing on High Sierra (10.13.6).

prov3it avatar Nov 08 '18 18:11 prov3it

I think the problem lies in Tesseract 4's use of the c++ 11 standard, which is not the default c++ standard used by the XCode command line tools. It looks like the cmake configuration files for vobsub2srt have not been updated for Tesseract 4. You can specify that cmake use the c++ 11 standard when building vobsub2srt by changing two files.

CMakeModules/FindTesseract.cmake:

--- FindTesseract.cmake	2018-12-28 21:47:27.000000000 -0500
+++ FindTesseract-20181228.cmake	2018-12-28 21:33:47.000000000 -0500
@@ -44,6 +44,7 @@
 endif()
 
 set(CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR})
+set(CMAKE_REQUIRED_FLAGS "-std=c++11")
 check_cxx_source_compiles(
   "#include \"tesseract/baseapi.h\"
    using namespace tesseract;

and CMakeLists.txt:

--- CMakeLists.txt	2018-12-28 21:17:17.000000000 -0500
+++ CMakeLists-20181228.txt	2018-12-28 21:20:16.000000000 -0500
@@ -3,6 +3,7 @@
 cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
 
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
+set(CMAKE_CXX_STANDARD 11)
 
 if(NOT CMAKE_BUILD_TYPE)
     set(

After applying the two patches above, then running ./configure and make install, I got vobsub2srt to build, install, and work.

quornicus avatar Dec 29 '18 03:12 quornicus

I think the problem lies in Tesseract 4's use of the c++ 11 standard, which is not the default c++ standard used by the XCode command line tools. It looks like the cmake configuration files for vobsub2srt have not been updated for Tesseract 4. You can specify that cmake use the c++ 11 standard when building vobsub2srt by changing two files.

CMakeModules/FindTesseract.cmake:

--- FindTesseract.cmake	2018-12-28 21:47:27.000000000 -0500
+++ FindTesseract-20181228.cmake	2018-12-28 21:33:47.000000000 -0500
@@ -44,6 +44,7 @@
 endif()
 
 set(CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR})
+set(CMAKE_REQUIRED_FLAGS "-std=c++11")
 check_cxx_source_compiles(
   "#include \"tesseract/baseapi.h\"
    using namespace tesseract;

and CMakeLists.txt:

--- CMakeLists.txt	2018-12-28 21:17:17.000000000 -0500
+++ CMakeLists-20181228.txt	2018-12-28 21:20:16.000000000 -0500
@@ -3,6 +3,7 @@
 cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
 
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
+set(CMAKE_CXX_STANDARD 11)
 
 if(NOT CMAKE_BUILD_TYPE)
     set(

After applying the two patches above, then running ./configure and make install, I got vobsub2srt to build, install, and work.

how can I find those files "CMakeModules/FindTesseract.cmake" and "CMakeLists.txt" ? do I need to edit it manually?

esoftplay avatar Jan 16 '19 05:01 esoftplay

I think the problem lies in Tesseract 4's use of the c++ 11 standard, which is not the default c++ standard used by the XCode command line tools. It looks like the cmake configuration files for vobsub2srt have not been updated for Tesseract 4. You can specify that cmake use the c++ 11 standard when building vobsub2srt by changing two files. CMakeModules/FindTesseract.cmake:

--- FindTesseract.cmake	2018-12-28 21:47:27.000000000 -0500
+++ FindTesseract-20181228.cmake	2018-12-28 21:33:47.000000000 -0500
@@ -44,6 +44,7 @@
 endif()
 
 set(CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR})
+set(CMAKE_REQUIRED_FLAGS "-std=c++11")
 check_cxx_source_compiles(
   "#include \"tesseract/baseapi.h\"
    using namespace tesseract;

and CMakeLists.txt:

--- CMakeLists.txt	2018-12-28 21:17:17.000000000 -0500
+++ CMakeLists-20181228.txt	2018-12-28 21:20:16.000000000 -0500
@@ -3,6 +3,7 @@
 cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
 
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
+set(CMAKE_CXX_STANDARD 11)
 
 if(NOT CMAKE_BUILD_TYPE)
     set(

After applying the two patches above, then running ./configure and make install, I got vobsub2srt to build, install, and work.

how can I find those files "CMakeModules/FindTesseract.cmake" and "CMakeLists.txt" ? do I need to edit it manually?

yes

cd /Users/username/Library/Caches/Homebrew/vobsub2srt--git/
nano CMakeModules/FindTesseract.cmake
nano CMakeLists.txt
./configure
make install

creamcast avatar Nov 15 '19 01:11 creamcast

Sorry, I don't exactly understood, I have found the two file and the content si long, what you write as modification is to be add in the end, or replace all content?

paolo-hub avatar Dec 05 '19 12:12 paolo-hub

See the "+" sign next to the code, just add that code without the plus sign. In the first file it is about line 46, and the second about line five. I did it and the solution works.

gorillatronxx avatar Dec 12 '19 18:12 gorillatronxx

I patched it for you @paolo-hub so just type:

brew install --HEAD https://github.com/brianchandotcom/VobSub2SRT/raw/master/packaging/vobsub2srt.rb

Works for me on Mojave.

brianchandotcom avatar Dec 20 '19 00:12 brianchandotcom

Many thanks!

paolo-hub avatar Dec 20 '19 07:12 paolo-hub

Thank you, thank you, thank you! I was tearing my hair out on this one.

rimmel avatar Dec 27 '19 18:12 rimmel

Fails on High Sierra:

$ brew install --HEAD https://github.com/ruediger/VobSub2SRT/raw/master/packaging/vobsub2srt.rb Traceback (most recent call last): 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 vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError) 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 vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError)

mrobe avatar Feb 06 '21 03:02 mrobe