|
|
@ -8,24 +8,35 @@ package("tesseract") |
|
|
|
"https://github.com/tesseract-ocr/tesseract.git") |
|
|
|
"https://github.com/tesseract-ocr/tesseract.git") |
|
|
|
add_versions("4.1.1", "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb") |
|
|
|
add_versions("4.1.1", "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb") |
|
|
|
add_versions("4.1.3", "83dc56b544be938983f528c777e4e1d906205b0f6dc0110afc223f2cc1cec6d3") |
|
|
|
add_versions("4.1.3", "83dc56b544be938983f528c777e4e1d906205b0f6dc0110afc223f2cc1cec6d3") |
|
|
|
add_versions("5.0.1","eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c") |
|
|
|
add_versions("5.0.1", "b5b0e561650ed67feb1e9de38d4746121d302ae4c876c95b99b8b6f9f89d5c58") |
|
|
|
add_versions("5.2.0","eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c") |
|
|
|
add_versions("5.2.0", "eba4deb2f92a3f89a6623812074af8c53b772079525b3c263aa70bbf7b748b3c") |
|
|
|
|
|
|
|
|
|
|
|
add_configs("training", {description = "Build training tools.", default = false, type = "boolean"}) |
|
|
|
add_configs("training", {description = "Build training tools.", default = false, type = "boolean"}) |
|
|
|
|
|
|
|
add_configs("libarchive", {description = "Enable build with libarchive.", default = false, type = "boolean"}) |
|
|
|
|
|
|
|
add_configs("libcurl", {description = "Enable build with libcurl.", default = false, type = "boolean"}) |
|
|
|
|
|
|
|
add_configs("opencl", {description = "Enable experimental OpenCL support.", default = false, type = "boolean"}) |
|
|
|
|
|
|
|
|
|
|
|
add_deps("cmake") |
|
|
|
add_deps("cmake") |
|
|
|
add_deps("leptonica") |
|
|
|
add_deps("leptonica") |
|
|
|
add_deps("libarchive", {optional = true}) |
|
|
|
on_load("windows", "macosx", "linux", function (package) |
|
|
|
on_load("windows", "linux", function (package) |
|
|
|
|
|
|
|
if package:config("training") then |
|
|
|
if package:config("training") then |
|
|
|
package:add("deps", "icu4c") |
|
|
|
package:add("deps", "icu4c") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
if package:config("libarchive") then |
|
|
|
|
|
|
|
package:add("deps", "libarchive") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
if package:config("libcurl") then |
|
|
|
|
|
|
|
package:add("deps", "libcurl") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
if package:config("opencl") then |
|
|
|
|
|
|
|
package:add("deps", "opencl") |
|
|
|
|
|
|
|
end |
|
|
|
if package:config("shared") then |
|
|
|
if package:config("shared") then |
|
|
|
package:add("defines", "TESS_IMPORTS") |
|
|
|
package:add("defines", "TESS_IMPORTS") |
|
|
|
end |
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_install("windows", "linux", function (package) |
|
|
|
on_install("windows|x86", "windows|x64", "macosx", "linux", function (package) |
|
|
|
io.replace("CMakeLists.txt", "find_package(PkgConfig)", "", {plain = true}) |
|
|
|
io.replace("CMakeLists.txt", "find_package(PkgConfig)", "", {plain = true}) |
|
|
|
io.replace("src/training/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"} |
|
|
|
local configs = {"-DSW_BUILD=OFF", "-DBUILD_TESTS=OFF", "-DUSE_SYSTEM_ICU=ON"} |
|
|
@ -35,9 +46,9 @@ package("tesseract") |
|
|
|
table.insert(configs, "-DWIN32_MT_BUILD=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) |
|
|
|
table.insert(configs, "-DWIN32_MT_BUILD=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) |
|
|
|
end |
|
|
|
end |
|
|
|
table.insert(configs, "-DBUILD_TRAINING_TOOLS=" .. (package:config("training") and "ON" or "OFF")) |
|
|
|
table.insert(configs, "-DBUILD_TRAINING_TOOLS=" .. (package:config("training") and "ON" or "OFF")) |
|
|
|
if package:config("pic") ~= false then |
|
|
|
table.insert(configs, "-DDISABLE_ARCHIVE=" .. (package:config("libarchive") and "OFF" or "ON")) |
|
|
|
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
|
|
|
table.insert(configs, "-DDISABLE_CURL=" .. (package:config("libcurl") and "OFF" or "ON")) |
|
|
|
end |
|
|
|
table.insert(configs, "-DENABLE_OPENCL=" .. (package:config("opencl") and "ON" or "OFF")) |
|
|
|
import("package.tools.cmake").install(package, configs) |
|
|
|
import("package.tools.cmake").install(package, configs) |
|
|
|
package:addenv("PATH", "bin") |
|
|
|
package:addenv("PATH", "bin") |
|
|
|
end) |
|
|
|
end) |
|
|
|