add itk, vtk and range-v3 (#360)
* update opencv * improve expat and tmxparser * add range-v3 * add itk * update bzip2 and openjpeg * improve cairo * add vtk * fix version issues * fix opencv * fix copying * update entt * fix missing syslinks * make openssl directories consistentpull/362/head
parent
8e08515a21
commit
bc8c0e585b
14 changed files with 296 additions and 34 deletions
@ -0,0 +1,69 @@ |
||||
package("houdini") |
||||
|
||||
set_homepage("https://www.sidefx.com/") |
||||
set_description("Houdini is built from the ground up to be a procedural system that empowers artists to work freely, create multiple iterations and rapidly share workflows with colleagues.") |
||||
|
||||
on_fetch(function (package, opt) |
||||
if opt.system then |
||||
import("lib.detect.find_path") |
||||
import("lib.detect.find_program") |
||||
import("lib.detect.find_library") |
||||
|
||||
-- init search paths |
||||
local paths = {"$(env Houdini_ROOT)"} |
||||
if package:is_plat("windows") then |
||||
local keys = winos.registry_keys("HKEY_LOCAL_MACHINE\\SOFTWARE\\Side Effects Software\\Houdini *.*.*") |
||||
for _, key in ipairs(keys) do |
||||
table.insert(paths, winos.registry_query(key .. ";InstallPath")) |
||||
end |
||||
elseif package:is_plat("macosx") then |
||||
for _, path in ipairs(os.dirs("/Applications/Houdini/Houdini*.*.*")) do |
||||
table.insert(paths, path) |
||||
end |
||||
else |
||||
for _, path in ipairs(os.dirs("/opt/hfs*.*.*")) do |
||||
table.insert(paths, path) |
||||
end |
||||
end |
||||
|
||||
-- find sdkdir |
||||
local result = {sdkdir = nil, links = {}, linkdirs = {}, includedirs = {}, libfiles = {}} |
||||
result.sdkdir = find_path("houdini_setup", paths) |
||||
if result.sdkdir then |
||||
package:addenv("PATH", path.join(result.sdkdir, "bin")) |
||||
else |
||||
local prog = find_program("houdini", {paths = os.getenv("PATH")}) |
||||
if prog then |
||||
result.sdkdir = path.directory(path.directory(prog)) |
||||
else |
||||
return |
||||
end |
||||
end |
||||
|
||||
-- find library |
||||
local prefix = (package:is_plat("windows") and "lib" or "") |
||||
local libs = {"HAPI"} |
||||
for _, lib in ipairs(libs) do |
||||
local libname = prefix .. lib |
||||
local linkinfo = find_library(libname, {result.sdkdir}, {suffixes = "custom/houdini/dsolib"}) |
||||
if linkinfo then |
||||
table.insert(result.linkdirs, linkinfo.linkdir) |
||||
table.insert(result.links, libname) |
||||
if package:is_plat("windows") then |
||||
table.insert(result.libfiles, path.join(linkinfo.linkdir, libname .. ".lib")) |
||||
table.insert(result.libfiles, path.join(result.sdkdir, "bin", libname .. ".dll")) |
||||
end |
||||
end |
||||
end |
||||
|
||||
-- find headers |
||||
local path = find_path(path.join("HAPI", "HAPI.h"), {result.sdkdir}, {suffixes = path.join("toolkit", "include")}) |
||||
if path then |
||||
table.insert(result.includedirs, path) |
||||
end |
||||
|
||||
if #result.includedirs > 0 and #result.linkdirs > 0 then |
||||
return result |
||||
end |
||||
end |
||||
end) |
@ -0,0 +1,50 @@ |
||||
package("itk") |
||||
|
||||
set_homepage("https://itk.org/") |
||||
set_description("ITK is an open-source, cross-platform library that provides developers with an extensive suite of software tools for image analysis.") |
||||
set_license("Apache-2.0") |
||||
|
||||
add_urls("https://github.com/InsightSoftwareConsortium/ITK/archive/refs/tags/$(version).tar.gz") |
||||
add_versions("v5.2.0", "e53961cd78df8bcfaf8bd8b813ae2cafdde984c7650a2ddf7dcf808df463ea74") |
||||
|
||||
add_deps("cmake", "eigen") |
||||
if is_plat("windows") then |
||||
add_syslinks("shell32", "advapi32") |
||||
elseif is_plat("linux") then |
||||
add_syslinks("dl", "pthread") |
||||
end |
||||
on_load("windows", "linux", "macosx", function (package) |
||||
local ver = package:version():major() .. "." .. package:version():minor() |
||||
package:add("includedirs", "include/ITK-" .. ver) |
||||
local libs = {"ITKWatersheds", "ITKVideoIO", "ITKVideoCore", "ITKVTK", "ITKTestKernel", "ITKRegistrationMethodsv4", "ITKRegionGrowing", "ITKQuadEdgeMeshFiltering", "ITKOptimizersv4", "ITKMarkovRandomFieldsClassifiers", "itklbfgs", "ITKKLMRegionGrowing", "ITKIOVTK", "ITKIOTransformMatlab", "ITKIOTransformInsightLegacy", "ITKIOTransformHDF5", "ITKIOTransformBase", "ITKTransformFactory", "ITKIOStimulate", "ITKIOSpatialObjects", "ITKIOXML", "ITKIOSiemens", "ITKIOPNG", "itkpng", "ITKIONRRD", "ITKNrrdIO", "ITKIONIFTI", "ITKIOMeta", "ITKIOMeshVTK", "ITKIOMeshOFF", "ITKIOMeshOBJ", "ITKIOMeshGifti", "ITKIOMeshFreeSurfer", "ITKIOMeshBYU", "ITKIOMeshBase", "ITKIOMRC", "ITKIOMINC", "itkminc2", "ITKIOLSM", "ITKIOTIFF", "itktiff", "ITKIOJPEG2000", "itkopenjpeg", "ITKIOJPEG", "itkjpeg", "ITKIOHDF5", "ITKIOGIPL", "ITKIOGE", "ITKIOIPL", "ITKIOGDCM", "ITKIOCSV", "ITKIOBruker", "ITKIOBioRad", "ITKIOBMP", "hdf5-static", "hdf5_cpp-static", "ITKPDEDeformableRegistration", "ITKgiftiio", "ITKniftiio", "ITKznz", "gdcmMSFF", "gdcmDICT", "ITKEXPAT", "ITKDiffusionTensorImage", "ITKDenoising", "ITKDeformableMesh", "ITKDICOMParser", "ITKConvolution", "ITKFFT", "ITKColormap", "ITKBiasCorrection", "ITKPolynomials", "ITKOptimizers", "ITKImageFeature", "ITKSmoothing", "ITKIOImageBase", "ITKFastMarching", "ITKQuadEdgeMesh", "ITKMathematicalMorphology", "ITKLabelMap", "ITKPath", "ITKSpatialObjects", "ITKMetaIO", "itkzlib", "ITKMesh", "ITKTransform", "ITKStatistics", "itkNetlibSlatec", "ITKCommon", "itkvcl", "itkvnl_algo", "itkvnl", "itkv3p_netlib", "itksys", "itkdouble-conversion"} |
||||
for _, lib in ipairs(libs) do |
||||
package:add("links", lib .. "-" .. ver) |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "linux", "macosx", function (package) |
||||
local configs = {"-DITK_SKIP_PATH_LENGTH_CHECKS=ON", |
||||
"-DBUILD_TESTING=OFF", |
||||
"-DBUILD_EXAMPLES=OFF", |
||||
"-DITK_WRAPPING=OFF", |
||||
"-DITK_USE_SYSTEM_EIGEN=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:config("pic") ~= false then |
||||
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
||||
end |
||||
if package:is_plat("windows") then |
||||
import("package.tools.cmake").install(package, configs, {buildir = os.tmpdir()}) |
||||
else |
||||
import("package.tools.cmake").install(package, configs) |
||||
end |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
using ImageType = itk::Image<unsigned short, 3>; |
||||
ImageType::Pointer image = ImageType::New(); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = "itkImage.h"})) |
||||
end) |
@ -0,0 +1,36 @@ |
||||
package("range-v3") |
||||
|
||||
set_homepage("https://github.com/ericniebler/range-v3/") |
||||
set_description("Range library for C++14/17/20, basis for C++20's std::ranges") |
||||
set_license("BSL-1.0") |
||||
|
||||
add_urls("https://github.com/ericniebler/range-v3/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/ericniebler/range-v3.git") |
||||
add_versions("0.11.0", "376376615dbba43d3bef75aa590931431ecb49eb36d07bb726a19f680c75e20c") |
||||
|
||||
add_deps("cmake") |
||||
if is_plat("windows") then |
||||
add_cxxflags("/permissive-") |
||||
end |
||||
|
||||
on_install(function (package) |
||||
local configs = {"-DRANGE_V3_DOCS=OFF", "-DRANGE_V3_TESTS=OFF", "-DRANGE_V3_EXAMPLES=OFF", "-DRANGE_V3_PERF=OFF"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
using namespace ranges; |
||||
auto triples = views::for_each(views::iota(1), [](int z) { |
||||
return views::for_each(views::iota(1, z + 1), [=](int x) { |
||||
return views::for_each(views::iota(x, z + 1), [=](int y) { |
||||
return yield_if(x * x + y * y == z * z, |
||||
std::make_tuple(x, y, z)); |
||||
}); |
||||
}); |
||||
}); |
||||
} |
||||
]]}, {configs = {languages = "c++17"}, includes = "range/v3/all.hpp"})) |
||||
end) |
@ -0,0 +1,43 @@ |
||||
package("vtk") |
||||
|
||||
set_homepage("https://vtk.org/") |
||||
set_description("The Visualization Toolkit (VTK) is open source software for manipulating and displaying scientific data.") |
||||
set_license("BSD-3-Clause") |
||||
|
||||
add_urls("https://www.vtk.org/files/release/$(version).tar.gz", {version = function (version) |
||||
return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/VTK-" .. version |
||||
end}) |
||||
add_versions("9.0.1", "1b39a5e191c282861e7af4101eaa8585969a2de05f5646c9199a161213a622c7") |
||||
|
||||
add_deps("cmake") |
||||
if is_plat("windows") then |
||||
add_syslinks("gdi32", "user32", "shell32", "opengl32", "vfw32", "comctl32", "wsock32", "advapi32") |
||||
elseif is_plat("linux") then |
||||
add_syslinks("dl", "pthread") |
||||
end |
||||
on_load("windows", "linux", function (package) |
||||
local ver = package:version():major() .. "." .. package:version():minor() |
||||
package:add("includedirs", "include/vtk-" .. ver) |
||||
local libs = {"vtkViewsInfovis", "vtkCommonColor", "vtkViewsContext2D", "vtkTestingRendering", "vtkTestingCore", "vtkRenderingVolumeOpenGL2", "vtkRenderingOpenGL2", "vtkglew", "vtkopengl", "vtkRenderingLabel", "vtkoctree", "vtkRenderingLOD", "vtkRenderingImage", "vtkIOVeraOut", "vtkhdf5", "vtkIOTecplotTable", "vtkIOSegY", "vtkIOParallelXML", "vtkIOParallel", "vtkjsoncpp", "vtkIOPLY", "vtkIOOggTheora", "vtktheora", "vtkogg", "vtkIONetCDF", "vtknetcdf", "vtkIOMotionFX", "vtkpegtl", "vtkIOMINC", "vtkIOLSDyna", "vtkIOInfovis", "vtklibxml2", "vtkzlib", "vtkIOImport", "vtkIOGeometry", "vtkIOVideo", "vtkIOMovie", "vtkIOExportPDF", "vtklibharu", "vtkIOExportGL2PS", "vtkRenderingGL2PSOpenGL2", "vtkgl2ps", "vtkpng", "vtkIOExport", "vtkRenderingVtkJS", "vtkRenderingSceneGraph", "vtkIOExodus", "vtkexodusII", "vtkIOEnSight", "vtkIOCityGML", "vtkpugixml", "vtkIOAsynchronous", "vtkIOAMR", "vtkInteractionImage", "vtkImagingStencil", "vtkImagingStatistics", "vtkImagingMorphological", "vtkImagingMath", "vtkIOSQL", "vtksqlite", "vtkGeovisCore", "vtklibproj", "vtkInfovisLayout", "vtkViewsCore", "vtkInteractionWidgets", "vtkRenderingVolume", "vtkRenderingAnnotation", "vtkImagingHybrid", "vtkImagingColor", "vtkInteractionStyle", "vtkFiltersTopology", "vtkFiltersSelection", "vtkFiltersSMP", "vtkFiltersProgrammable", "vtkFiltersPoints", "vtkFiltersVerdict", "vtkverdict", "vtkFiltersParallelImaging", "vtkFiltersImaging", "vtkImagingGeneral", "vtkFiltersHyperTree", "vtkFiltersGeneric", "vtkFiltersFlowPaths", "vtkFiltersAMR", "vtkFiltersParallel", "vtkFiltersTexture", "vtkFiltersModeling", "vtkFiltersHybrid", "vtkRenderingUI", "vtkDomainsChemistry", "vtkChartsCore", "vtkInfovisCore", "vtkFiltersExtraction", "vtkParallelDIY", "vtkdiy2", "vtkIOXML", "vtkIOXMLParser", "vtkexpat", "vtkParallelCore", "vtkIOLegacy", "vtkIOCore", "vtkdoubleconversion", "vtklz4", "vtklzma", "vtkutf8", "vtkFiltersStatistics", "vtkeigen", "vtkImagingFourier", "vtkImagingSources", "vtkIOImage", "vtkDICOMParser", "vtkjpeg", "vtkmetaio", "vtktiff", "vtkRenderingContext2D", "vtkRenderingFreeType", "vtkfreetype", "vtkkwiml", "vtkRenderingCore", "vtkFiltersSources", "vtkImagingCore", "vtkFiltersGeometry", "vtkFiltersGeneral", "vtkCommonComputationalGeometry", "vtkFiltersCore", "vtkCommonExecutionModel", "vtkCommonDataModel", "vtkCommonSystem", "vtkCommonMisc", "vtkCommonTransforms", "vtkCommonMath", "vtkCommonCore", "vtkloguru", "vtksys"} |
||||
for _, lib in ipairs(libs) do |
||||
package:add("links", lib .. "-" .. ver) |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "linux", function (package) |
||||
local configs = {"-DVTK_BUILD_TESTING=OFF", "-DVTK_BUILD_EXAMPLES=OFF", "-DVTK_ENABLE_WRAPPING=OFF"} |
||||
table.insert(configs, "-DCMAKE_INSTALL_LIBDIR=lib") |
||||
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) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
vtkCompositeDataPipeline* exec = vtkCompositeDataPipeline::New(); |
||||
vtkAlgorithm::SetDefaultExecutivePrototype(exec); |
||||
exec->Delete(); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = {"vtkAlgorithm.h", "vtkCompositeDataPipeline.h"}})) |
||||
end) |
Loading…
Reference in new issue