@@ -4,79 +4,93 @@ package("openimageio")
44 set_description (" OpenImageIO is a library for reading and writing images, and a bunch of related classes, utilities, and applications." )
55 set_license (" BSD-3-Clause" )
66
7- add_urls (" https://github.com/OpenImageIO/oiio/archive/refs/tags/v$(version).zip" , {version = function (version ) return version :gsub (" %+" , " ." ) end })
8- add_versions (" 2.2.19+0" , " 30a494ccfc2ee951fabbdf308d1b59eddb1a21aa5276887fe6a6fc874454794e" )
9- add_versions (" 2.3.10+1" , " 48ce9b9c3e815885f5634438fed3e240ad186fd9e30d392e17564b5e9eebb089" )
10- add_versions (" 2.3.13+0" , " 4b42e10c93e9954fc89287b9a187c78539c49d16c2947fc140b1452860a54c26" )
7+ add_urls (" https://github.com/AcademySoftwareFoundation/OpenImageIO/releases/download/v$(version)/OpenImageIO-$(version).tar.gz" , {version = function (version ) return version :gsub (" %+" , " ." ) end })
8+ add_versions (" 2.5.19+1" , " 8e3d7473d7a42e527426c38c35187519488ea2a34e994782bd3e6504a209719f" )
9+ add_versions (" 3.1.12+0" , " 704511376faf32767cdcd9aa9a6d0be2b03b91f849ad9008227dc9f0e14bc265" )
1110
1211 add_deps (" cmake" )
13- add_deps (" boost" , {configs = {filesystem = true , system = true , thread = true }})
14- add_deps (" zlib" , " libtiff" , " openexr" , " libjpeg-turbo" , " pugixml" , " libpng" , " robin-map" , " libsquish" , " fmt" )
15- local configdeps = {bzip2 = " BZip2" ,
16- freetype = " Freetype" ,
17- hdf5 = " HDF5" ,
18- opencv = " OpenCV" ,
19- tbb = " TBB" ,
20- giflib = " GIF" ,
21- libheif = " Libheif" ,
22- openjpeg = " OpenJPEG" ,
23- openvdb = " OpenVDB" ,
24- ptex = " Ptex" ,
25- libwebp = " WebP" ,
26- libraw = " LibRaw" ,
27- field3d = " Field3D" ,
28- dcmtk = " DCMTK" ,
29- ffmpeg = " FFmpeg" }
12+ add_deps (" boost" , {configs = {filesystem = true , system = true , thread = true , stacktrace = true }})
13+ add_deps (" opencolorio" , " zlib" , " libtiff" , " openexr" , " libjpeg-turbo" , " pugixml" , " libpng" , " robin-map" , " fmt" )
14+ local configdeps = {bzip2 = " BZip2" ,
15+ freetype = " Freetype" ,
16+ opencv = " OpenCV" ,
17+ tbb = " TBB" ,
18+ giflib = " GIF" ,
19+ libheif = " Libheif" ,
20+ openjpeg = " OpenJPEG" ,
21+ openvdb = " OpenVDB" ,
22+ ptex = " Ptex" ,
23+ libwebp = " WebP" ,
24+ libraw = " LibRaw" ,
25+ libultrahdr = " libuhdr" ,
26+ dcmtk = " DCMTK" ,
27+ ffmpeg = " FFmpeg" }
3028 for conf , dep in pairs (configdeps ) do
31- add_configs (conf , {description = " Build with " .. conf .. " support." , default = ( conf == " libwebp " ) , type = " boolean" })
29+ add_configs (conf , {description = " Build with " .. conf .. " support." , default = false , type = " boolean" })
3230 end
31+ add_configs (" tools" , {description = " Build OpenImageIO tools." , default = false , type = " boolean" })
3332 add_configs (" python" , {description = " Build python bindings." , default = false , type = " boolean" })
3433
3534 if is_plat (" windows" ) then
3635 add_syslinks (" shell32" )
3736 end
38- add_links (" OpenImageIO" , " OpenImageIO_Util" )
3937
40- on_load (" windows" , " macosx" , " linux" , function (package )
38+ on_load (" windows|!arm64 " , " macosx" , " linux" , function (package )
4139 if package :is_plat (" windows" ) and not package :config (" shared" ) then
4240 package :add (" defines" , " OIIO_STATIC_DEFINE" )
4341 end
4442 for conf , dep in pairs (configdeps ) do
4543 if package :config (conf ) then
46- package :add (" deps" , conf )
44+ if (conf == " libwebp" ) then
45+ package :add (" deps" , conf , {configs = {libwebpmux = true }})
46+ else
47+ package :add (" deps" , conf )
48+ end
4749 end
4850 end
4951 if package :config (" python" ) then
5052 package :add (" deps" , " python 3.x" )
5153 package :add (" deps" , " pybind11" )
5254 end
55+ if package :config (" debug" ) then
56+ package :add (" links" , " OpenImageIO_d" , " OpenImageIO_Util_d" )
57+ else
58+ package :add (" links" , " OpenImageIO" , " OpenImageIO_Util" )
59+ end
5360 end )
5461
55- on_install (" windows" , " macosx" , " linux" , function (package )
62+ on_install (" windows|!arm64 " , " macosx" , " linux" , function (package )
5663 io .replace (" CMakeLists.txt" , " NOT ${PROJECT_NAME}_IS_SUBPROJECT" , " TRUE" , {plain = true })
64+ io .replace (" src/png.imageio/png_pvt.h" , " #include <libpng16/png.h>" , " #include <png.h>" , {plain = true })
5765 local configs = {" -DBUILD_DOCS=OFF" ,
5866 " -DINSTALL_DOCS=OFF" ,
5967 " -DOIIO_BUILD_TESTS=OFF" ,
60- " -DOIIO_BUILD_TOOLS=OFF" ,
6168 " -DUSE_QT=OFF" ,
6269 " -DUSE_EXTERNAL_PUGIXML=ON" ,
6370 " -DLINKSTATIC=ON" ,
6471 " -DBoost_USE_STATIC_LIBS=ON" ,
72+ " -DCMAKE_FIND_FRAMEWORK=LAST" ,
6573 " -DCMAKE_DISABLE_FIND_PACKAGE_Nuke=ON" ,
6674 " -DCMAKE_DISABLE_FIND_PACKAGE_R3DSDK=ON" }
6775 table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :debug () and " Debug" or " Release" ))
6876 table.insert (configs , " -DBUILD_SHARED_LIBS=" .. (package :config (" shared" ) and " ON" or " OFF" ))
6977 if package :is_plat (" windows" ) then
70- table.insert (configs , " -DBoost_USE_STATIC_RUNTIME=" .. (package :config ( " vs_runtime " ): startswith ( " MT " ) and " ON" or " OFF" ))
78+ table.insert (configs , " -DBoost_USE_STATIC_RUNTIME=" .. (package :has_runtime ( " MT " , " MTd " ) and " ON" or " OFF" ))
7179 end
7280 for conf , dep in pairs (configdeps ) do
81+ table.insert (configs , " -DUSE_" .. dep .. " =" .. (package :config (conf ) and " ON" or " OFF" ))
7382 table.insert (configs , " -DCMAKE_DISABLE_FIND_PACKAGE_" .. dep .. " =" .. (package :config (conf ) and " OFF" or " ON" ))
7483 end
84+ table.insert (configs , " -DOIIO_BUILD_TOOLS=" .. (package :config (" tools" ) and " ON" or " OFF" ))
7585 table.insert (configs , " -DUSE_PYTHON=" .. (package :config (" python" ) and " ON" or " OFF" ))
7686 if package :config (" python" ) then
7787 os .vrunv (" python" , {" -m" , " pip" , " install" , " numpy" })
7888 end
79- import (" package.tools.cmake" ).install (package , configs )
89+ ext = {packagedeps = {" minizip-ng" , " openssl" }}
90+ if package :is_plat (" windows" ) then
91+ ext .cxflags = " /utf-8"
92+ end
93+ import (" package.tools.cmake" ).install (package , configs , ext )
8094 end )
8195
8296 on_test (function (package )
0 commit comments