66c .print ('>> Installing leptonica' )
77
88install_dir = dependencies_dir
9- url = 'http ://www. leptonica.org/source/ leptonica-1.78 .0.tar.gz'
10- required_version = '1.78 .0'
9+ url = 'https ://github.com/DanBloomberg/ leptonica/releases/download/1.80.0/ leptonica-1.80 .0.tar.gz'
10+ required_version = '1.80 .0'
1111
1212
1313build_type_flag = 'Debug' if build_type == 'debug' else 'Release'
@@ -25,14 +25,14 @@ def check_existing():
2525 return False
2626
2727 if platform .system () == "Windows" :
28- dll = install_dir + '/bin/leptonica-1.78 .0.dll'
29- lib = install_dir + '/lib/leptonica-1.78 .0.lib'
28+ dll = install_dir + '/bin/leptonica-1.80 .0.dll'
29+ lib = install_dir + '/lib/leptonica-1.80 .0.lib'
3030 if not os .path .exists (dll ) or not os .path .exists (lib ):
3131 return False
3232 c .symlink (dll , install_dir + '/bin/leptonica.dll' )
3333 c .symlink (lib , install_dir + '/lib/leptonica.lib' )
3434 elif platform .system () == "Darwin" :
35- lib = install_dir + '/lib/libleptonica.1.78 .0.dylib'
35+ lib = install_dir + '/lib/libleptonica.1.80 .0.dylib'
3636 if not os .path .exists (lib ):
3737 return False
3838 c .symlink (lib , install_dir + '/lib/libleptonica.dylib' )
@@ -49,7 +49,7 @@ def check_existing():
4949 return False
5050
5151 with open (version_file , 'rt' ) as f :
52- existing_version = f .readline ()[22 :28 ] # set(Leptonica_VERSION 1.78 .0)
52+ existing_version = f .readline ()[22 :28 ] # set(Leptonica_VERSION 1.80 .0)
5353 if existing_version != required_version :
5454 return False
5555 return True
@@ -66,12 +66,20 @@ def check_existing():
6666c .extract (archive , '.' )
6767c .symlink (c .get_archive_top_dir (archive ), src_dir )
6868
69+ with open ('{}/CMakeLists.txt' .format (src_dir ), 'r+' ) as f :
70+ data = f .read ()
71+ data = data .replace ('pkg_check_modules(WEBP' , '#pkg_check_modules(WEBP' )
72+ data = data .replace ('if(NOT WEBP' , 'if(FALSE' )
73+ f .seek (0 , os .SEEK_SET )
74+ f .write (data )
75+
6976c .ensure_got_path (install_dir )
7077
7178c .recreate_dir (build_dir )
7279os .chdir (build_dir )
7380
74- cmake_args = '"{}" -DCMAKE_INSTALL_PREFIX="{}"' .format (src_dir , install_dir )
81+ cmake_args = '"{}" -DCMAKE_INSTALL_PREFIX="{}" -DBUILD_SHARED_LIBS=ON \
82+ -DSW_BUILD=OFF' .format (src_dir , install_dir ,)
7583
7684if platform .system () == "Windows" :
7785 env_cmd = c .get_msvc_env_cmd (bitness = bitness , msvc_version = msvc_version )
0 commit comments