add leptonica, tesseract, osqp, partio, libfive and amgcl (#365)
* update glfw * add leptonica and tesseract * add osqp * add partio * fix boost * update freeglut * add libfive * add amgcl * fix some packages * fix libfivepull/368/head
parent
33695fe8b3
commit
3242cfd9ea
12 changed files with 280 additions and 4 deletions
@ -0,0 +1,52 @@ |
||||
package("amgcl") |
||||
|
||||
set_homepage("https://github.com/ddemidov/amgcl/") |
||||
set_description("C++ library for solving large sparse linear systems with algebraic multigrid method") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/ddemidov/amgcl/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/ddemidov/amgcl.git") |
||||
add_versions("1.4.0", "018b824396494c8958faa6337cebcaba48a2584d828f279eef0bbf9e05f900a7") |
||||
|
||||
add_deps("cmake") |
||||
add_deps("boost", {configs = {serialization = true, program_options = true}}) |
||||
on_install("windows", "macosx", "linux", function (package) |
||||
io.replace("CMakeLists.txt", "unit_test_framework", "", {plain = true}) |
||||
local configs = {"-DBoost_USE_STATIC_LIBS=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")) |
||||
if package:is_plat("windows") then |
||||
table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) |
||||
else |
||||
table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=OFF") |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
#include <vector> |
||||
#include <amgcl/backend/builtin.hpp> |
||||
#include <amgcl/adapter/crs_tuple.hpp> |
||||
#include <amgcl/make_solver.hpp> |
||||
#include <amgcl/amg.hpp> |
||||
#include <amgcl/coarsening/smoothed_aggregation.hpp> |
||||
#include <amgcl/relaxation/spai0.hpp> |
||||
#include <amgcl/solver/bicgstab.hpp> |
||||
void test() { |
||||
typedef amgcl::backend::builtin<double> Backend; |
||||
typedef amgcl::make_solver< |
||||
amgcl::amg< |
||||
Backend, |
||||
amgcl::coarsening::smoothed_aggregation, |
||||
amgcl::relaxation::spai0 |
||||
>, |
||||
amgcl::solver::bicgstab<Backend> |
||||
> Solver; |
||||
ptrdiff_t rows, cols; |
||||
std::vector<int> ptr, col; |
||||
std::vector<double> val; |
||||
Solver solve(std::tie(rows, ptr, col, val)); |
||||
} |
||||
]]}, {configs = {languages = "c++17"}})) |
||||
end) |
@ -0,0 +1,13 @@ |
||||
diff --git a/boost/concept_check.hpp b/boost/concept_check.hpp
|
||||
index abbadb7..cab58e5 100644
|
||||
--- a/boost/concept_check.hpp
|
||||
+++ b/boost/concept_check.hpp
|
||||
@@ -352,7 +352,7 @@
|
||||
private:
|
||||
void test(boost::false_type)
|
||||
{
|
||||
- f(first,second);
|
||||
+ (void) f(first,second);
|
||||
Return r = f(first, second); // require operator()
|
||||
(void)r;
|
||||
}
|
@ -0,0 +1,31 @@ |
||||
diff --git a/src/fg_gl2.h b/src/fg_gl2.h
|
||||
index ab8ba5c..a1a52da 100644
|
||||
--- a/src/fg_gl2.h
|
||||
+++ b/src/fg_gl2.h
|
||||
@@ -67,12 +67,18 @@
|
||||
typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
|
||||
typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
|
||||
|
||||
-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
|
||||
-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
|
||||
-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
|
||||
-FGH_PFNGLBUFFERDATAPROC fghBufferData;
|
||||
-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
|
||||
-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
|
||||
-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
|
||||
+#if __GNUC__ > 9
|
||||
+#define FG_ATTRIBUTE_COMMON __attribute__((__common__))
|
||||
+#else
|
||||
+#define FG_ATTRIBUTE_COMMON
|
||||
+#endif
|
||||
+
|
||||
+FGH_PFNGLGENBUFFERSPROC FG_ATTRIBUTE_COMMON fghGenBuffers;
|
||||
+FGH_PFNGLDELETEBUFFERSPROC FG_ATTRIBUTE_COMMON fghDeleteBuffers;
|
||||
+FGH_PFNGLBINDBUFFERPROC FG_ATTRIBUTE_COMMON fghBindBuffer;
|
||||
+FGH_PFNGLBUFFERDATAPROC FG_ATTRIBUTE_COMMON fghBufferData;
|
||||
+FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC FG_ATTRIBUTE_COMMON fghEnableVertexAttribArray;
|
||||
+FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC FG_ATTRIBUTE_COMMON fghDisableVertexAttribArray;
|
||||
+FGH_PFNGLVERTEXATTRIBPOINTERPROC FG_ATTRIBUTE_COMMON fghVertexAttribPointer;
|
||||
|
||||
# endif
|
||||
|
@ -0,0 +1,27 @@ |
||||
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", |
||||
"https://github.com/DanBloomberg/leptonica.git") |
||||
add_versions("1.80.0", "3952b974ec057d24267aae48c54bca68ead8275604bf084a73a4b953ff79196e") |
||||
|
||||
add_deps("cmake") |
||||
add_deps("libwebp", {configs = {img2webp = true, webpmux = true}}) |
||||
add_deps("zlib", "libtiff", "libpng", "libjpeg", "giflib") |
||||
on_install("windows", "linux", function (package) |
||||
local configs = {"-DSW_BUILD=OFF"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
if package:config("pic") ~= false then |
||||
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
||||
end |
||||
import("package.tools.cmake").install(package, configs, {buildir = "build"}) |
||||
-- will be removed in 2.5.4 |
||||
os.trymv(path.join("build", "install", "cmake"), package:installdir()) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("pixCleanBackgroundToWhite", {includes = "leptonica/allheaders.h"})) |
||||
end) |
@ -0,0 +1,33 @@ |
||||
package("libfive") |
||||
|
||||
set_homepage("https://libfive.com/") |
||||
set_description("libfive is a software library and set of tools for solid modeling, especially suited for parametric and procedural design.") |
||||
|
||||
add_urls("https://github.com/libfive/libfive.git") |
||||
add_versions("20210408", "e6a6448694f2204b003e29bba45754461261b9b2") |
||||
|
||||
add_deps("cmake", "eigen", "libpng", "boost") |
||||
if not is_plat("windows") then |
||||
add_deps("pkg-config") |
||||
end |
||||
on_install("windows", "macosx", "linux", function (package) |
||||
if package:is_plat("windows") then |
||||
io.replace("libfive/src/CMakeLists.txt", "EIGEN_INCLUDE_DIRS", "EIGEN3_INCLUDE_DIRS", {plain = true}) |
||||
io.replace("libfive/src/CMakeLists.txt", "if (UNIX)", "if (true)", {plain = true}) |
||||
io.replace("CMakeLists.txt", "%/MD.", "") |
||||
end |
||||
io.replace("libfive/include/libfive.h", "[[deprecated(\"use libfive_tree_nullary instead\")]]", "", {plain = true}) |
||||
io.replace("libfive/src/CMakeLists.txt", "bash -c \"git diff --quiet --exit-code || echo +\"", "echo +", {plain = true}) |
||||
local configs = {"-DBUILD_GUILE_BINDINGS=OFF", "-DBUILD_PYTHON_BINDINGS=OFF", "-DBUILD_STUDIO_APP=OFF", "-DBUILD_TESTS=OFF"} |
||||
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")) |
||||
if package:config("pic") ~= false then |
||||
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
os.trycp("libfive/include", package:installdir("include")) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("libfive_mesh_delete", {includes = "libfive.h"})) |
||||
end) |
@ -0,0 +1,23 @@ |
||||
package("osqp") |
||||
|
||||
set_homepage("https://osqp.org/") |
||||
set_description("The Operator Splitting QP Solver") |
||||
set_license("Apache-2.0") |
||||
|
||||
add_urls("https://github.com/oxfordcontrol/osqp.git") |
||||
add_versions("v0.6.2", "f9fc23d3436e4b17dd2cb95f70cfa1f37d122c24") |
||||
|
||||
add_deps("cmake") |
||||
on_install("windows", "macosx", "linux", "mingw", function (package) |
||||
local configs = {} |
||||
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")) |
||||
if package:config("pic") ~= false then |
||||
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("osqp_solve", {includes = "osqp/osqp.h"})) |
||||
end) |
@ -0,0 +1,30 @@ |
||||
package("partio") |
||||
|
||||
set_homepage("http://partio.us/") |
||||
set_description("Partio is an open source C++ library for reading, writing and manipulating a variety of standard particle formats (GEO, BGEO, PTC, PDB, PDA).") |
||||
set_license("BSD-3-Clause") |
||||
|
||||
add_urls("https://github.com/wdas/partio/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/wdas/partio.git") |
||||
add_versions("v1.14.0", "f98874b781e92ab9b5d0575cabc437d27274cd91cb581f80960918efa491f902") |
||||
|
||||
add_deps("cmake", "python", "zlib") |
||||
on_install("windows", "macosx", "linux", function (package) |
||||
io.gsub("CMakeLists.txt", "add%_subdirectory%(.+%)", "add_subdirectory(src/lib)") |
||||
io.gsub("CMakeLists.txt", "find%_package%(GLUT REQUIRED%)", "") |
||||
local configs = {} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
if package:config("pic") ~= false then |
||||
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
Partio::ParticlesDataMutable* particles=Partio::createInterleave(); |
||||
particles->addParticles(10); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = "Partio.h"})) |
||||
end) |
@ -0,0 +1,40 @@ |
||||
package("tesseract") |
||||
|
||||
set_homepage("https://tesseract-ocr.github.io/") |
||||
set_description("Tesseract Open Source OCR Engine") |
||||
set_license("Apache-2.0") |
||||
|
||||
add_urls("https://github.com/tesseract-ocr/tesseract/archive/$(version).tar.gz", |
||||
"https://github.com/tesseract-ocr/tesseract.git") |
||||
add_versions("4.1.1", "2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb") |
||||
|
||||
add_configs("training", {description = "Build training tools.", default = false, type = "boolean"}) |
||||
|
||||
add_deps("cmake") |
||||
add_deps("leptonica") |
||||
add_deps("libarchive", {optional = true}) |
||||
on_load(function (package) |
||||
if package:config("training") then |
||||
package:add("deps", "icu4c") |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "linux", function (package) |
||||
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, "-DBUILD_SHARED_LIBS=OFF") |
||||
table.insert(configs, "-DWIN32_MT_BUILD=" .. (package:config("vs_runtime"):startswith("MT") 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, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
package:addenv("PATH", "bin") |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
os.vrun("tesseract --version") |
||||
assert(package:has_cxxtypes("tesseract::TessBaseAPI", {configs = {languages = "c++11"}, includes = "tesseract/baseapi.h"})) |
||||
end) |
Loading…
Reference in new issue