update tess (#3538)

* update tess

* update leptonica

* fix leptonica

* fix leptonica dep

* fix LeptonicaConfig.cmake

* patch leptonica .cmake

* leptonica: fix x86

* leptonica: imrpove xmake.lua

* leptonica: patch cmake

* tesseract: add packagedeps

---------

Co-authored-by: star9029 <hengxings783@gmail.com>
pull/3588/head
ruki 8 months ago committed by GitHub
parent e663848c66
commit 9a50a5e5f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 41
      packages/l/leptonica/xmake.lua
  2. 13
      packages/t/tesseract/xmake.lua
  3. 3
      scripts/autoupdate.lua

@ -1,30 +1,51 @@
package("leptonica")
set_homepage("http://www.leptonica.org/")
set_description("Leptonica is a pedagogically-oriented open source site containing software that is broadly useful for image processing and image analysis applications.")
set_license("BSD-2-Clause")
add_urls("https://github.com/DanBloomberg/leptonica/archive/$(version).tar.gz",
add_urls("https://github.com/DanBloomberg/leptonica/releases/download/$(version)/leptonica-$(version).tar.gz",
"https://github.com/DanBloomberg/leptonica.git")
add_versions("1.80.0", "3952b974ec057d24267aae48c54bca68ead8275604bf084a73a4b953ff79196e")
add_versions("1.81.1", "e9dd2100194843a20bbb980ad8b94610558d47f623861bc80ac967f2d2ecb879")
add_versions("1.82.0", "40fa9ac1e815b91e0fa73f0737e60c9eec433a95fa123f95f2573dd3127dd669")
add_versions("1.80.0", "ec9c46c2aefbb960fb6a6b7f800fe39de48343437b6ce08e30a8d9688ed14ba4")
add_versions("1.81.1", "0f4eb315e9bdddd797f4c55fdea4e1f45fca7e3b358a2fc693fd957ce2c43ca9")
add_versions("1.82.0", "155302ee914668c27b6fe3ca9ff2da63b245f6d62f3061c8f27563774b8ae2d6")
add_versions("1.84.1", "2b3e1254b1cca381e77c819b59ca99774ff43530209b9aeb511e1d46588a64f6")
add_deps("cmake")
add_deps("libwebp", {configs = {libwebpmux = true}})
add_deps("zlib", "libtiff", "libpng", "libjpeg", "giflib")
on_load("windows", "macosx", "linux", function (package)
if package:config("shared") then
package:add("defines", "LIBLEPT_IMPORTS")
add_deps("zlib", "libtiff", "libpng", "libjpeg", "giflib", "openjpeg")
on_load("windows", function (package)
import("core.tool.toolchain")
local msvc = package:toolchain("msvc") or toolchain.load("msvc", {plat = package:plat(), arch = package:arch()})
local vs_sdkver = msvc:config("vs_sdkver")
if vs_sdkver then
local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*")
assert(tonumber(build_ver) ~= 17763, "Unsupported Windows SDK 10.0.17763.0")
end
end)
on_install("windows", "macosx", "linux", function (package)
if package:config("shared") then
package:add("defines", "LIBLEPT_IMPORTS")
end
local packagedeps = {"libtiff"}
if package:is_plat("windows") and package:is_arch("x86") then
table.insert(packagedeps, "openjpeg")
elseif package:is_plat("macosx") then
io.replace("src/CMakeLists.txt", "${TIFF_LIBRARIES}", [[""]], {plain = true})
end
io.replace("CMakeLists.txt", "NOT JP2K", "FALSE", {plain = true})
local configs = {"-DSW_BUILD=OFF", "-DCMAKE_FIND_FRAMEWORK=LAST", "-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps})
local leptonica_cmake = package:installdir("lib/cmake/leptonica/LeptonicaConfig.cmake")
io.replace(leptonica_cmake, "if ()", "if (1)", {plain = true})
end)
on_test(function (package)

@ -4,12 +4,13 @@ package("tesseract")
set_description("Tesseract Open Source OCR Engine")
set_license("Apache-2.0")
add_urls("https://github.com/tesseract-ocr/tesseract/archive/$(version).tar.gz",
add_urls("https://github.com/tesseract-ocr/tesseract/archive/refs/tags/$(version).tar.gz",
"https://github.com/tesseract-ocr/tesseract.git")
add_versions("4.1.1", "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb")
add_versions("4.1.3", "83dc56b544be938983f528c777e4e1d906205b0f6dc0110afc223f2cc1cec6d3")
add_versions("5.0.1", "b5b0e561650ed67feb1e9de38d4746121d302ae4c876c95b99b8b6f9f89d5c58")
add_versions("5.2.0", "eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c")
add_versions("5.3.4", "141afc12b34a14bb691a939b4b122db0d51bd38feda7f41696822bacea7710c7")
add_configs("training", {description = "Build training tools.", default = false, type = "boolean"})
add_configs("libarchive", {description = "Enable build with libarchive.", default = false, type = "boolean"})
@ -40,7 +41,7 @@ package("tesseract")
io.replace("CMakeLists.txt", "find_package(PkgConfig)", "", {plain = true})
io.replace("src/training/CMakeLists.txt", "find_package(PkgConfig)", "", {plain = true})
local configs = {"-DSW_BUILD=OFF", "-DBUILD_TESTS=OFF", "-DUSE_SYSTEM_ICU=ON"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") then
table.insert(configs, "-DWIN32_MT_BUILD=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
@ -49,7 +50,13 @@ package("tesseract")
table.insert(configs, "-DDISABLE_ARCHIVE=" .. (package:config("libarchive") and "OFF" or "ON"))
table.insert(configs, "-DDISABLE_CURL=" .. (package:config("libcurl") and "OFF" or "ON"))
table.insert(configs, "-DENABLE_OPENCL=" .. (package:config("opencl") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
local packagedeps = {}
if package:is_plat("macosx") then
table.insert(packagedeps, "libtiff")
end
import("package.tools.cmake").install(package, configs, {packagedeps = packagedeps})
package:addenv("PATH", "bin")
end)

@ -112,6 +112,9 @@ function main(pattern)
local count = 0
local maxcount = 5
local instances = _get_all_packages(pattern)
if #instances < maxcount then
maxcount = #instances
end
math.randomseed(os.time())
while count < maxcount and #instances > 0 do
local idx = math.random(#instances)

Loading…
Cancel
Save